    document.write("<SCRIPT SRC='scripts/NoRightClick.js'></SCRIPT>");

    var nCount = 0;
    function openSendEmail(name)
    {
        var emailPopup = open('EmailPopup.shtml','emailpopup','width=805,height=435');
        while (typeof(emailPopup.completedLoadingFlag) == typeof(undefined))
        {}
        emailPopup.setupEmailName(name);
    }

    function showNote( source)
    {    if(event==null)
            return;
         var div1 = document.getElementById(source);

         if( div1.style.display== "inline" ){
             div1.style.display = "none";
         }else {
             div1.style.display = "inline";
         }
    }

    function JCGetElementsByName( sElementName )
    {
      nCounter = 0;
      aNewArray = new Array( );

      aAllObjects = document.all;
      if ( document.layers )
        aAllObjects = document.layers;

      for ( nLoopCount = 0; nLoopCount < aAllObjects.length; nLoopCount++ )
      {
        if ( aAllObjects[ nLoopCount ].name == sElementName )
        {
          aNewArray[ nCounter ] = aAllObjects[ nLoopCount ];
          nCounter++;
        }        
      }
      return aNewArray;
    }


    // Before calling this method you must implement JCMap_OnLocationSelect( sLocID, sLocName )
    function openLocationLookupDefaultStart( nLocationID )
    {
      JCMapPopupInst = open( 'JCMapIndexPopup.jsp?value=' + nLocationID, 'MapLookup', 'width=550,height=320' );      
    }

    // Priority Location lookup
    // Open lookup with location location already selected given 3 priority IDs.
    // If the first is 0 or null, then the next is considered.
    // Used for memorising last selection, location in profile or default location.
    function openLocationLookupUserDefault( sCurrentLocationID, nUserLocationID, nDefaultLocationID )
    {
      // if first two parameters is not empty and id > 0 then it is valid
      if ( sCurrentLocationID != "" && sCurrentLocationID > 0 )
        JCMapPopupInst = open( 'JCMapIndexPopup.jsp?candvalue=' + sCurrentLocationID, 'MapLookup', 'width=550,height=320' );
      else if ( nUserLocationID != "" && nUserLocationID > 0 )
        JCMapPopupInst = open( 'JCMapIndexPopup.jsp?candvalue=' + nUserLocationID, 'MapLookup', 'width=550,height=320' );
      else
        openLocationLookupDefaultStart( nDefaultLocationID );
    }

    // Before calling this method you must implement JCMap_OnLocationSelect( sLocID, sLocName )
    function openLocationLookup( )
    {
      JCMapPopupInst = open( 'JCMapIndexPopup.jsp', 'MapLookup', 'width=550,height=320' );      
    }

     function openRecruitmentAssistant(id)
     {
              if(event==null)
                  return;

      open('RecruitmentAssistant.html#'+id,'assist','scrollbars');
      }

      function openAdvertiseWithUs(id)
      {
               if(event==null)
                   return;

         open('AdvertiseWithUs.html#'+id,'advertiseWithUs', 'width=500,height=320');
      }

      function openQuestionForm()
      {
       open('QuestionForm.shtml', 'qform','scrollbars');
      }


      function openQuestionList()
      {
             open('Advertiser_QuestionSearch_Popup.shtml','qsearch','height=580,width=825,scrollbars');
      }

      function showAdvertiserPage(showId, hideId){
           var showDiv= document.getElementById(showId);
           var hideDiv= document.getElementById(hideId);
           showDiv.style.display= "inline";
           hideDiv.style.display = "none";
      }

     // Same as openSectorLookup - included for older versions
     function openIndustryLookup(optional_fieldID, optional_fieldName,option_type,popup_type)
     { 
       if(option_type=="sector")       
            var sectorLookup=open('JCSectorSelectionPopup.jsp?SectorID=' + optional_fieldID.value + '&type=sector','JCSectorSelectionPopup','width=360,height=400,scrollbars');                   
       else       
            sectorLookup=open('JCSectorSelectionPopup.jsp?LocationID=' + optional_fieldID.value + '&type=location&popup_type=' + popup_type,'JCSectorSelectionPopup','width=360,height=400,scrollbars');       
       
//        RT#  22188, Gagan, 23rd May 2006       
       try
        {
            while(sectorLookup.document.readyState!="complete");
        }
            catch(e)
            {
                if (typeof(e)!=typeof(undefined))
                return;
            }

       sectorLookup.JCSectorTree_output = optional_fieldName;
       sectorLookup.JCSectorTree_outputId = optional_fieldID;
       sectorLookup.JCSectorTree_outputArr = eval("oArr" + option_type);            
       sectorLookup.JCSectorTree_outputType = option_type;
       sectorLookup.focus();

  }

     function openSectorLookup(optional_fieldID, optional_fieldName,option_type,popup_type)
     {
       if(option_type=="sector")       
            var sectorLookup=open('JCSectorSelectionPopup.jsp?SectorID=' + optional_fieldID.value + '&type=sector','JCSectorSelectionPopup','width=360,height=400,scrollbars');                   
       else       
        {   // var sectorLookup=open('JCSectorSelectionPopup.jsp?LocationID=' + optional_fieldID.value + '&type=location','JCSectorSelectionPopup','width=360,height=400,scrollbars');       
           var sectorLookup=open('JCSectorSelectionPopup.jsp?LocationID=' + optional_fieldID.value + '&type=location&popup_type=' + popup_type,'JCSectorSelectionPopup','width=360,height=400,scrollbars');       
         }
       
       // RT 20326
       // Vijay
       /*
           RT#  22188, Gagan, 23rd May 2006
           To handle the exception when location/sector popup is 
           explicitly closed before completely opened.
        */
       try
        {
            while(sectorLookup.document.readyState!="complete");
        }catch(e)
            {       
                if (typeof(e)!=typeof(undefined))
                return;
            }

           sectorLookup.JCSectorTree_output = optional_fieldName;
           sectorLookup.JCSectorTree_outputId = optional_fieldID;  
           sectorLookup.JCSectorTree_outputArr = eval("oArr" + option_type);            
           sectorLookup.JCSectorTree_outputType = option_type;
           sectorLookup.focus();

     }

     // The optional_fieldID field object is used only to read the current selection
     function openSectorFunctionLookup( oFunction, optional_fieldID,sectortype,option_type )
     {
       if(typeof(option_type)==typeof(undefined) || option_type=="sector") //RT 26836 Parveen Rohilla 1st Sep 06    
            var sectorFunctionLookup=open('JCSectorSelectionPopup.jsp?SectorType=' + (sectortype ? sectortype : "") + '&&SectorID=' + optional_fieldID.value + '&type=sector', 'sectorFunctionLookup','width=360,height=400,scrollbars');
       else       
            var sectorFunctionLookup=open('JCSectorSelectionPopup.jsp?LocationID=' + optional_fieldID.value + '&type=location','JCSectorSelectionPopup','width=360,height=400,scrollbars');                

//           RT#  22188, Gagan, 23rd May 2006          
         try
         {
            while(sectorFunctionLookup.document.readyState!="complete"); 
         } catch(e)
                 {
                    if (typeof(e)!=typeof(undefined))
                    return;
                 }


       sectorFunctionLookup.JCSectorTree_OnSelectSector = oFunction;
       if(typeof(option_type)!=typeof(undefined))
       {
            sectorFunctionLookup.JCSectorTree_outputArr = eval("oArr" + option_type);            
            sectorFunctionLookup.JCSectorTree_outputType = option_type;
       }         
         sectorFunctionLookup.JCSectorTree_output = optional_fieldID;
         //sectorFunctionLookup.JCSectorTree_outputId = optional_fieldID;

        sectorFunctionLookup.focus();
     }
   
     function checkAll( oCheckAllCheckObj, aCheckList )
     {
       var bToCheck = oCheckAllCheckObj.checked;
       for ( var nCount = 0; nCount < aCheckList.length; nCount++ )
       {
         aCheckList[nCount].checked = bToCheck;
       }
        
     }

  function openJobSearchAssistant(id)
  {           
    open('template/JobSearchAssistant.html#'+id,'jsassist','scrollbars');
  }
        
  function openNotPermitted( )
  {
    open('JCNotPermittedPopup.jsp','JCNotPerm','width=200,height=100');
  }

  function arrayContains( oArray, oEnrty )
  {
    for ( var acCount = 0; acCount < oArray.length; acCount++ )
    {
      if ( oArray[ acCount ] == oEntry )
        return true;
    }
    return false;
  }

 function Uploadfile(type)
     {
             if(event==null)
                 return;

		var x, y;
		
		var winWidth = 350;
        	var winHeight = 150;
		x = screen.width - winWidth - 30;
		y = screen.height - winHeight - 100;
		newWin = window.open("FileUpload.jsp?type="+type, "height=" + winHeight +
			                                            ", width=" + winWidth +
			                                            ", top=" + y + ", left=" + x +
			                                            ",status=yes,toolbar=no,menubar=no,location=no,resizable=no");
		newWin.focus(); 
			
	}

  function Uploadfile(type,sScreen)
        {
		var x, y;
		
		var winWidth = 350;
        	if(type=='CompLogo')
                {
                    var winHeight = 180;
                }
                else
                {
                    var winHeight = 125;
                } 
		x = screen.width - winWidth - 30;
		y = screen.height - winHeight - 100;
		newWin = window.open("FileUpload.jsp?type="+type+"&jcScreen="+sScreen, null, "height=" + winHeight +
			                                            ", width=" + winWidth +
			                                            ", top=" + y + ", left=" + x +
			                                            ",status=yes,toolbar=no,menubar=no,location=no,resizable=no");
		
                newWin.focus(); 

			
	}

      function check(){
            var allBox=document.forms[0].C1;
            
	   if (document.forms[0].top.checked){
	 	for (var i = 0; i<allBox.length; ++ i)
		{
			allBox[i].checked = true;
		}
		}else{
			for (var i = 0; i<allBox.length; ++ i)
			{
				allBox[i].checked = false;
			}
		}
 	}


      function check(sForm){
            var allBox=document.forms[sForm].C1;
	   if (document.forms[sForm].top.checked){
                if(typeof(allBox.length)!="undefined")
                {
                    for (var i = 0; i<allBox.length; ++ i)
                    {
                    	allBox[i].checked = true;
                    }
                  }
                  else
                  {
                    allBox.checked = true
                    }
                }else{
                            if(typeof(allBox.length)!="undefined")
                            {
                        	for (var i = 0; i<allBox.length; ++ i)
                                {
                                    allBox[i].checked = false;
                                }
                          }
                          else
                           allBox.checked = false;
                          
                    
            }
}

 function replaceAll( str, from, to ) {
            var idx = str.indexOf( from );


            while ( idx > -1 ) {
                str = str.replace( from, to ); 
                idx = str.indexOf( from );
            }

            return str;
}

