function redirect(where) {
	switch(where) {
		case 1: //
			window.location = '/5d_zip_county.htm';
			break;
		case 2: //
			window.location = '/reference_maps.htm';
			break;
		case 3: //
			window.location = '/streetmap.htm';
			break;
		case 4: //
			window.location = '/3d_zip_county.htm';
			break;
		case 5://
			window.location = '/carrier_route_maps.htm';
			break;
		case 6: //
			window.location = '/census_tract_maps.htm';
			break;
		case 7: //
			window.location = '/statemap.htm';
			break;
		case 8: //
			window.location = '/countymap.htm';
			break;
		case 9: //
			window.location = '/metromap.htm';
			break;
		case 10: //
			window.location = '/citymap.htm';
			break;
		case 11: //
			window.location = '/regionalmap.htm';
			break;
		case 12: //
			window.location = '/usmap.htm';
			break;
		case 13: //
			window.location = '/sectional map.htm';
			break;
		case 14: //
			window.location = '/stateby5dzipcounty.htm';
			break;
		case 15: //
			window.location = '/countyby5dzip.htm';
			break;
		case 16: //
			window.location = '/metroby5dzipcounty.htm';
			break;
		case 17: //
			window.location = '/cityby5dzipcounty.htm';
			break;
		case 18: //
			window.location = '/usbycounty.htm';
			break;
		case 19: //
			window.location = '/county.htm';
			break;
		case 20: //
			window.location = '/statebycounty.htm';
			break;
		case 21: //
			window.location = '/city.htm';
			break;
		case 22: //
			window.location = '/metrobycounty.htm';
			break;
		case 23: //
			window.location	= '/usby3dzipcounty.htm';
			break;
		case 24: //
			window.location = '/stateby3dzipcounty.htm';
			break;
		case 25: // 
			window.location = '/carrier_route_by_zipcode.htm';
			break;
		case 26 : //
			window.location = '/carrier_route_by_county.htm';
			break;
		case 27 : //
			window.location = '/metrobycensustracts.htm';
			break;
		case 28 : //
			window.location = '/countybycensustracts.htm';
			break;
		case 29 : //
			window.location = '/citybycensustracts.htm';
			break;
		case 30: //
			window.location = '/streetbycounty.htm';
			break;
		case 31: // 
			window.location = '/streetbymetro.htm';
			break; 
		case 32: //
			window.location = '/custommap.htm';
			break;
		case 33: //
			window.location = '/products/5digitzip.htm';
			break;
		case 34: //
			window.location = '/products/3digitzip.htm';
			break;
		case 35: //
			window.location = '/products/refmaps.htm';
			break;
		case 36: //
			window.location = '/products/streetmaps.htm';
			break;
		case 37: //
			window.location = '/products/carrierroute.htm';
			break;
		case 38: //
			window.location = '/products/censustract.htm';
			break;
		case 39: //
			window.location = '/products/usmaps.htm';
			break;
		case 40: //
			window.location = '/products/regional.htm';
			break;
		case 41: //
			window.location = '/products/statemaps.htm';
			break;
		case 42: //
			window.location = '/products/sectional.htm';
			break;
		case 43: //
			window.location = '/products/metromap.htm';
			break;
		case 44: //
			window.location = '/products/countymaps.htm';
			break;
		case 45: //
			window.location = '/products/citymaps.htm';
			break;
		case 46: //
			window.location = '/products/censustract.htm';
			break;
		case 47: //
			window.location = '/products/statearea.htm';
			break;
		case 48: //
			window.location = '/products/countyarea.htm';
			break;
		case 49: //
			window.location = '/products/customarea.htm';
			break;
		case 50: //
			window.location = '/products/customradius.htm';
			break;
		case 51: //
			window.location = '/products/customdrivetime.htm';
			break;
		case 52: //
			window.location = '/products/demographics.htm';
			break;
		case 53: //
			window.location = '/products/custommaps.htm';
			break;
		case 54: //
			window.location = '/products/zipcodemaps.htm';
			break;
		case 55: //
			window.location = '/zipcodemap.htm';
			break;
		case 56:
			window.location = '/demographics.htm';
			break;
		default:
			window.location = where;
			break;
	};
}

function Start(page)
{
	OpenWin = this.open("/sample.asp?image=" + page, "pdf_preview", "width=640,height=650,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}

function StartParam(page, width, height)
{
	OpenWin = this.open("/sample.asp?image=" + page, "pdf_preview", "width=" + width + ",height=" + height + ",toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}


function Zoom1(page)
{
	OpenWin = this.open(page, "pdf_zoom", "width=630,height=480,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
}

	function setCookie(name, value, expires, path, domain, secure)
	{
	    document.cookie= name + "=" + value +
	        ((expires) ? "; expires=" + expires.toGMTString() : "") +
 	       ((path) ? "; path=" + path : "") +
	        ((domain) ? "; domain=" + domain : "") +
	        ((secure) ? "; secure" : "");
	}

	function getCookie(name)
	{
 	   var dc = document.cookie;
	   var prefix = name + "=";
	   var begin = dc.indexOf("; " + prefix);
	   if (begin == -1)
	   {
	       begin = dc.indexOf(prefix);
 	       if (begin != 0) return null;
 	   }
	    else
 	   {
	        begin += 2;
 	   }
	   var end = document.cookie.indexOf(";", begin);
	    if (end == -1)
 	   {
	        end = dc.length;
	   }
	    return unescape(dc.substring(begin + prefix.length, end));
	}

	function deleteCookie(name, path, domain)
	{
 	   if (getCookie(name))
 	   {
	        document.cookie = name + "=" + 
 	           ((path) ? "; path=" + path : "") +
 	           ((domain) ? "; domain=" + domain : "") +
	            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
 	   }
	}


	function decimal(dec)
	{
		this.dec=dec;
		this.toBinary=function() { return this.dec.toString(2); }
		this.toHex=function() { return this.dec.toString(16).toUpperCase(); }
		this.toOctal=function() { return this.dec.toString(8); }
	}

	function writeImage()
	{
		var today = new Date();
		var temp = today.getTime();
		var expiry = new Date("December 31, 2024");
		var hexId = new decimal(temp).toHex();
		var idValue = getCookie("webUserID");
		var websrc = getCookie("PDFsource");
		var webkwd = getCookie("PDFkeyword");
		var website = "PDF";
		var url = document.URL;
//		var url = window.location.href
		var refurl = document.referrer;
		if (refurl == '') {
			refurl = 'undefined';
		}
		var flagVar = "no";
		var rExp = /\&/g;
		var url2 = url.replace(rExp, "|");
		var refurl2 = refurl.replace(rExp, "|");
		hexId = hexId.toString();

		if (idValue) {
			flagVar = "yes"
		} else {
			setCookie("webUserID", hexId, expiry, "/");
			idValue = getCookie("webUserID");
			if (idValue) {	flagVar = "yes"  }
		}

		document.write("<br><img src=http://www.pdfmaps.com/newimage.aspx?website=" + website + "&idValue=" + idValue + "&url=" + url2 + "&refurl=" + refurl2 + "&flagVar=" + flagVar + "&websrc=" + websrc + "&webkwd=" + webkwd + "><br>")
	}
	writeImage();
