﻿function CurrLocation() {var loc=window.location.toString();var locs=loc.split("/");var url = locs[locs.length-1].toString();var pos = url.indexOf('?');if (pos>-1) {url = url.substring(0, pos);}return url}
function CurrLocationWithQS() {var loc=window.location.toString();var locs=loc.split("/");var url = locs[locs.length-1].toString();return url}

function updateCheckbox(chk, which, keyid) {
	//alert(chk.checked);
	//alert(keyid);
	//alert(which);
	//alert(chk.checked);
	
	var rt = '';
	
	rt += keyid + '';
	rt += which + '';						
	if (chk.checked) 
		{rt += '1';} 
	else 
		{rt += '0';}
	//alert(rt);
	
	var url = CurrLocationWithQS();
	if (url.indexOf('?') == - 1) {url +='?';} else {url +='&';}
	url += 'qs='+encodeURIComponent(rt); 
	//alert(url);
	var a = new ajax();
	a.call(url);	
}