function getCheckValue(sForm)
{

    var allBox=document.forms[sForm].C1;
	    var sval = document.getElementById("checkstatus").value ;
	        if(typeof(allBox)!="undefined")
                {
                    if(typeof(allBox.length)!="undefined")
                    {
                        for (var i = 0; i<allBox.length; ++ i)
                        {
                            if(allBox[i].checked == true)
                            {

                              if(sval!="null" && sval!="" && sval.indexOf("|"+allBox[i].value+"|")==-1)
                                sval = sval+allBox[i].value+"|";
                              else if(sval== "null" || sval=="" )
                                sval = "|"+allBox[i].value+"|";
                                }
                        }
                    }
                    else if(typeof(allBox.value)!="undefined" &&  (allBox.checked==true))
                    {
                          if(sval!="null" && sval!="" && sval.indexOf("|"+allBox.value+"|")==-1)
                                sval = sval+allBox.value+"|";
                              else if(sval== "null" || sval=="" )
                                sval = "|"+allBox.value+"|";
                
                    }
                if(sval!=null && sval!="")
                {
                    document.getElementById("checkstatus").value  = sval;
                   }
        }
}


function viewNoteList(id,rank) 
{ if(event==null) 
  return;
            window.open("ApplyNote.do?jobID="+id+"&mode=load&rank="+rank,'JCNote','top=0,left=0,directories=no,height=300,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=520');
 }

