function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f
	
	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );
		
		
		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');
	
		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}

var hasDemo = Get_Cookie(hasDemo) == 1 ? 1 : 0;
function redirectTo(url) {
window.location = url;
return false;
}
function redirectToNextWithEmailBlurb() {
	redirectTo("/NextPage.aspx?emailSent=1");
}
function zxcWWHS(){
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
var x,y;
if (self.pageYOffset) // all except Explorer
{
	x = self.pageXOffset;
	y = self.pageYOffset;
}
else if (document.documentElement && document.documentElement.scrollTop)
	// Explorer 6 Strict
{
	x = document.documentElement.scrollLeft;
	y = document.documentElement.scrollTop;
}
else if (document.body) // all other Explorers
{
	x = document.body.scrollLeft;
	y = document.body.scrollTop;
}
  return [myWidth,myHeight,y,x];
}
function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}
function showPrivacy(obj) {
var screenvar = zxcWWHS();
LeftPosition = (screenvar[0]) ? (screenvar[0]-520)/2 : 0;
TopPosition = (screenvar[1]) ? ((screenvar[1]-250)/2)+screenvar[2] : 0;
//var pos = findPos(obj);
document.getElementById("privacyBox").scrollTop = 0;
document.getElementById("privacyBox").style.left = LeftPosition+'px';
document.getElementById("privacyBox").style.top = TopPosition+'px';
document.getElementById("privacyBox").style.visibility = "visible";
document.getElementById("privacyBox").style.display = "inline";
return false;
}
function closePrivacy() {
document.getElementById("privacyBox").style.visibility = "hidden";
document.getElementById("privacyBox").style.display = "none";
}
function openNextOptin (obj) {
if (hasDemo!=1) {
var pos = findPos(obj);
document.getElementById("nextPopup").style.left = pos[0]-20+'px';
document.getElementById("nextPopup").style.top = pos[1]-350+'px';
document.getElementById("nextPopup").style.display = "block";
document.getElementById("nextPopup").style.visibility = "visible";
return false;
}
return redirectTo('/NextPage.aspx');
}
function closeNextOptin() {
document.getElementById("nextPopup").style.visibility = "hidden";
document.getElementById("nextPopup").style.display = "none";
redirectTo('/NextPage.aspx');
}
function updateHead(name) {
headObj.addVariable('punch',name+', check your inbox for your free demo!');
headObj.write('flashHeader');
return false;
}
function demoBlurb() {
var text = "<span class=\"hlyell\"><span class=\"style21\">THANKS!</span> Check your inbox in <strong>5 mins</strong></span><br />Your demo will be dispatched via email  within the next 5 minutes... <strong>make sure  you click the confirm link inside!</strong></span>";
document.getElementById("demoBlurb").innerHTML = text;
document.optForm1.FirstName.className = "txtdisabled";
document.optForm1.FirstName.disabled = true;
document.optForm1.Email.className = "txtdisabled";
document.optForm1.Email.disabled = true;
return false;
}
function toggleOnOff(obj,tog) {
if (tog == "on") {
document.getElementById(obj).style.display = "inline";
document.getElementById(obj).style.visibility = "visible";
} else {
document.getElementById(obj).style.display = "none";
document.getElementById(obj).style.visibility = "hidden";
}
return false;
}