function PopWindow(strUrl,strWindowName,strWidth,strHeight,strToolbar,strScrollbar,strResizable, strLocation){		
	var strAttributes;
	strAttributes = "toolbar=" + strToolbar + ",scrollbars=" + strScrollbar + ",resizable=" + strResizable + ",width=" + strWidth + ",height=" + strHeight + ",location=" + strLocation + ",left=0,top=0";
	 var subWin = window.open(strUrl,strWindowName,strAttributes);		
		
	if(subWin!=null) subWin.focus;
	    	
}	

function closeWindow() 
{
	document.write(""); 
window.opener = self; 
window.close();
	
}


var crucimg;
// clickimggomidimg
function GotoMidImg(strMinImgUrl,strMaxImgUrl,cruimg)
{
	var subMaxImgUrl;
	
	document.getElementById("DisplayMidImgUrl").src=strMinImgUrl;
	strMaxImgUrl=strMaxImgUrl.substring(0,strMaxImgUrl.length-4);
	
	document.getElementById("DisplayMaxImgPage").href = "javascript:ViewImage('view_" + strMaxImgUrl + ".asp');";
	document.getElementById("DisplayMaxImgPage1").href = "javascript:ViewImage('view_" + strMaxImgUrl + ".asp');";
	var midimg = document. getElementsByTagName("img");
	for( i=0;i<midimg.length;i++)
	{
		if(midimg[i].id == "ggmidimg")
			midimg[i].className = "imgfilter";
	}
	crucimg.className = "";
	
}
function retuncru(obj)
{
	crucimg=obj;
}

function ViewImage(objectwindow)
{
	if(objectwindow=="view_max_singlejob1.asp")
	    window.open("http://www.salary.com/docs/resources/SampleJobValuationReport.pdf","","resizable=yes,toolbar=no")
	    else if(objectwindow=="view_max_multiplejob1.asp")
	        window.open(objectwindow,"","width=650,height=650,resizable=yes");
	      else 
	        window.open(objectwindow,"","width=650,height=600,resizable=yes");
}


function collapsecert(strShowDiv,strHiddenDiv)
{
	var aTemp;
	document.getElementById(strShowDiv).style.display="";
	
	aTemp=strHiddenDiv.split("|||");
	
	for( i=0;i<aTemp.length;i++)
	{
		document.getElementById(aTemp[i]).style.display="none";
	}
}

function collapsecertforpartners(strShowDiv, cValue)
{
	if(document.getElementById(strShowDiv).style.display=="none")
	{
		document.getElementById(strShowDiv).style.display="inline";
		    for(i = 0;i<=cValue;i++)
	    {
	        if(i = cValue)
	            {
	                //document.getElementById(cValue).style.display="none";
	                document.getElementById(Number(cValue)+1).style.display="inline";
		        }    
	    } 
	}
	else
	{
		document.getElementById(strShowDiv).style.display="none";
		for(i = 1;i <= cValue;i++)
	    {
	        if(i = cValue)
	            {
		            document.getElementById(Number(cValue)-1).style.display="inline";
		        }    
	    } 
	}
	
	if(arguments.length==2)
	{
		if(document.getElementById(arguments[1]).style.display=="none")
			document.getElementById(arguments[1]).style.display="inline";
		else
			document.getElementById(arguments[1]).style.display="none";
				
	}
}


function collapsecert1(strShowDiv,strHiddenDiv)
{
	var aTemp;
	var imgSrc;
	var tempImgSrc;
	document.getElementById(strShowDiv).style.display="";
	if(strShowDiv=="divbenefits")
	{
		imgSrc="/images/Tab_Benefits_ON.gif";
	}
	else if(strShowDiv=="divfeatures")
	{
		imgSrc="/images/Tab_Features_ON.gif";
	}
	else if(strShowDiv=="divscreenshots")
	{
		imgSrc="/images/Tab_Screen_ON.gif";
	}
	else if(strShowDiv=="divrequestInfo")
	{
		imgSrc="/images/Tab_Requst-Info_ON.gif";
	}
	document.getElementById("img_"+strShowDiv).src=imgSrc;
	
	aTemp=strHiddenDiv.split("|||");
	
	for( i=0;i<aTemp.length;i++)
	{
		document.getElementById(aTemp[i]).style.display="none";
		if(aTemp[i]=="divbenefits")
		{
			tempImgSrc="/images/Tab_Benefits.gif";
		}
		else if(aTemp[i]=="divfeatures")
		{
			tempImgSrc="/images/Tab_Features.gif";
		}
		else if(aTemp[i]=="divscreenshots")
		{
			tempImgSrc="/images/Tab_Screen.gif";
		}
		else if(aTemp[i]=="divrequestInfo")
		{
			tempImgSrc="/images/Tab_Requst-Info.gif";
		}
		document.getElementById("img_"+aTemp[i]).src=tempImgSrc;
	}
}


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_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];}
   
}


