// JavaScript Document

	function ShippingPolicies(){
		newWindow = window.open("http://www.PrintsMadeEasy.com/shipping_policies.php", "shipping", "height=500,width=484,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no");
		newWindow.focus();
	}

	function ShowIndicia(){
		window.open("http://pe.usps.com/text/qsg300/Q604d.htm", "indicia", "height=473,width=780,directories=no,location=yes,menubar=no,scrollbars=yes,status=yes,toolbar=no,resizable=yes");

	}

	function GetBBBlink(){
		newWindow3 = window.open("http://www.labbb.org/BBBWeb/Forms/Business/CompanyReportPage_Expository.aspx?CompanyID=100033228", "BBB", "height=700,width=820,directories=yes,location=yes,menubar=yes,scrollbars=yes,status=yes,toolbar=yes,resizable=yes");
		newWindow3.focus();
	}


	function checkSearchForm(){
		var keywordsStr = document.getElementById("keywordsBox").value;

		if(keywordsStr.match(/^\s*$/)){
			alert("Please enter a search term.");
			return false;
		}
		else{
			return true;
		}
	}

	function escapeOutput(input) {
		var output = "";
		var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
		var i = 0;
		var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
 
		input = utf8_encode(input);
 
		while (i < input.length) {
 
			chr1 = input.charCodeAt(i++);
			chr2 = input.charCodeAt(i++);
			chr3 = input.charCodeAt(i++);
 
			enc1 = chr1 >> 2;
			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
			enc4 = chr3 & 63;
 
			if (isNaN(chr2)) {
				enc3 = enc4 = 64;
			} else if (isNaN(chr3)) {
				enc4 = 64;
			}
 
			output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);
 
		}
 
		return output;
	}

	function utf8_encode(string) {
		string = string.replace(/\r\n/g,"\n");
		var utftext = "";
 
		for (var n = 0; n < string.length; n++) {
 
			var c = string.charCodeAt(n);
 
			if (c < 128) {
				utftext += String.fromCharCode(c);
			}
			else if((c > 127) && (c < 2048)) {
				utftext += String.fromCharCode((c >> 6) | 192);
				utftext += String.fromCharCode((c & 63) | 128);
			}
			else {
				utftext += String.fromCharCode((c >> 12) | 224);
				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
				utftext += String.fromCharCode((c & 63) | 128);
			}
 
		}
 
		return utftext;
	}

	function showOffsetVersusDigitalPrintingPresses(){
		newWindow3 = window.open("http://www.PrintsMadeEasy.com/offsetPrintingPress.html", "offsetPress", "height=600,width=700,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no");
		newWindow3.focus();
	}

	function Business_Card_Stock_Details(){
		newWindow3 = window.open("http://www.PrintsMadeEasy.com/card_stock.html", "CardStockDetails", "height=380,width=484,directories=no,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=no");
		newWindow3.focus();
	}

/*
	if(top.location != location) {
		top.location.href = document.location.href;
	}
*/