// JavaScript Document
function getURL(param){
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 ){
var strQueryString = strHref.substr(strHref.indexOf("?")).toLowerCase();
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
if (aQueryString[iParam].indexOf(param + "=") > -1 ){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;
}
}
}
return strReturn;
}

function setURL(param,val) {
var present1 = window.location.href.indexOf('?');
var present2 = window.location.href.indexOf(param);
if (present1 < 0) 
	{window.location.href=window.location.href+'?'+param+'='+val;
	}
else 
	{if (present2 < 0)
		{window.location.href=window.location.href+'&'+param+'='+val;
		}
	 else
	 	{var colarray = window.location.href.split(param);
		 var after = colarray[1].split('&')[1];
		 if (after!=undefined) {window.location.href=colarray[0]+param+'='+val+'&'+after;}
		 else {window.location.href=colarray[0]+param+'='+val;}
		}
	}
}

function setURLop(param,val) {
var present1 = window.opener.location.href.indexOf('?');
var present2 = window.opener.location.href.indexOf(param);
if (present1 < 0) 
	{window.opener.location.href=window.opener.location.href+'?'+param+'='+val;
	}
else 
	{if (present2 < 0)
		{window.opener.location.href=window.opener.location.href+'&'+param+'='+val;
		}
	 else
	 	{var colarray = window.opener.location.href.split(param);
		 var after = colarray[1].split('&')[1];
		 if (after!=undefined) {window.opener.location.href=colarray[0]+param+'='+val+'&'+after;}
		 else {window.opener.location.href=colarray[0]+param+'='+val;}
		}
	}
}