function isEmail(strValue)
{
	var re;
//	re = /^[\w-][\w-.]*[\w-]@[\w-][\w-.]*[\w]$/;
	re = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
	if (strValue.match(re))
		return true;
	else
		return false;
}
function isEmailValid(strEmail)
{
	/* The following pattern is used to check if the entered e-mail address
		fits the user@domain format.  It also is used to separate the username
		from the domain. 
		
		Now, as you know, email address are always in a particular format:
		username @ domain . extension

		That makes them an ideal candidate to be tested with a regular expression. 
		So let's take a look at an expression I wrote to check the validity of an 
		email address. We'll look at each section of the expression individually. 
		But first, here's the expression itself:
		
		^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,99})$

		Let's split it into sections and make sense of each part individually:

		^[a-zA-Z0-9._-]+@

		This part of the expression validates the 'username' section of the email address. 
		The hat sign (^) at the beginning of the expression represents the start of the 
		string. If we didn't include this, then someone could key in anything they wanted 
		before the email address and it would still validate.

		Contained in the square brackets are the characters we want to allow in this part 
		of the address. Here, we are allowing the letters a-z, A-Z, the numbers 0-9, and 
		the symbols underscore (_), period (.), and dash (-). The order of the character 
		pairs within the brackets doesn't matter.

		The plus (+) sign after the square brackets indicates 'one or more of the contents of 
		the previous brackets'. So, in this case, we require one or more of any of the 
		characters in the square brackets to be included in the address in order for it to 
		validate. Finally, there is the '@' sign, which means that we require the presence of 
		one @ sign immediately following the username.

		[a-zA-Z0-9._-]+\.

		This part of the expression is very similar to the section we looked at. It validates 
		the domain name in the email address. As before, we have a series of characters in 
		square brackets that we'll allow in this part of the address, followed by a plus (+) 
		sign, requiring one or more of those characters.

		At the end of this section, there is a backslash, then a period sign. This tells the 
		expression that a period is required at this point in the expression (ie. [5] between 
		the domain and extension). However, the backslash is slightly more complicated. 
		In a regular expression, a period actually means 'any character'. In order to make 
		this expression take the period's literal value rather than use it as a wildcard for 
		any character, we need to 'escape' it -- this is done by preceding the period with a 
		backslash. 

		[a-zA-Z]{2,4}$

		This is the final part of the expression. At the beginning is another set of 
		characters enclosed in square brackets. This time, I have simply allowed the 
		letters a-z and A-Z, because numbers and other characters are not valid in 
		domain extensions. 

		Instead of the + sign we used before, here we have '{2,99}' immediately following 
		the square brackets. This means that we require between 2 and 99 of the characters 
		from the square brackets to be included in the email address. 
		So com, net, org, uk, au, etc. are all valid, but anything longer than 99 
		will not be accepted. 

		Finally, the $ sign at the end of the expression signifies the end of the string.
		If we didn't include this, then a user could type anything after the end of the 
		email address and it would still validate.

		*/
		var strEmailPat="^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.([a-zA-Z]{2,99})$";


		var arrMatchArray=strEmail.match(strEmailPat);

		if (arrMatchArray==null) {

			//Invalid email syntax
			alert("Email address seems incorrect.");
			return false;
		}else{
			//display each part of the email
			var strUser = arrMatchArray[0];
			var tmp = strUser.split("@");
			var strTLD = "";
			
			strUser = tmp[0];
			var strHost = tmp[1];
			tmp = strHost.split(".");
			
			for(var i=0; i<tmp.length; i++){
				if(i == 0)
					strHost = tmp[i];
				else{
					if(i == tmp.length-1)
						strTLD += tmp[i];
					else
						strTLD += tmp[i] + "|";
				}
			}
			
		}
		
		return true;
}
function isZipCode(strValue)
{
	var re;
	re = /^\d{5}$/;
	if (strValue.match(re))
		return true;
	else
		return false;
}

