/* Salary.com javascript function Copyright 2006 Salary.com, Inc*/
function salGetPageName (strLocation){
    if (strLocation == "")	
		return "";
		
    var iDotIdx = 0;
    var iNumOfCharToAdd = 0;
    var iSlash = strLocation.lastIndexOf("/");
    var strPageName = "";
    
    if (strLocation.indexOf(".asp")>0)
    {    
		iDotIdx = strLocation.indexOf(".asp");
		iNumOfCharToAdd = 4;
	}
	else if (strLocation.indexOf(".html")>0)
    {    
		iDotIdx = strLocation.indexOf(".html");
		iNumOfCharToAdd = 5;
	}
	else if (strLocation.indexOf(".htm")>0)
    {    
		iDotIdx = strLocation.indexOf(".htm");
		iNumOfCharToAdd = 4;
	}
    
   
    if (iDotIdx > 0)
    {
		strPageName = strLocation.substring(iSlash+1,iDotIdx + iNumOfCharToAdd);
    }
    return strPageName;
	//var curQS = strLocation.substring(iIdx+1,strLocation.length);
    	
}

function salGetQSParam (strLocation, strParam){
    if (strLocation == "")	
		return "";
		
    var iParamIdx = 0;
    var iAmpIdx = 0;
    var strValue = "";
    var strTemp = "";
    
    if (strLocation.indexOf('?' + strParam + '=')>0)
    {    
		iParamIdx = strLocation.indexOf('?' + strParam + '=');
		iParamIdx = iParamIdx + strParam.length + 1;
		strValue = strLocation.substring(iParamIdx+1,strLocation.length+1);
		if (strValue.indexOf('&')>0)
			strValue = strValue.substring(0,strValue.indexOf('&'));
	}
	else if (strLocation.indexOf('&' + strParam + '=')>0)
    {    
		iParamIdx = strLocation.indexOf('&' + strParam + '=');
		iParamIdx = iParamIdx + strParam.length + 1;
		strValue = strLocation.substring(iParamIdx+1,strLocation.length+1);
		if (strValue.indexOf('&')>0)
			strValue = strValue.substring(0,strValue.indexOf('&'));
	} 
    
    return strValue;
    	
}

function salGetVirName (strLocation){
    if (strLocation == "")	
		return "";
	if (strLocation.indexOf('://')>0)
		strLocation = strLocation.substring(strLocation.indexOf('://')+3, strLocation.length+1);
    
    var iSlashIdx = 0;
    var strValue = "";

    if (strLocation.indexOf('/')>0)
    {    
		iSlashIdx = strLocation.indexOf('/');
		strValue = strLocation.substring(iSlashIdx+1,strLocation.length+1);
		if (strValue.indexOf('/')>0)
			strValue = strValue.substring(0,strValue.indexOf('/'));
	}   
    return strValue;
    	
}
function salGetProdName (strLocation){
    if (strLocation == "")	
		return "";
	
	var strValue = "";
	if (strLocation.indexOf('://')>0)
	{
		var iDotIdx = 0;
		iDotIdx = strLocation.indexOf('.');
		strValue = strLocation.substring(strLocation.indexOf('://')+3, iDotIdx);
    }
    return strValue;
    	
}
function salGetHiddenValue(objControl)
{
	if (objControl)
		return objControl.value;
	else
		return "";
		
}