// RT 20326
// Vijay
// Purpose : Variable jobDetailWindow is used to focus the already opened jobdetail window.

function viewJob(id,rank)
 {
        if(event==null)
            return;
  
  var jobDetailWindow= window.open("JobDetails.do?jobID="+id+"&rank="+rank,'JCJob','top=0,left=0,directories=no,height=650,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no,width=800');
  jobDetailWindow.focus(); 
 }

function resetCheckStatus(checkname,sForm)
      {
              var sval = "";
             var allBox=document.forms[sForm].C1;
	   if (document.forms[sForm].top.checked==false){
                if(typeof(allBox.length)!="undefined")
                {
                    sval = document.getElementById(checkname).value;
                    for (var i = 0; i<allBox.length; ++ i)
                    {
                    	var objCheck = allBox[i];
                        if(sval!=null && sval.indexOf("|"+objCheck.value+"|")!=-1)
                          sval = replaceAll(sval,"|"+objCheck.value+"|","|");
                          sval = replaceAll(sval,"||","|");
                          
                    }
                    document.getElementById(checkname).value = sval;
                  }
                  else
                  {
                    
                           sval = document.getElementById(checkname).value;
                           if(sval!=null && sval.indexOf("|"+allBox.value+"|")!=-1)
                            sval = replaceAll(sval,"|"+allBox.value+"|","|");
                           sval = replaceAll(sval,"||","|");
                           document.getElementById(checkname).value = sval;
                   
                   }
               } 
            
      }