function isPhoneNumber(strValue)
{
	var re;
	re = /^\d{3}-\d{3}-\d{4}$/;
	if (strValue.match(re))
		return true;
	else
		return false;
}

function isPhoneNumberExt(strValue)
{
	var re;
	re = /^\d{1,5}$/;
	if (strValue.match(re))
		return true;
	else
		return false;
}


function isYearOfExp(strValue)
{
	var re;
	re = /^\d{1,3}$/;
	if(strValue.match(re))
		return true;
	else
		return false;
}

function isInt(strNumber)
{
	var strValidChars = "0123456789";
	var i
	var strChar

	for (i=0 ; i < strNumber.length; i++) {
		strChar = strNumber.charAt(i);
		if (strValidChars.indexOf(strChar) == -1)
			return false;
	}
	return true;
}

function trim(strValue) {
	return trimRight(trimLeft(strValue));	
}

function trimLeft(strValue) {
	if (strValue == null) return null;
	if (strValue.length == 0) return strValue;
	for (i=0; i<strValue.length; i++) {
		if (strValue.charAt(i) != ' ')
			return strValue.substr(i);
	}
	return "";
}

function trimRight(strValue) {	
	if (strValue == null) return null;
	if (strValue.length == 0) return strValue;
	for (i=strValue.length-1; i>=0; i--) {
		if (strValue.charAt(i) != ' ')
			return strValue.substring(0, i+1);
	}
	return "";
}

function salOpenWindow(strUrl,strWindowName,strWidth,strHeight,strToolbar,strScrollbar,strResizable){		
	var strAttributes;
	strAttributes = "toolbar=" + strToolbar + ",scrollbars=" + strScrollbar + ",resizable=" + strResizable + ",width=" + strWidth + ",height=" + strHeight + ",left=0,top=0";
	 var subWin = window.open(strUrl,strWindowName,strAttributes);		
		
	if(subWin!=null) subWin.focus;
	    	
}	

function openFormWindow(strUrl, strWindowName, strWidth, strHeight){		
			
	 var subWin = window.open(strUrl,strWindowName,
							"menubar=yes,toolbar=no,scrollbars=yes," + 
								"resizable=yes,width=" + strWidth + "," +
									"height=" + strHeight + ",left=100,top=50");		
		
	if(subWin!=null) subWin.focus;
	    	
}



/* JS function added to Link Destination Page to Payscore */


function linkpurchase()
{
    //document.mainform.ispurchase.value = "1";
    document.mainform.target = "_self";
	document.mainform.method = "post";
	document.mainform.action = "https://securepayscore.salary.com/PayScore/LayoutScripts/Pysl_Ecm_Products.aspx?ispurchase=1";
	document.mainform.submit();
}
function linkDemo()
{
    
    document.mainform.target = "_self";
	document.mainform.method = "post";
	document.mainform.action = "https://securepayscore.salary.com/PayScore/LayoutScripts/Pysl_Ecm_RequestDemo.aspx?src=demo_request_eu_PayScore";
	document.mainform.submit();
}
function linkfreetrial()
{
    //document.mainform.isfreetrial.value  = "1";
    document.mainform.target = "_self";
	document.mainform.method = "post";
	document.mainform.action = "https://securepayscore.salary.com/PayScore/LayoutScripts/Pysl_Ecm_Register.aspx?isfreetrial=1";
	document.mainform.submit();
}
var flg="0";
function changebgcolor(strDiv)
{
	
	if( strDiv.className=="left_menu02_select")
	{
		flg="0";
	}
	else{
		flg="1";	
	}
    strDiv.style.backgroundColor="#EFEFEF";
	
}
function changebgcolor_out(strDiv)
{
	if(flg=="1")
	
    strDiv.style.backgroundColor="#fafafa";
	
}

var flg2="0";
function changebgcolor2(strDiv)
{
	
	if( strDiv.className=="left_menu04_inside_comps_bold")
	{
		flg2="0";
	}
	else{
		flg2="1";	
	}
	
    strDiv.style.backgroundColor="#fafafa";
	
}
function changebgcolor_out2(strDiv)
{
    	strDiv.style.backgroundColor="#EFEFEF";
	
}
var flg3="0";
function changebgcolor3(strDiv)
{
	
	if( strDiv.className=="left_menu01_whysal")
	{
		flg3="0";
	}
	else{
		flg3="1";
	}
    strDiv.style.backgroundColor="#EFEFEF";
	
}
function changebgcolor_out3(strDiv)
{
	
	if(flg3=="1")
	
    strDiv.style.backgroundColor="#fafafa";
	
}

