function imageOver(obj)
{
     var srcName = obj.src;
     obj.src = srcName.replace("-off.","-over.");
}

function imageOut(obj)
{
     var srcName = obj.src;
     obj.src = srcName.replace("-over.","-off.");
}

function imageClick(obj)
{
     var srcName = obj.src;
     obj.src = srcName.replace("-over.","-on.");
}

function showPopUp(url,w,h)
{
    var iTop,iLeft,settings
    var popupWin
			
    iLeft=(screen.width)?(screen.width-w)/2:100;
    iTop=(screen.height)?(screen.height-h)/2:100;
		
    settings='width='+w+',height='+h+',top='+iTop+',left='+iLeft+',scrollbars=auto,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	
    popupWin = window.open(url,"",settings);
    self.name = "mainWin"; 
    popupWin.focus();
	
    return false;
}

function showPopUpScrollable(url,w,h)
{
    var iTop,iLeft,settings
    var popupWin
			
    iLeft=(screen.width)?(screen.width-w)/2:100;
    iTop=(screen.height)?(screen.height-h)/2:100;
		
    settings='width='+w+',height='+h+',top='+iTop+',left='+iLeft+',scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
	
    popupWin = window.open(url,"",settings);
    popupWin.focus();
	
    return false;
}

function toMail()
{
    var PageLoc=window.location.toString();
    var is_Valid=PageLoc.indexOf('&');
    if(is_Valid==-1)
    {
        window.open("admin/email.aspx?loc="+PageLoc,"SendThisPage","height=470,width=410,status=yes,toolbar=no,menubar=no,location=no,scrollbars=no,left=10,top=180");    
    }
    else
    {
        var splitLoc_array=new String(PageLoc);
        splitLoc_array=splitLoc_array.split("&");
        var temp=splitLoc_array[0]+"%26"+splitLoc_array[1];
        window.open("admin/email.aspx?loc="+temp,"SendThisPage","height=470,width=410,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,left=10,top=180");    
    }
    
}
function OpenOPIAccountActivationPage(UserName)
{
    window.location.href="/Home.aspx";
    window.open("/NewOPIAccountActivation.aspx?UID="+UserName,"SendThisPage","height=285,width=435,status=yes,toolbar=no,resizable=yes,menubar=no,location=no,scrollbars=no,left=10,top=180");
    
 }
 function OpenResetPasswordPage(UserName)
{
    window.location.href="/Home.aspx";
    window.open("/BaseChangePassword.aspx?UID="+UserName,"SendThisPage","height=230,width=445,status=yes,toolbar=no,resizable=yes,menubar=no,location=no,scrollbars=no,left=10,top=180");
 }