//this function does not return complete string
//just chek line no 300 there i am leaving the occurence of last character
//this is created specially because replace method of javascript string does not replace
//\\n properly it leaves forward slash
 function replace(str, original, replacement) {
            var result;
            result = "";
            while(str.indexOf(original) != -1) {
            if (str.indexOf(original) > 0)
            result = result + str.substring(0, str.indexOf(original)) + replacement;
            else
            result = result + replacement;
            str = str.substring(str.indexOf(original) + original.length, str.length);
           }
          return result + str;
       }

// Encode carriage returns in a text box into the newline char.
// Usage is primarily for placing text in the database row.
function encodeNewlineReturns( sText )
{
  var sMsgFormatString = escape( sText );
  //Order or replace commands important
  sMsgFormatString = sMsgFormatString.replace( /%0D%0A/gi, "\\n" ); //Win
  sMsgFormatString = sMsgFormatString.replace( /%0D/gi, "\\n" );    //UNIX
  sMsgFormatString = sMsgFormatString.replace( /%0A/gi, "\\n" );    //Mac
  return unescape( sMsgFormatString );
}

// The reverse method for the above.
function decodeNewlineReturns( sText )
{
  sText = sText.replace( /\\\\n/gi, "%0D%0A" );
  sText = sText.replace( /\\n/gi, "%0D%0A" );
  return unescape( sText );
}

// Adjusts number of escape characters from two slashes to one
function unescapeChars( sText )
{
  sText = sText.replace( /\\\\/gi, "\\" );
  return sText;
}

// Processes encoded characters.
// Created to change new line charcters in a db retrieved string to <BR>.
function processTextAsHTML( sText )
{
  sText = sText.replace( /\\\\n/gi, "<BR>" );
  sText = sText.replace( /\\n/gi, "<BR>" );
  sText = sText.replace( /\n/gi, "<BR>" );
  return sText;
}

// Processes encoded characters.
// Created to change new line charcters in a db retrieved string to spaces.
function processTextIgnoreEncoding( sText )
{
  sText = sText.replace( /\\\\n/gi, " .. " );
  sText = sText.replace( /\\n/gi, " .. " );
  return sText;
}
//this function will use to call viewdocument.jsp in new window
 function ViewDocument(mode,id)
 {  
    if(event==null)
        return;
      if(mode=='view')
       {   
          nCount = nCount+1;
          window.open('about:blank','ADDocument'+nCount,'top=0,left=0,directories=no,height=400,location=no,menubar=yes,resizable=yes,scrollbars=no,status=no,toolbar=no,width=750');
          document.forms.item("JSDoc").target='ADDocument'+nCount;
          document.getElementById("DocID").value=id;
          document.getElementById("mode").value=mode;
          document.forms.item("JSDoc").action="Document.do";
          document.forms.item("JSDoc").submit();
        }
}

// Generated methods for page/image manipulation
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

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_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_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];}
}

//method to encode url so that the special characters like 
//& or + for example sectorname can be passed with url
function URLencode(sStr) {
    return escape(sStr).replace(/\+/g, '%2B').replace(/\"/g,'%22').replace(/\'/g, '%27');
  }

function trimSpaceAndNewLine(str,fieldId)
{
str=str.replace(/(^ *)|( *$)/gm,"");

str=escape(str);

while((str.indexOf("%0D%0A")==0)||(str.lastIndexOf("%0D%0A")!=-1 && str.lastIndexOf("%0D%0A")==(str.length-6)))
{

    str=str.replace(/(^%0D%0A*)|(%0D%0A*$)/gm,"");
}
str=unescape(str);      

document.getElementById(fieldId).value=str;

return str;
}

// RT 19460
// Author : Vijay Kumar Verma
// Purpose: Select all the options from select box
 
function selectAllOptions( oSelectObject ) 
{
     for (var nCount = 0; nCount < oSelectObject.options.length; nCount++) {
      oSelectObject.options[nCount].selected = true;
     }
}

// RT 19460
// Author : Vijay Kumar Verma
// Purpose: Populate all selected sector and location.

function populateArray( ofieldIDs )
{
var oArr=new Array();
    if(ofieldIDs.value!="")
       {
            var tmpVal=ofieldIDs.value;
            if(tmpVal.charAt(0)==",")
                tmpVal=tmpVal.replace(",","");
            
            if(tmpVal.charAt(tmpVal.length-1)==",")
                tmpVal=tmpVal.substr(0,tmpVal.length-1);

            oArr=tmpVal.split(",,");
        }    
return oArr;
} 

function showUnderConstructionPopup()
{
	alert("The page is under construction.");
}