var flg4="0";
function changebgcolor4(strDiv)
{
	
	if( strDiv.className=="left_menu04_inside_sltions")
	{
		flg4="0";
	}
	else{
		flg4="1";	
	}
    strDiv.style.backgroundColor="#fafafa";
	
}
function changebgcolor_out4(strDiv)
{
	if(flg4=="1")
	
    strDiv.style.backgroundColor="#EFEFEF";
	
}



function nextDiv(strDiv1,strDiv2)
{
	document.getElementById(strDiv1).style.display="none";
	document.getElementById(strDiv2).style.display="";
	if(document.getElementById("bb"))
	{
		window.location="customers.asp#bb"			
	}
					
	
}

function show_sma_div(div_id)
{
	if(document.getElementById(div_id).style.display=="none")
		document.getElementById(div_id).style.display="";
	else
		document.getElementById(div_id).style.display="none";
}


function show_sma_div1(div,div1,div2)
{
		document.getElementById(div).style.display="";
		
		document.getElementById(div1).style.display="none";
		document.getElementById(div2).style.display="none";
}
function changebg(div)
{
		var midimg = document.getElementsByTagName("div");
		for( i=0;i<midimg.length;i++)
		{
			if(midimg[i].className == "left_menu03" || midimg[i].className == "left_menu03_2")
				midimg[i].className = "left_menu03";
		}
		div.className= "left_menu03_2";
}

function changcolor1(strspan)
{
	strspan.style.color="#ff9b21";
	
}

function changcolor2(strspan)
{
	
	strspan.style.color="#666666";
}

function displaythirdmenu()
{       
   document.all("thirdmenu").className="thmenunew";
}

function disposethirdmenu()
{
    document.all("thirdmenu").className="thmenu";

}
function newSearch(objForm)
{
 var objSearchTextValue = objForm.searchtextvalue;
 var strKeyWord = objSearchTextValue.value;

 if( objSearchTextValue.value == "")
 {
  alert("Please specify a key word");
  objSearchTextValue.focus();
  return false;
 }

 return true;
}