function signIn()
{
    window.open("/NewSignInPage.aspx","SendThisPage","height=285,width=735,status=yes,toolbar=no,resizable=yes,menubar=no,location=no,scrollbars=no,left=10,top=180");
}
function Register()
{
    window.open("/NewOPIRegistrationPage.aspx?RType=A","SendThisPage","height=620,width=673,status=yes,resizable=yes,toolbar=no,menubar=no,location=no,scrollbars=no,left=10,top=180");
}
function ChangePassword()
{
    window.open("/ChangePassword.aspx","SendThisPage","height=230,width=400,status=yes,toolbar=no,resizable=yes,menubar=no,location=no,scrollbars=no,left=10,top=180");
}
function EditProfile()
{
     window.open("/NewOPIRegistrationPage.aspx?RType=E","SendThisPage","height=610,width=724,status=yes,resizable=yes,toolbar=no,menubar=no,location=no,scrollbars=no,left=10,top=180");
}
function mailAlert()
{
    window.open("/emailalert.aspx","SendThisPage","height=350,width=400,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,left=10,top=180");
}
function changeImage(type)
{
    parent.location.replace("index.aspx?img="+type);        
}
function search()
{
    var searchText;
    searchText = document.form1.txtSearch.value;
	document.form1.query.value = searchText;
	document.form1.action="http://search.freefind.com/find.html";
	document.form1.method="get";
	document.form1.submit();
}
function printPage(img,type,id)
{
    window.open("print.aspx?img="+img+"&"+type+"="+id,'PrintPage','height=400,width=950,scrollbars=yes,left=10,top=180,resizable=1');
}
function openPDF(fpath)
{
    window.open(fpath,'2001News','width=800,height=500,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no');
}
function displayContactUs()
{
    var objIframe = document.getElementById("iframe");
    if(objIframe != null)
    {
        objIframe.style.display = "block";
        setPageWidth();
    }
}
function setPageWidth()
{
    var objDivContactUs = document.getElementById("divContactUs");
    if(objDivContactUs != null)
    {
        var myWidth = 0;
        if( typeof( window.innerWidth ) == 'number' ) 
        {
            //Non-IE                             
            myWidth = window.innerWidth;
        }
        else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
        {
            //IE 6+ in 'standards compliant mode'
            myWidth = document.documentElement.clientWidth;
        }
        else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
        {
            //IE 4 compatible               
            myWidth = document.body.clientWidth;
        }
        if (myWidth > 0)
        {
            if(myWidth <= 800)
            {
                objDivContactUs.style.left = myWidth * 0.915 + 'px'
            }
            else if((myWidth > 800) && (myWidth <= 960))
            {
                objDivContactUs.style.left = myWidth * 0.761 + 'px'
            }
            else if((myWidth > 960) && (myWidth <= 1024))
            {
                objDivContactUs.style.left = myWidth * 0.71 + 'px'
            }
            else if((myWidth > 1024) && (myWidth <= 1088))
            {
                objDivContactUs.style.left = myWidth * 0.7 + 'px'
            }
            else if((myWidth > 1088) && (myWidth <= 1152))
            {
                objDivContactUs.style.left = myWidth * 0.688 + 'px'
            }
            else if((myWidth > 1152) && (myWidth <= 1280))
            {
                objDivContactUs.style.left = myWidth * 0.67 + 'px'
            }
            else if(myWidth > 1280)
            {
                objDivContactUs.style.left = myWidth * 0.5 + 'px'
            }
        }
    }
}
function uploadResume()
{
    window.open("attachResume.aspx",'UploadResume','height=780,width=500,scrollbars=yes,left=10,top=180,resizable=1');
}
// JScript File
//funtions to validate maximum characters for the multi line text box
    function doKeypress(control,maxLength)
    {
        //maxLength = control.attributes['MaxLength'].value;
        value = control.value;
        if(maxLength && value.length > maxLength-1)
        {
          event.returnValue = false;
          maxLength = parseInt(maxLength);
          alert("Field cannot exceed " +maxLength+ " characters!");
        }
    }
    function doBeforePaste(control,maxLength)
    {   
        //maxLength = control.attributes["MaxLength"].value;
        if(maxLength)
        {
          event.returnValue = false;
        }
    }
    function doPaste(control,maxLength)
    {  
        //maxLength = control.attributes["MaxLength"].value;
        value = control.value;
        if(maxLength)
        {
          event.returnValue = false;
          maxLength = parseInt(maxLength);
          var oTR = control.document.selection.createRange();
          var iInsertLength = maxLength - value.length + oTR.text.length;
          var sData = window.clipboardData.getData("Text").substr(0,iInsertLength);
          oTR.text = sData;
            if((iInsertLength - sData.length) < 1)
            {
                alert("Field cannot exceed " +maxLength+ " characters!");
            }
        }
    }
    
 /*Functions to change the images on mouse over / on mouse out of image - Management SubArticle  */
      
 function MM_preloadImages()
 {
    //v3.0
    var d=document; 
    if(d.images)
    { 
        if(!d.MM_p)
        {
            d.MM_p=new Array();
        }
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
        for(i=0; i<a.length; i++)
        {
            if (a[i].indexOf("#")!=0)
            {
             d.MM_p[j]=new Image;
             d.MM_p[j++].src=a[i];
            }
        }        
    }
 }
 function MM_swapImgRestore()
 {
    //v3.0
    var i,x,a=document.MM_sr;
    for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
    {
        x.src=x.oSrc;
    }
 }

function MM_findObj(n, d)
{ 
   //v4.01
   var p,i,x;  
   if(!d) 
   {
        d=document;
   }
   if((p=n.indexOf("?"))>0&&parent.frames.length)
    {
        d=parent.frames[n.substring(p+1)].document;
        n=n.substring(0,p);
    }
    if(!(x=d[n])&&d.all)
    x=d.all[n];
    for (i=0;!x&&i<d.forms.length;i++) 
    x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++)
    x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById)
    x=d.getElementById(n);
    return x;
}

function MM_swapImage()
{ 
   //v3.0
   var i,j=0,x,a=MM_swapImage.arguments;
   document.MM_sr=new Array;
   for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null)
   {
     document.MM_sr[j++]=x;
     if(!x.oSrc)
     x.oSrc=x.src;
     x.src=a[i+2];
   }
}