// JavaScript Document
function popup(mylink, windowname, w, h) {
if (! window.focus)return true;
window.open(mylink, windowname, 'width=' + w + ',height=' + h + ',scrollbars=yes');
return false;
}

function FindOurCookie(cookieName) {
 var theCookie=""+document.cookie; //make a text string out of cookie
 var ind=theCookie.indexOf(cookieName); //tell us where in string this cookie starts
 if (ind==-1 || cookieName=="") return ""; 
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}


function VisitorCookie() {
var the_cookie = "" + document.cookie;

whatsit = FindOurCookie("Visitor");
the_cookie = "" + whatsit;

var broken_cookie = whatsit.split("/"); //breaks into pairs of name:value
		
var Sections = broken_cookie[0];
var ChocChip = Sections.split(":"); //Shows just VALUE for each set

return ChocChip[1];
}


function GatePass () {
Oreo = VisitorCookie ();
if (! Oreo) { //they've never signed in before so force them to sign-in page
	var GoTo = "http://www.printcographics.com/Visitors.php";
	window.location.replace(GoTo);
	}
}