function openPF(url) {
	var w = 540;
	var h = 500;
	var openPF = window.open(url,'PrinterFriendly','scrollbars=yes,menubar=no,height='+h+',width='+w+',resizable=yes,toolbar=no,location=no,status=no');
}

function openShare(url) {
	var w = 400;
	var h = 330;
	var openShare = window.open(url,'ShareWithFriend','scrollbars=yes,menubar=no,height='+h+',width='+w+',resizable=yes,toolbar=no,location=no,status=no');
}

function setCookie(name, value, expires, path, domain, secure) 
{
	var curCookie = name + "=" + escape(value) +
		((expires) ? "; expires=" + expires.toGMTString() : "") +
		((path) ? "; path=" + path : "") +
		((domain) ? "; domain=" + domain : "") +
		((secure) ? "; secure" : "");
	document.cookie = curCookie;
}

function SetResolutionCookie() 
{
	var now = new Date();
	
	//expires in 24h
	now.setTime(now.getTime() + 1 * 24 * 60 * 60 * 1000);
	
	var resolution = window.screen.width + "x" + window.screen.height;
	//set the new cookie
	setCookie("ScreenResolution", resolution, now, "/");
}

//Checks all checkboxes of a given ASP checkboxlist
function CheckAllInCheckBoxList(cblID, checkVal) {	
	
	//this works for cbl without a parent container
	re = new RegExp(cblID + ':[0-9]*$');	
	
	for(i = 0; i < document.forms[0].elements.length; i++) {		
		var elm = document.forms[0].elements[i];		
		if (elm.type == 'checkbox') {			
			if (re.test(elm.name)) {
				elm.checked = checkVal;			
			}		
		}	
	}
} 