if (document.all) {
//IE 5.+
document.oncontextmenu =
	function () {
	return false;
	};
document.onkeydown =
	function () {
		if ((window.event.keyCode == 78 && window.event.ctrlKey == true) || window.event.keyCode == 93) {
	 	window.event.keyCode = 0;
	 	window.event.cancelBubble = true;
	 	window.event.returnValue = false;
	 	return false;
	 	}
	};
} else if (document.layers) {	 		
//NS 4.x
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown =
	function (evt) {
	 	if (evt.which >= 2)
	 	return false;
	 	};
} else if (parseInt(navigator.appVersion) >= 5 && navigator.appName == "Netscape") {
//NS 6.+
document.oncontextmenu =
	function () {
	return false;
	};
}

function chloc(x,y){

setCookie('chlocal', 'true');
temp = x + ".aspx"

var query = document.location.search.substring(1);

if (query.lastIndexOf('&') != query.length - 1){
query += '&';
}

if (typeof y != "undefined"){
variable = y.substr(0, y.indexOf('='))

while (query.indexOf(variable) != -1)
query = query.replace(query.substring(query.indexOf(variable), query.indexOf('&', query.indexOf(variable))+1),'')

temp += '?' + query
temp += y
} else {
temp += '?' + query
}



document.location = temp
delCookie('chlocal');
}

function getCookie(NameOfCookie)
{
if (document.cookie.length > 0) 
{ 
begin = document.cookie.indexOf(NameOfCookie+"="); 
if (begin != -1) // Note: != means "is not equal to"
{ 
begin += NameOfCookie.length+1; 
end = document.cookie.indexOf(";", begin);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(begin, end)); } 
}
return null; 
}

function setCookie(NameOfCookie, value, expiredays) 
{
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
document.cookie = NameOfCookie + "=" + escape(value) + 
((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

function delCookie (NameOfCookie) 
{
if (getCookie(NameOfCookie)) {
document.cookie = NameOfCookie + "=" +
"; expires="+ new Date();
}
}




