function getSiteInfo()
{
	var url = '' + this.location;
	var query = '' + url.substring((url.indexOf('?')) + 1);
	var host = '' + url.substring(0, url.indexOf('?') );
	var str = "";
	
	str = str + "HTTP_HOST: " + host + "newLine";
	str = str + "QUERY_STRING: " + query + "newLine";
	
	return str;
}

//
//  These are the new mapquest subroutines
//
//  openMap  - produces the map
//  openDir  - gives driving directions (pass in TO address)
//  openDir2 - gives driving directions (pass in FROM and TO address)
//

function openMap2(url, name, phone, staddress, city, state, zip, Headerfile, CSSfile, pagetitle)
{
	var str = url
	
	if (name != '' && name != null)
	{
		str = str + 'user1=' + escape(name)
	}

	if (phone != '' && name != null)
	{
		str = str + '&user2=' + escape(phone)
	}

	str = str + '&transaction=locMap&address=' + escape(staddress) + '&city=' + escape(city) 
	+ '&stateProvince=' + escape(state) + '&postalCode=' + escape(zip) + '&Headerfile=' + escape(Headerfile) 
	+ '&StyleSheetfile=' + escape(CSSfile) + '&documentTitle=' + escape(pagetitle);

	if (arguments.length > 10 )
	{
		str = str + '&address2=' + escape(arguments[10]);
	}			    

	// If we have a 12th argument then it will be site information
	if (arguments.length == 12 )
	{
		str = str + '&siteinfo=' + escape(arguments[11]);
	}
	try {
		console.log(str);
		console.log(arguments[11]);
		console.dirxml(arguments[11]);
	} catch(e) {
		// Nope
	}
	window.open(str,'','toolbar=no, location=no, directories=no, status=no, copyhistory=no, menubar=no, scrollbars=yes,resizable=yes,left=0,top=0,screenX=0,screenY=0,width=650,height=600');

}

function openMap3(url, name, phone, staddress, city, state, zip, Headerfile, CSSfile, pagetitle)
{
           var str = url
           
           if (name != '' && name != null)
           	{
           		str = str + 'user1=' + escape(name)
           	}
           
           if (phone != '' && name != null)
           	{
           		str = str + '&user2=' + escape(phone)
           	}

 		   str = str + '&transaction=locMap&address=' + escape(staddress) + '&city=' + escape(city) 
           + '&stateProvince=' + escape(state) + '&postalCode=' + escape(zip) + '&Headerfile=' + escape(Headerfile) 
           + '&StyleSheetfile=' + escape(CSSfile) + '&documentTitle=' + escape(pagetitle);

           if (arguments.length > 10 )
           {
            str = str + '&address2=' + escape(arguments[10]);
           }			    

           window.open(str,'','menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600');

}

function openDir2(url, name, phone, destaddress, destcity, deststate, destzip, Headerfile, CSSfile, pagetitle)
{
           var str = url
           
           if (name != '' && name != null)
           	{
           		str = str + 'destUser1=' + escape(name)
           	}
           
           if (phone != '' && name != null)
           	{
           		str = str + '&destUser2=' + escape(phone)
           	}

 		   str = str + '&transaction=route&destaddress='+ escape(destaddress) + '&destcity=' + escape(destcity) 
           + '&deststateProvince=' + escape(deststate) + '&destpostalCode=' + escape(destzip) + '&Headerfile=' + escape(Headerfile) 
           + '&StyleSheetfile=' + escape(CSSfile) + '&documentTitle=' + escape(pagetitle);

           window.open(str,'','menubar=yes,scrollbars=yes,width=1200,height=600');
}
/*
    Last time I tried this is was only sort of working
    
	function openDirx(url, destaddress, destcity, deststate, destzip, origaddress, origcity, origstateProvince, origzip, Headerfile, CSSfile, pagetitle)
{
           var str = url + 'transaction=route&destaddress=' + escape(destaddress) + '&destcity=' + escape(destcity) 
           + '&deststateProvince=' + escape(deststate) + '&destpostalCode=' + escape(destzip) + '&origaddress=' + escape(origaddress) 
           + '&origcity=' + escape(origcity) + '&origstateProvince=' + escape(origstateProvince) + '&origpostalCode=' + escape(origzip) 
           + '&Headerfile=' + escape(Headerfile) + '&StyleSheetfile=' + escape(CSSfile) + '&documentTitle=' + escape(pagetitle);

           window.open(str,'','menubar=yes,scrollbars=yes,width=800,height=700');
}
*/