// PHORM
var from_where = document.referrer;
function refcheck() {
	var samedomain = from_where.search(/pheist.+/);
	if (samedomain != -1) {
	} else {
		//alert('DIRECT ACCESS TO THIS PAGE IS NOT ALLOWED.');
		location.replace('http://pheist.net');
	}
}


// POPUP
var url;
var ext_x;
var ext_y;

function pow(url,ext_x,ext_y) {
	if(ext_x == undefined) { ext_x = 800; }
	if(ext_y == undefined) { ext_y = 800; }
	// TOO BIG?
	if (ext_y >= screen.availHeight) { ext_y = (screen.availHeight/5)*3; }
	if (ext_x >= screen.availWidth) { ext_x = (screen.availWidth/5)*4; }
	leftpos = ((screen.availWidth - ext_x)/2);
	toppos = ((screen.availHeight - ext_y - 20)/2);
	powwin=window.open(url,"pop","toolbar=no,location=no,explorer=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,left="+leftpos+",top="+toppos+",width="+ext_x+",height="+ext_y);
}

function powow(url,ext_x,ext_y) {
	if(ext_x == '') { ext_x = 800; }
	if(ext_y == '') { ext_y = 800; }
	// TOO BIG?
	if (ext_y >= screen.availHeight) { ext_y = (screen.availHeight/5)*3; }
	if (ext_x >= screen.availWidth) { ext_x = (screen.availWidth/5)*4; }
	leftpos = ((screen.availWidth - ext_x)/2);
	toppos = ((screen.availHeight - ext_y - 20)/2);
	powwin=window.open(url,"pop","toolbar=no,location=no,explorer=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left="+leftpos+",top="+toppos+",width="+ext_x+",height="+ext_y);
}