// Detect document search string
//
// This code allows me to provide links to specific
// startup stages i.e. cgi, logotype, print, contact.
// 
// For example, perrymccutcheon.com?contact will force
// the page to display the contact form to the user
//

function writeinfo() {
	if (live !== 1) {
		document.write(url + "\r");
		document.write(pgset);
	}
}

// set variable from to a default value
var pgset = "IGNORE";

// get url of referring document
var url = window.location;

// if match in url to "retry" set var from to RETRY
if (/retry/i.exec(url)) {
	pgset = "RETRY";
	}

// if match in url to "ok" set var from to OK
if (/ok/i.exec(url)) {
	pgset = "OK";
	}

// if match in url to "contact" set var from to CONTACT
if (/contact/i.exec(url)) {
	pgset = "CONTACT";
	}

// if match in url to "cgi" or "3d" set var from to CGI
if (/cgi/i.exec(url) || /3d/i.exec(url)) {
	pgset = "CGI";
	}

// if match in url to "logo" set var from to LOGOTYPE
if (/logo/i.exec(url)) {
	pgset = "LOGOTYPE";
	}

// if match in url to "print" set var from PRINT
if (/print/i.exec(url)) {
	pgset = "PRINT";
	}

writeinfo();
