
function getProtocol() {
	var protocol = location.href.substring(0, location.href.indexOf("://")); if (protocol != "https") {protocol = "http://"} else {protocol = "https://"}; return protocol;
}

function getQueryStringParam(variable) {
	var query = window.location.search.substring(1);
	var vars = query.split('&');
	for (var i = 0; i < vars.length; i++) {
		var pair = vars[i].split('=');
		if (pair[0] == variable) {return pair[1];}
	}
	return "";
}

function loadpopunder(winname,width,height,url) {
	var left = (screen.width/2)-(width/2);
	var top = (screen.height/2)-(height/2);
	var winfeatures = 'width=' + width + ',height=' + height + ',scrollbars=0,location=0,resizable=0,top='+top+', left='+left + ',scrollbars=yes';
	var win = window.open(url,winname,winfeatures)
	win.blur()
	win.moveTo(screen.availWidth/2-(width/2),screen.availHeight/2-(height/2));
	window.focus()
}
