function Get_Schedule_URL(main)
	{
		url = window.location.href;
		urlparts = url.split('/');
		num = urlparts.length;
		minusNum = 0;
		end = 0;
		if(urlparts[4]=="Canada")
			{
				if(num==7){minusNum = 1; end = 1;}
				if(num==8){minusNum = 2;}
				if(num==8){minusNum = 3;}
			}
		else
			{
				if(num==6){minusNum = 1; end = 1;}
				if(num==7){minusNum = 2;}
				if(num==8){minusNum = 3;}
			}
		first = urlparts[num-minusNum];
		if(end==1)
			{
				urlparts_2 = first.split('.');
				last = urlparts_2[0];
			}
		else
			{
				last = first;
			}
		window.location=main+last+'&cn='+($('#hidden_center_number').val()||'');
	}
function Get_Campaign_URL()
	{
		url = window.location.href;
		urlparts = url.split('/');
		num = urlparts.length;
		minusNum = 0;
		end = 0;
		if(urlparts[4]=="Canada")
			{
				if(num==7){minusNum = 1; end = 1;}
				if(num==8){minusNum = 2;}
				if(num==8){minusNum = 3;}
			}
		else
			{
				if(num==6){minusNum = 1; end = 1;}
				if(num==7){minusNum = 2;}
				if(num==8){minusNum = 3;}
			}
		first = urlparts[num-minusNum];
		if(end==1)
			{
				urlparts_2 = first.split('.');
				last = urlparts_2[0];
			}
		else
			{
				last = first;
			}
		$('#plcRoot_Layout_zoneCeLPForm_LP_ContactForm_BizFormNew_ctl00_location').val(last);
	}
key = 'ABQIAAAAqA-d3rAhxkeSwfn64c7nBxQdCIMk5z95NBMpmfakSIL_Utc4dxTlMILR_81l1xVp8e3quk9mD-xWcg';
var geo = new GClientGeocoder();
var lat = [];
var lng = [];
var bounds = new GLatLngBounds();
var status = [];
status[G_GEO_SUCCESS] = "Success";
status[G_GEO_MISSING_ADDRESS] = "Missing Address";
status[G_GEO_UNKNOWN_ADDRESS] = "Unknown Address";
status[G_GEO_UNAVAILABLE_ADDRESS] = "Unavailable Address";
status[G_GEO_BAD_KEY] = "Bad Key";
status[G_GEO_TOO_MANY_QUERIES] = "Too Many Queries";
status[G_GEO_SERVER_ERROR] = "Server Error";
function GetImg(thisW, thisH, thisLat, thisLng, addr, divID, oldAddr) {
	document.getElementById(divID).innerHTML = '<a href="http://maps.google.com/maps?f=d&q=' + escape(oldAddr) + '&sa=X&oi=map&ct=title" target="_blank" title="' + addr + '"><img src="http://maps.google.com/staticmap?center=' + thisLat + ',' + thisLng + '&markers=' + thisLat + ',' + thisLng + ',red&zoom=10&size=' + thisW + 'x' + thisH + '&key=' + key + '" alt="' + addr + '" border=0 /></a>';
}
function showAddress(thisW, thisH, divID, thisAddr) {
	lat.length = 0;
	oldAddr = thisAddr;
	geo.getLocations(thisAddr, function (result) {
		if (result.Status.code == G_GEO_SUCCESS) {
			thisLat = result.Placemark[0].Point.coordinates[1];
			thisLng = result.Placemark[0].Point.coordinates[0];
			var addr = result.Placemark[0].address;
			GetImg(thisW, thisH, thisLat, thisLng, addr, divID, oldAddr);
			return;
		}
	});
	addrArray = thisAddr.split(/, /);
	end = thisAddr.replace(/(.*), /gi,'');
	thisAddr = addrArray[1]+', '+addrArray[2]+', '+end;
	geo.getLocations(thisAddr, function (result) {
		if (result.Status.code == G_GEO_SUCCESS) {
			thisLat = result.Placemark[0].Point.coordinates[1];
			thisLng = result.Placemark[0].Point.coordinates[0];
			var addr = result.Placemark[0].address;
			GetImg(thisW, thisH, thisLat, thisLng, addr, divID, oldAddr);
		}
	});
}
function showAddr(thisW,thisH,divID,thisAddress)
	{
		showAddress(thisW,thisH,divID,thisAddress);
	}
function getMapFromAddr(theAddrID,theW,theH,theMapID)
	{
		DefaultAddrID = 'thisAddr';
		DefaultMapWidth = 200;
		DefaultMapHeight = 200;
		DefaultMapID = 'Map';
		AddrID = theAddrID;
		MapWidth = theW;
		MapHeight = theH;
		MapID = DefaultMapID;
		if(theAddrID==null||theAddrID=="undefined")
			{
				AddrID = DefaultAddrID;
			}
		if(theW==null||theW=="undefined")
			{
				MapWidth = DefaultMapWidth;
			}
		if(theH==null||theH=="undefined")
			{
				MapHeight = DefaultMapHeight;
			}
		if(theMapID==null||theMapID=="undefined")
			{
				MapID = DefaultMapID;
			}
		thisRet = document.getElementById(AddrID).innerHTML;
		thisRet = thisRet.replace(new RegExp("\\n","gim" ),'');
		thisRet = thisRet.replace(/<br \/>/gim,', ');
		thisRet = thisRet.replace(/<br\/>/gim,', ');
		thisRet = thisRet.replace(/<br\>/gim,', ');
		thisRet = thisRet.replace(/ - /gim,', ');
		thisRet = thisRet.replace(/  /gim,' ');
		thisRet = thisRet.replace(/&amp;/gim,'and');
		showAddr(MapWidth,MapHeight,MapID,thisRet);
	}
