// JavaScript Document

//<A HREF="http://www.mapquest.com/directions/main.adp?2a=1730+Blake+St&2c=Denver&2s=CO&2z=80202&2y=US&cid=lfddlink">Directions To This Location</A>

function getDirections()
{
	var lnk="http://www.mapquest.com/directions/main.adp?go=1&do=nw&rmm=1&un=m&cl=EN&ct=NA&rsres=1&1ahXX=&1y=US&";
	
	lnk = lnk + "1a="+ document.getElementById("txtStreet").value + "&1c="+ document.getElementById("txtCity").value
	lnk = lnk + "&1s="+ document.getElementById("txtState").value + "&1z="+ document.getElementById("txtZip").value
	
	
/*	txtStreet = 1a
	txtCity = 1c 
	txtState = 1s
	txtZip = 1z
	*/
	if (document.getElementById("1").checked == true)
	{
		
		lnk = lnk + "&2y=US&2a=115+maple+avenue&2c=red+bank&2s=NJ&2z=07701&CID=lfddlink" 		
		//http://www.mapquest.com/maps/map.adp?address=115+maple+avenue&city=red+bank&state=NJ&zipcode=07701&2y=US&cid=lfmaplink
		//2y=US&2a=115+maple+avenue&2c=red+bank&2s=NJ&2z=07701&CID=lfddlink 
	}
	else if(document.getElementById("2").checked == true)
	{
		lnk = lnk + "&2y=US&2a=80+W+main+street&2c=freehold&2s=NJ&2z=07728&CID=lfddlink" 
		//http://www.mapquest.com/maps/map.adp?address=80+W+main+street&city=freehold&state=NJ&zipcode=07728&2y=US&cid=lfmaplink
	}
	else if(document.getElementById("3").checked == true)
	{									      
		lnk = lnk + "&2y=US&2a=34+chambers+street&2c=princeton&2s=NJ&2z=08542&CID=lfddlink" 
		//http://www.mapquest.com/maps/map.adp?address=34+chambers+street&city=princeton&state=NJ&zipcode=08542&2y=US&cid=lfmaplink
	}
	else if(document.getElementById("4").checked == true)
	{
		lnk = lnk + "&2y=US&2a=349+Penn-titus+road&2c=pennington&2s=NJ&2z=08534&CID=lfddlink"
		//http://www.mapquest.com/maps/map.adp?address=349+Penn-titus+road&city=pennington&state=NJ&zipcode=08534&2y=US&cid=lfmaplink
	}
	window.open(lnk)
	//location.href = lnk
		
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function PageQuery(q) 
{
if(q.length > 1) this.q = q.substring(1, q.length);
else this.q = null;
this.keyValuePairs = new Array();
if(q) {
for(var i=0; i < this.q.split("&").length; i++) {
this.keyValuePairs[i] = this.q.split("&")[i];
}
}
this.getKeyValuePairs = function() { return this.keyValuePairs; }
this.getValue = function(s) {
for(var j=0; j < this.keyValuePairs.length; j++) {
if(this.keyValuePairs[j].split("=")[0] == s)
return this.keyValuePairs[j].split("=")[1];
}
return false;
}
this.getParameters = function() {
var a = new Array(this.getLength());
for(var j=0; j < this.keyValuePairs.length; j++) {
a[j] = this.keyValuePairs[j].split("=")[0];
}
return a;
}
this.getLength = function() { return this.keyValuePairs.length; } 
}
function queryString(key){
var page = new PageQuery(window.location.search); 
return unescape(page.getValue(key)); 
}
function displayItem(key)
{
if(queryString(key)=='false') 
{

}else{

//alert(queryString('id'));

id= queryString('id')

if ( id == 1)
{
	document.getElementById("1").checked = true;
}else if( id == 2)
{
	document.getElementById("2").checked = true;
}else if( id == 3)
{
	document.getElementById("3").checked = true;
}else if( id == 4)
{
	document.getElementById("4").checked = true;
}


///
}
}