function insertFlash(url, w, h)
{
var strWidth='',strHeight='';
if(w!=0){strWidth = ' width="'+ w +'" ';}
if(h!=0){strHeight = ' height="'+ h +'" ';}

document.write('<div style="padding-left:20px !important;padding-left:40px;">');
document.write('<object '+ strWidth + strHeight +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">'); 
document.write('<param name="movie" value="'+ url +'">');
document.write('<param name="wmode" value="transparent">');
document.write('<param name="wmode" value="opaque">');
document.write('<param name="quality" value="high">');
document.write('<embed '+ strWidth + strHeight +'" src="'+ url +'" quality="high" wmode="transparent" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>');
document.write('</object>');
document.write('</div>');
}


/*******************************rotatingNews start***********************************/

function startRotatingNews()
	{

		var RotatingNews = document.getElementById("rotatingNews");

		var arrNews =document.getElementById("dvRotatingNews").getElementsByTagName("SPAN");

		RotatingNews.arrNews = arrNews;
		RotatingNews.newsIndex = 0;

		RotatingNews.rgbStart = 243;

		RotatingNews.rgbStop = 102;

		RotatingNews.rgb = RotatingNews.rgbStart;

		RotatingNews.fadingTime = 10;

		RotatingNews.fadingStepSize = 5;

		RotatingNews.style.color = "rgb(" + RotatingNews.rgbStart + "," + RotatingNews.rgbStart + "," + RotatingNews.rgbStart + ")";

		

		if(window.addEventListener){ 

			RotatingNews.addEventListener("mouseover", Link_OnMouseOver, false);

			RotatingNews.addEventListener("mouseout", Link_OnMouseOut, false);

		} else { // IE

			RotatingNews.onmouseenter = Link_OnMouseOver;

			RotatingNews.onmouseleave = Link_OnMouseOut;

		}


		rotateNews();

		RotatingNews.colorTimer = window.setInterval("fadingIn()",RotatingNews.fadingTime);

	}


	function Link_OnMouseOver(evt)
	{
		var aObj;
		try{

			aObj = event.srcElement;
		}

		catch(e)
		{
			aObj = event.target;

		}

		aObj.mouseIsOver = true;

	}
	function Link_OnMouseOut(){
		var aObj;
		try{
			aObj = event.srcElement;
		}
		catch(e)
		{
			aObj = event.target;
		}
		aObj.mouseIsOver = false;

	}

	function rotateNews()

	{
		var RotatingNews = document.getElementById("rotatingNews");

		var objNews = RotatingNews.arrNews[RotatingNews.newsIndex];

		if(RotatingNews.newsIndex==0)
		RotatingNews.innerHTML = "<a href='http://www.salary.com/aboutus/layoutscripts/abtl_default.asp?tab=abt&cat=cat012&ser=ser041&part=Par1396&isdefault=0' target='_blank'><img src=/images/clear.gif height=5/><br><b>In the news </b> | "+objNews.getAttribute("text")+ "</a>";
		else if (RotatingNews.newsIndex==1)
		RotatingNews.innerHTML = "<img src=/images/clear.gif height=5/><br><b>7,000+ customers and growing  </b> | "+objNews.getAttribute("text") + "";
		else if (RotatingNews.newsIndex==2)
		RotatingNews.innerHTML = "<a href='http://www.salary.com/aboutus/layoutscripts/abtl_default.asp?tab=abt&cat=cat012&ser=ser041&part=Par1217&isdefault=0' target='_blank'><img src=/images/clear.gif height=5/><br><b>In the news </b> | "+objNews.getAttribute("text")+ "</a>";
		else if (RotatingNews.newsIndex==3)
		RotatingNews.innerHTML = "<img src=/images/clear.gif height=5/><br><b>7,000+ customers and growing  </b> | "+objNews.getAttribute("text") + "";
		else if (RotatingNews.newsIndex==4)
		RotatingNews.innerHTML = "<a href='http://www.salary.com/aboutus/layoutscripts/abtl_default.asp?tab=abt&cat=cat012&ser=ser041&part=Par1386&isdefault=0' target='_blank'><img src=/images/clear.gif height=5/><br><b>In the news </b> | "+objNews.getAttribute("text")+ "</a>";
		else if (RotatingNews.newsIndex==5)
		RotatingNews.innerHTML = "<img src=/images/clear.gif height=5/><br><b>7,000+ customers and growing  </b> | "+objNews.getAttribute("text") + "";
		else if (RotatingNews.newsIndex==6)
		RotatingNews.innerHTML = "<a href='http://www.salary.com/aboutus/layoutscripts/abtl_default.asp?tab=abt&cat=cat012&ser=ser041&part=Par991&isdefault=0' target='_blank'><img src=/images/clear.gif height=5/><br><b>In the news </b> | "+objNews.getAttribute("text")+ "</a>";
		

		/*RotatingNews.href = objNews.getAttribute("link");*/


		RotatingNews.newsIndex++;

		if(RotatingNews.newsIndex >= RotatingNews.arrNews.length)

			RotatingNews.newsIndex = 0;

	}

	function waitNews(){

		var RotatingNews = document.getElementById("rotatingNews");

		RotatingNews.colorTimer = window.setInterval("fadingOut()",RotatingNews.fadingTime);

	}



function fadingIn(){

		var RotatingNews = document.getElementById("rotatingNews");
		
		if(RotatingNews.rgbStart<=RotatingNews.rgbStop){

			if(RotatingNews.rgb >= RotatingNews.rgbStop){

				window.clearInterval(RotatingNews.colorTimer);

				window.setTimeout("waitNews()",5000);

				return;

			}

			else{

				RotatingNews.rgb += RotatingNews.fadingStepSize;

			}

		}

		else{

			if(RotatingNews.rgb <= RotatingNews.rgbStop){

				window.clearInterval(RotatingNews.colorTimer);

				window.setTimeout("waitNews()",5000);

				return;

			}

			else{

				RotatingNews.rgb -= RotatingNews.fadingStepSize;

			}

		}

		RotatingNews.style.color = "rgb(" + RotatingNews.rgb + "," + RotatingNews.rgb + "," + RotatingNews.rgb + ")";

	}
	

		function fadingOut(){

		var RotatingNews = document.getElementById("rotatingNews");

		

		if(RotatingNews.mouseIsOver){
			return;
		}


		if(RotatingNews.rgbStart<=RotatingNews.rgbStop){



			if(RotatingNews.rgb <= RotatingNews.rgbStart){

				window.clearInterval(RotatingNews.colorTimer);
				rotateNews();
				
				RotatingNews.colorTimer = window.setInterval("fadingIn()",RotatingNews.fadingTime);

				return;

			}

			else{

				RotatingNews.rgb -= RotatingNews.fadingStepSize;

			}



		}

		else{

			if(RotatingNews.rgb >= RotatingNews.rgbStart){

				window.clearInterval(RotatingNews.colorTimer);				

				rotateNews();

				RotatingNews.colorTimer = window.setInterval("fadingIn()",RotatingNews.fadingTime);

				return;

			}

			else{

				RotatingNews.rgb += RotatingNews.fadingStepSize;

			}

		}


		RotatingNews.style.color = "rgb(" + RotatingNews.rgb + "," + RotatingNews.rgb + "," + RotatingNews.rgb + ")";

	}



function openCommonWindow(strUrl,strWidth,strHeight){		
			
		 var subWin = window.open(strUrl,"CommonWindow",
								"toolbar=yes,scrollbars=yes," + 
									"resizable=yes,width=" + strWidth + "," +
										"height=" + strHeight + ",left=0,top=0");		
		
		if(subWin!=null) subWin.focus;
	    	
	}


/*******************************rotatingNews end***********************************/


// Copyright 1999-2006, Trovix, Inc. All Rights Reserved.
// Confidential and Proprietary Information of Trovix, Inc.
// Patents Pending.

function getJobHostBaseUrl(url)
{
	var baseUrl = url.substring(0, url.indexOf("ListJobPosts.do")-1);

	return baseUrl;
}

function getNewUrl(baseUrl, accountId, context, strutsAction, actionValue )
{
	if( isDefined(accountId) )
	{
		return baseUrl.valueOf() + "/" + strutsAction + "?accountId=" + accountId + "&action=" + actionValue;
	}
	else if(isDefined(context) )
	{
		return baseUrl.valueOf() + "/" + strutsAction + "?context=" + context + "&action=" + actionValue;
	}

}

function processRequest()
{
	var query=this.location.search.substring(1);

	var params=query.split("&");
	var queryParamHash = new Array();


    for ( var i=0 ; i < params.length ; i++)
    {
    	var pos = params[i].indexOf("=");
        var name = params[i].substring(0, pos);
        var value = params[i].substring(pos + 1);
        queryParamHash[name] = value;
    }

	var accountId = queryParamHash['accountId'];
	var context =   queryParamHash['context'];

	var action = queryParamHash['action'];
	var jobHostFrame = document.getElementById("jobhostframe");
	var newUrl = "";

	if ( isDefined(jobHostFrame))
	{
		var baseUrl = new String(getJobHostBaseUrl(jobHostFrame.src));

		if ( action == 'applyToJobEmail' )
		{
			var newUrl =  getNewUrl(baseUrl, accountId, context, "ApplyToJobPostResume.do", action );
			var jobPostId = queryParamHash['jobPostId'];
			newUrl += "&jobPostId=" + jobPostId;
			jobHostFrame.src = newUrl;
		}
		else if ( action == 'applyToJobExt' )
		{
			var newUrl = baseUrl.valueOf() + "/ApplyToJobPostResumeExt.do?" + action + "&" + query;
			jobHostFrame.src = newUrl;
		}
		else if( action == 'viewDetails' )
		{
			var newUrl = getNewUrl(baseUrl, accountId, context, "ViewJobPostDetails.do", action );
			var jobId = queryParamHash['jobId'];

			newUrl += "&jobId=" + jobId;
			jobHostFrame.src = newUrl;
		}

	}

	return true;
}

function scrolltotop() {
	window.scrollBy(0,0);
}

function isDefined( v )
{
	return ( typeof(v) != "undefined" );
}

function renderJobhostIframe(frameWidth, frameHeight, frameStyle,  frameSrc)
{
	var frameHtml = "<IFRAME id=\"jobhostframe\" FRAMEBORDER=\"0\" width=\"" + frameWidth  +  "\" height=\"" + frameHeight + "\" onload=\"javascript:scroll(0,0);\" style=\"" + frameStyle + "\" src=\"" + frameSrc + "\"></IFRAME>";
	document.write(frameHtml);

	processRequest();
}


