
var globalinputfield = 'blank';
var ajaxpurpose = 'locsearch';
var mainpagetype;
var activepagetype;

var currentuser=null;
var userspage=null;
var userok=false;
var usertours=[];
var userarray=[];
var activemainsearchtype='location';
var activeexploresearchtype;

var activetourid;
var activetourname;

var activedestnum = '';
var activedest = [];

var dmoflag = false;
var comguidesearchterm;

var sponsoractive = true;
var sponsorsearchterm;
var sponsormarker;

var orig_searchstring='';
var currentbizsearchterm='';
var globallocation='Hermosa Beach, Ca';
var cgmarquee;
var sampletour1 = 'cpsamples24ABBEC0E685C84F84C8136CE7ABF6FCT';
var sampletour2 = 'mmedaliaE127BFA1F30E394AACA6560426D3D90ET';
var sample1flag = false;

var shareddestid = '';
var sharedtourid = '';
var sharedguest = '';
var buildtourid;
var invitetourhtml;
var parenttype='display';

var tb_active = false;
var tb_tourname;
var tb_tourid;

var hideTimerID = 0;

var contentforms_width='600px';
var contentforms_height='425px';

//MAP GLOBALS
// GLOBAL SWITCHES FOR MAP FUNCTIONALTIY: 0 = Off; 1 = On;
var includemapcontrols = 1;
var includecreatecontrols = 1;
var includecustommarkers = 1;
var includedirections = 1;
var includepano = 1;

// GLOBAL TOGGLES FOR TRAFFIC AND STREETVIEW: 0 = OFF AT PAGELOAD; 1 = ON AT PAGELOAD.
var traffictoggleState = 0;
var panotoggleState = 0;

var calendarscripts = false;
var eventscripts = false;
var videoscripts = false;
var dmoscripts = false;

var mapdiv;
var	mapcontrolsdiv;
var	mapcreatetoolsdiv;
var	mapdirectionsdiv;
var	mappanodiv;
var	mappanodetailsdiv;
var	highslidepanodiv;

var mapstate = 'expanded';

//**************************************************PAGE FUNCTIONS*************************************************


//MAIN CONTENT FUNCTIONS AND COMMUNITY GUIDE SETUP
	function setmaincontent(){
		
		mainpagetype = document.getElementById("HiddenFieldPageType").value;
		//alert(mainpagetype);
		
		switch (mainpagetype){
			case 'cthere':
				activepagetype = 'cthere';
				makeHttpRequest('Wizards/cthere.xml', setmaininfo, true, 'ctherehome');
				makeHttpRequest('Wizards/cthere.xml', setmidnav, true, 'ctherehomemidnav');
				addjspage('moreinfo');
				addjspage('createSF');
				midnavsearchdisplay('off');
				document.getElementById('cplanetlogo').src = 'globalgraphics/general/cthere_logo_markerbulls.png';
				//getdestinations(sampletour1, 'DateCreated', 'ctheresample1');
			break;
			
			case 'cplanet':
				activepagetype = 'cplanet';
				document.getElementById('cplanetlogo').src = 'globalgraphics/general/cplanet_mainlogo.gif';
				makeHttpRequest('Wizards/cplanet_home.html', setmaininfo);
			break;
			
			case 'org':
				activepagetype = 'cplanet';
				checkdmo();
//				if(dmoscripts == false){
//					addjspage('dmofunctions');
//					dmoscripts = true;
//					setTimeout("checkdmo()", 600);
//				}else{
//					checkdmo();
//				}
			break;
			
			default:
				makeHttpRequest('Wizards/cplanet_home.html', setmaininfo);
			break;
		}
	
	}
	
	function displaysamplelist(samplehtml){
		try{
			if(sample1flag == false){
				document.getElementById("ctheresample1").innerHTML = samplehtml;
				getdestinations(sampletour2, 'DateCreated', 'ctheresample1');
				sample1flag = true;
			}else{
				document.getElementById("ctheresample2").innerHTML = samplehtml;
				sample1flag = false;
			}
		}catch(err){
			//NO ACTION	
		}
	}

	function setmaininfo(maininfohtml){
	
		document.getElementById("infoholder").innerHTML = maininfohtml;
		
	}
	
	function setmidnav(navhtml){
		
		document.getElementById("navdemo").innerHTML = navhtml;
			
	}
	
	function resetmaininfo(){
		
		clearmap();
		resetmap();
		activepagetype = 'cplanet';
		collapsemappane();
		midnavsearchdisplay('off');
		highslidecontrol('exploreoff');
		highslidecontrol('resultshtmloff');
		makeHttpRequest('Wizards/cplanet_home.html', setmaininfo);
		setmainusertitle('');
		cyosf_active = false;
		ajaxpurpose = 'locsearch';
		setmidnav('');
		globalinputfield = 'blank';
		
		setTimeout("senduserdata()",200);
		
	}
	
	function setcthere(text) { 
		activepagetype = 'cthere';
		collapsemappane();
		midnavsearchdisplay('on');
		document.getElementById('infoholder').innerHTML = text;
		//addjspage('moreinfo');
		//addjspage('createSF');
		//ajaxpurpose = 'createdest';
		
		if(dmoflag == false){
			makeHttpRequest('Wizards/cthere_midnav.html', setmidnav);
			if(currentuser){
				setTimeout("setusercthere()", 500);
			}
		}else{
			makeHttpRequest('Wizards/cplanet_dmomidnav.html', setmidnav);
		}
		
		getdestinations(sampletour1, '', 'ctheresample1');
	} 
	
	function setcommunityguide(loc, uslocation){
		
		makeHttpRequest('Wizards/cplanet_midnav.html', setmidnav);
		midnavsearchdisplay('on');
		
		if(uslocation){
			//collapsemappane();
			makeHttpRequest('Wizards/communityguide.html', setmaininfo);
		}else{
			makeHttpRequest('Wizards/communityguide_nonus.html', setmaininfo);
		}
		
		setTimeout("setguideloc('reset')", 600);
	}
	
	function resetcommunityguide(uslocation){
		
		if(uslocation){
			collapsemappane();
			makeHttpRequest('Wizards/communityguide.html', setmaininfo);
		}else{
			makeHttpRequest('Wizards/communityguide_nonus.html', setmaininfo);
		}
		
		setTimeout("setguideloc('reset')", 600);
	}
	
	function setguideloc(){
		
		setmainusertitle(globallocation);
		
		try{
			document.getElementById("cgtitle").innerHTML = globallocation + ' Community Guide';
		}catch(err){
			//Nothing
		}
		
		mashupsprepopulate();
		
		cgmarquee = '';
		getdestinations('', '', 'prox_storefronts');
		
	}
	
	
	function explorecommunity(){
		expandmappane();
		highslidecontrol('explore');	
	}
	
	function displaycgmarquee(mcount){
		
		if(mcount!='none'){
			var marqueehtml = '<p class="quote" align="left">Featured Cthere Destiantions</p><hr color="#CCCCCC" /><MARQUEE behavior="scroll" scrollamount="4" direction="left" width="100%"'
					+'height="75" onmouseover="this.setAttribute(\'scrollamount\', 0, 0);" onmouseout="this.setAttribute(\'scrollamount\', 6, 4);" loop="infinite" >';
					
			marqueehtml += cgmarquee;
			
			
			marqueehtml += '</MARQUEE>';
			
			document.getElementById("cgmarqueeholder").innerHTML = marqueehtml;
		}else{
			getpicmarquee();	
		}
	}
	
	function displaypicmarquee(marqueepics){
		
		var marqueehtml = '<div style="width:850px; overflow:hidden;"><p class="quote" align="left">Web Images Tagged with <i>'+api_inputstring+'</i></p><hr color="#CCCCCC" /><MARQUEE behavior="scroll" scrollamount="4" direction="left" width="100%"'
				+'height="75" onmouseover="this.setAttribute(\'scrollamount\', 0, 0);" onmouseout="this.setAttribute(\'scrollamount\', 6, 4);" loop="infinite" >';
				
		marqueehtml += marqueepics;
		
		
		marqueehtml += '</MARQUEE></div>';
		
		document.getElementById("cgmarqueeholder").innerHTML = marqueehtml;
		
	}
	
	function cgsearch(term){
		
		setvenuemarker(term);
		comguidesearchterm = term;
		searchyahoo('search', 'initial', 'comguide');
		highslidecontrol('explore');
	
	}



//*****************PASSPORT FUNCTIONS*************************
//ADD DESTINATION FUNCTION
	function ppadddestmenu(){
		var pptitle = '<i>Add to Passport Menu</i>';
		highslideajax('wizards/addtopassport.html', 'passportaddmenu', 'addtopp', pptitle, 260, 425);
	}
	
	function pplocatemenu(appanchor){
		var oktoopen = verifythenopen();
		
		if(oktoopen){
			try{
				closeactiveexpander();
			}catch(err){
				//NO ACTION	
			}
			//expandmappane();
			addjspage('moreinfo');
			addjspage('createSF');
			cyosf_active = false;
			ajaxpurpose = 'createdest';
			var pptitle = '<span class="cpfontheading"><i>Add a Destination to your Cplanet Passport</i></span>';
			highslideajax('wizards/searchhtml.html', 'adddest', appanchor, pptitle, 550, 350, true);
		}
	}
	
	function addtopassportmenu(){
		var displaytitlehtml = '<span class="cpfont_red16bold">'+savedestination[0].name+'</span>';
		passportmenu(displaytitlehtml);
	}
	
	function adddesttopassportmenu(newdestid){
		savedestinationid = newdestid;
		activedest[0] = savedestination[0];
		var displaytitlehtml = '<span class="cpfont_red16bold">'+savedestination[0].name+'</span>';
		passportmenu(displaytitlehtml);
	}
	
	function optionsmenu(i){
		//alert(newdestid);
		//closeextajax();
		activedest[0] = currentdestinations[i];
		activedestnum = i;
		savedestinationid = activedest[0].destinationid
		try{
			document.getElementById("ajaxtitle").innerHTML = '<span class="cpfont_red16bold">'+activedest[0].name+'</span>';
			var displaytitlehtml = '<span class="cpfont_red16bold">'+activedest[0].name+'</span>';
		}catch(err){
			var displaytitlehtml = '<span class="cpfont_red16bold">'+activedest[0].name+'</span>';
		}
		
		
		passportmenu(displaytitlehtml);
	}
	
	function locateactivedest(){
		
		try{
			if((activedestnum!='')||(activedestnum==0)){
				//alert(savedestinationid+'  ,  '+activedestnum);
				showdestination(activedestnum);
			}
		}catch(err){
			getdestinations(savedestinationid);	
		}
	}
	
	function refreshtourlist(touridtorefresh){
		//getdestinations(touridtorefresh,'DestinationName','iframe');
		var destorderby = 'cplanet_tours.tblDestinations.DateCreated';
		var destcallfrom = 'tripbuilder';
		getdestinations(touridtorefresh, destorderby, destcallfrom);
	}
	
	
	function setcreatehtml(responsetxt){
		document.getElementById("wizardcontent").innerHTML = responsetxt;
	}
	
	function setadddest_div(responsetxt){
		document.getElementById("adddest").innerHTML = responsetxt;
	}
	
	function createcthere(){
	
		if(savedestinationid != ''){
			var createurl = 'destcontrolpanel.aspx?destid='+savedestinationid;
			var ctherehtml = '<div class="cpfontheading" style="padding:15px;"><p align="center">A Cthere Window acts as a fully customizable, standalone website dedicated to describing your destination.</p>'
							+'<br><p align="center"><a href="'+createurl+'" target="_blank">Create a Cthere Page</a></p></div>';
			
			var htitle = 'Create a Cthere Destination Page';
			//top.location = createurl;
			displayMessage(ctherehtml, htitle, 375, 200);
		}	
		
		
	}
	
	function sharedestination(){
		//alert('set the link');
		var ajaxfile = 'wizards/searchhtml.html';
		var htmlelement = 'sharedestination';
		var hsanchor = 'ppsharebut';
		var hstitle = 'Share Options for <span class="cpfont_red16bold">'+activedest[0].name+'</span>';
		var hswidth = 550;
		var hsheight = 450;
		
		highslideajax(ajaxfile, htmlelement, hsanchor, hstitle, hswidth, hsheight);
		
		setTimeout("setdirectdestlink()", 500);
	}
	
	function senddestinvitation(){
		
		if(savedestinationid != ''){
			//alert(savedestinationid);
			var argstring = '?destid='+savedestinationid+'&pageidentity=description';
			contentform='Content_Forms/frmInfo.aspx'+argstring;
		}else{
			alert('No Destination ID found');
			return false;
		}
		
		
	}
	
	function setdirectdestlink(){
		//alert(savedestinationid);
		if(savedestinationid != ''){
			var ddirectlink = '<p class="cpfontbold" style="color:#990000">Direct link:  '
							+'<a href="http://www.cplanet.com/destwindow.aspx?destid='+savedestinationid+'" target="blank">Cthere Destination Link</a></p>';
							
			var durlcopy = '<p>Copy and paste your direct link:<br><textarea name="sendemailpreview" id="sendemailpreview" cols="55" rows="2" >'
							+'<a href="http://www.cplanet.com/destwindow.aspx?destid='+savedestinationid+'" target="blank">Cthere Destination Link</a></textarea></p>';
							
			var linksharehtml = ddirectlink + durlcopy;
			
			var sharelinkdiv = document.getElementById("directdestlink");
			
			sharelinkdiv.innerHTML = linksharehtml;
			
			var shareexpander = hs.getExpander(sharelinkdiv);
    		//shareexpander.reflow();
		}
		
	}
	
	function openfacebookshare(){
		
		var facebookdestmessage = '<p class="cpfontbold">Click the button below to post the Cthere Destination:<br>'
									+'<span style="font-size:14px; color:#990000; font-style:italic;">'+activedest[0].name+'</span><br>to your Facebook Page</p>';
									
		hswidth = '350';
		hsheight = '260'
		var imagetag = document.getElementById("facebooklink");
		imagetag.onclick = function() {hs.htmlExpand(imagetag, { contentId:'facebookpanel', width: hswidth, height: hsheight } )};
		imagetag.onclick();
		

		//alert(facebookdestmessage);
		var fbmessage = document.getElementById('fb_destinfo');
		fbmessage.innerHTML = facebookdestmessage;
		initfacebook();
		
	}

	
	function sfdemostart(sfanchorlink){
		
		if(!currentuser){
			highslideajax('Wizards/addtopassport.html', 'loginordemo', sfanchorlink, 'Build a Cthere Storefront', '650', '300', true);
		}else{
			startbizwiz(sfanchorlink);
		}
		
	}


//BUSINESS CONNECT WIZARD
	function startbizwiz(sfanchorlink, demo){
			
			if(demo==true){
				try{
					//expandmappane();
					closeactiveexpander();
				}catch(err){
					//NOTHING
				}
				addjspage('moreinfo');
				addjspage('createSF');
				cyosf_active = true;
				ajaxpurpose = 'buildstorefront';
				highslideajax('Wizards/addtopassport.html', 'connectbiz', sfanchorlink, 'Build a Cthere Storefront', '650', '500', true);
				
			}else{
				var oktoopen = verifythenopen();
				//alert(oktoopen);
				if(oktoopen){
					
					try{
						//expandmappane();
						closeactiveexpander();
					}catch(err){
						//NOTHING
					}
					addjspage('moreinfo');
					addjspage('createSF');
					cyosf_active = true;
					ajaxpurpose = 'buildstorefront';
					highslideajax('Wizards/addtopassport.html', 'connectbiz', sfanchorlink, 'Build a Cthere Storefront', '650', '500', true);
				}
				
			}
		
	}



//TRIP BUILDER FUNCTIONS

	function tb_nolocstart(){
		
		try{
			expandmappane();
		}catch(err){
			//NOTHING
		}
		
		ajaxpurpose = 'tripbuilder';
		highslideajax('Wizards/searchhtml.html', 'tripbuilder', '', 'Add a Trip to your Cplanet Passport', '500', '300');
		
	}
	
	
	function tripbuilder(noloc, tbanchorlink){
		
		var userok = verifythenopen();
		//makeHttpRequest('Wizards/cplanet_midnav.html', setmidnav);
		if(userok){
			try{
				cyosf_active = false;
				closeactiveexpander();
			}catch(err){
				//NO ACTION	
			}
			var tripbuilderpage = 'wizards/tripbuilder.html';
			
			if(noloc){
				var tripbuildersection = 'tb_panel_noloc';
				highslideajax(tripbuilderpage, tripbuildersection, tbanchorlink, 'Add a Trip to your Cplanet Passport', '600', '450', true);
			}else{
				var tripbuildersection = 'tb_panel_hasloc';
				highslideajax(tripbuilderpage, tripbuildersection, tbanchorlink, 'Add a Trip to your Cplanet Passport', '600', '450', true);
			}
		}
		
	}
	
	
	function tripbuilderoff(){
		tb_active = false;
		closeextajax();
		closetbcp();
		setTimeout("refreshtours('"+tb_tourid+"')",0);
		//setTimeout("refreshdestinations('"+tb_tourid+"')",0);
		var tourviewer = 'tourviewer.html?tourid='+tb_tourid;
		framewebsite(tourviewer);
	}
	
	
	function tbcreatetour(tbtourname, noloc){
		
		if(tbtourname!=''){
			document.getElementById("cpresultshtmlpanel").style.backgroundcolor = '#F9AF6C';
			tb_tourname = tbtourname;
			//midnavsearchdisplay('off');
			//makeHttpRequest('Wizards/tripbuilder_midnav.html', settbcontrolpanel);
			
			WebService.createtour(tbtourname, settbtour);
			
			if(noloc == true){
				setTimeout("tb_nolocstart()", 500);
			}else{
				tb_active = true;
				opentb_controlpanel();
				setTimeout("setripvariables()", 500);
			}
		}
		
	}
	
	
	function settbcontrolpanel(tbcphtml){
		document.getElementById("midnavmessage").innerHTML = tbcphtml;
	}
	
	function setripvariables(){
		
		var tb_triptitle = '<span style="color:#666666; font-size:12px;">Trip Name: </span><span style="font-size:14px; color:#FFFFFF;"><b><i>'+tb_tourname+'</i></b></span>';
		document.getElementById("tb_triptitlediv").innerHTML = tb_triptitle;
	}
	
	function settblastadded(){
		try{
			if(savedestination[0].name != ''){
				var lastadded = '<span style="color:#666666;">Last added: <b>'+savedestination[0].name+'</b></span>';
				document.getElementById("tb_lastadded").innerHTML = lastadded;
			}else{
				alert('No destinations in trip');	
			}
		}catch(err){
			//Nothing
		}
	}
	
	function settbtour(tourid){
		//alert(tourid);
		activetourname = tb_tourname;
		tb_tourid = tourid;
		activetourid = tourid;
		setTimeout("refreshtours('"+tb_tourid+"')",0);
		closeextajax();
	}
	
	function addtbdestination(savestr){
		WebService.createdest(savestr, tb_tourid, settbdestination);	
	}
	
	function settbdestination(){
			settblastadded();
			activetourname = tb_tourname;
			setTimeout("refreshtours('"+tb_tourid+"')",0);
			setTimeout("refreshtourlist('"+tb_tourid+"')",0);
	}




//SPONSOR FUNCTIONS
	function sponsorareasearch(term){
		setsponsor();
		sponsorsearchterm = term;
		//alert(sponsorsearchterm+" , "+sponsormarker);
		searchyahoo('search', 'initial', 'sponsor');
	}

	function setsponsor(){
		//alert('populating sponsors...');
		sponsormarker = 'mcdonalds.png';
	}
	
	function sponsorfilter(resultname){
		var validsponsor;
		var smallresultname = resultname.toLowerCase();
		var spstr = smallresultname.search('mcdonald');
		//alert(spstr);
		if(spstr != -1){
			validsponsor = true;
		}else{
			validsponsor = false;
		}
		
		return validsponsor; 
	}






function changecursor(){
		element.style.cursor='default';
}


function settexboxfocus(textbox){
	try{
		document.getElementById(textbox).focus();
	}catch(err){
		 //alert('Cant set focus on txtLocateSF_Business');
	}
}


//THE FOLLOWING FUNCTION NEEDS TO BE CALLED FROM THE "PAGE SPECIFIC" JAVASCRIPT FILE TO SET THE GLOBAL DIVS NEEDED FOR THE CORRESPONDING FUNCTIONS.
	function setmapglobals(){
		
		mapdiv = document.getElementById("map");
		var mapsetupflag = loadmap();
		
		if(mapsetupflag == 'success'){
			
			if(includecustommarkers == 1){
				addcustommarkers();
			}
			
			if(includemapcontrols == 1){
				mapcontrolsdiv = document.getElementById("mapcontrolsholder");
				setup_mapcontrols();
			}
			
			if(includecreatecontrols == 1){
				mapcreatetoolsdiv = document.getElementById("createcontrols");
				setup_createcontrols();
			}
			
			if(includedirections == 1){
				mapdirectionsdiv = document.getElementById("directionscontent");
				setup_intdirections();
			}
			
			if(includepano == 1){
				mappanodiv = document.getElementById("pano");
				mappanodetailsdiv = document.getElementById("panodetails");
				highslidepanodiv = document.getElementById("panopanel");
				if(panotoggleState == 1){
					init_streetview();
				}
			}
		}
	}
	
	function completelogin(){
		highslidecontrol('loginoff');
		setuserpage();
		refreshtours();
		//setTimeout("setuserpage()",700);
		//setTimeout("refreshtours()",1000);
		WebService.userinfo(setuserdata);
		//alert('Login Complete');
	}



//LOGIN FUNCTIONS 
	function setuserpage(){
		
		var username = document.getElementById("HiddenFieldloggedonusername").value;
		var isuserverified = document.getElementById("HiddenIsUserVerified").value;
		var whospage = document.getElementById("HiddenFieldQueryStringUser").value;
		
		//alert('Username: '+username+', Verified: '+isuserverified+', WhosPage: '+whospage);
		
		if(username){
			if(isuserverified=='True'){
				currentuser=username;
				userok=true;
				document.getElementById("mypagelink").innerHTML='<a href="javascript:verifythenopen(\'mystuff\')"><img src="globalgraphics/general/passport_mini.jpg" border="0"> My Passport</a>';
				document.getElementById("userlogging").innerHTML = '<a href="javascript:logoutButton_Click()">Logout </a>';
				document.getElementById("forumlink").innerHTML = '<a href="http://www.cplanet.com/forum" target="_blank">User Forum</a>';
				WebService.userinfo(setuserdata);
				//alert('User: '+username+' is completely logged in');
			}else{
				//alert('User: '+username+' has not verified their account email address');
				userok=false;
				document.getElementById("dynhtmlcontent").innerHTML='<div align="center"><span class="cpfonttitle">The account for '+username+' has not been verified.</span><hr><span class="cpfontheading">Please check the contact email address for an email titled "Welcome to Cplanet" and click the verification link.</span></div>';
				highslidecontrol('dynhtml');
				document.getElementById("userlogging").innerHTML='<a href="javascript:logoutButton_Click()">Logout </a>';
			}
		}else{
			userok=false;
			document.getElementById("userlogging").innerHTML='<a href="javascript:showLogin()" >Login </a>';
		}
		
		if((whospage!='')&&(whospage!=currentuser)){
			//alert('Whos Page= '+whospage);
			
			mainpagetype = document.getElementById("HiddenFieldPageType").value;
			userspage=whospage;
			
			if(mainpagetype != 'org'){
				document.getElementById("guestuser").innerHTML=userspage+'\'s<br><span class="cpfontbold">Cplanet Passport</span>';
				setmainusertitle(userspage);
				highslidecontrol('mystuffoff');
				document.getElementById("guestpassportbuttondiv").innerHTML = '<img src="globalgraphics/general/midnav_guestppbut.png" onmouseover="this.style.cursor=\'pointer\'" onclick="highslidecontrol(\'gueststuff\');" />';
				highslidecontrol('gueststuff');
			}else{
				configdma(userspage);  
			}
		}
	
	}
	
	function configdma(userspage){
		
		setdma(userspage);
		
		if(dmosuccess == true){
			//THIS IS THE PATH TO THE PASSPORT HEADER IMAGE
				if(dmodirectoryheader != ''){
					document.getElementById("guestuser").innerHTML = dmodirectoryheader;
				}
			
			//THIS IS IF YOU WANT TO CHANGE THE PASSPORT COVER TO A CUSTOM IMAGE - JUST CHANGE THE PATH TO THE IMAGE
				if(dmopassportcover != ''){
					document.getElementById("guestpassportcover").src = dmopassportcover;
				}
				//document.getElementById("guestpassportcover").src = 'dmos/rochesterdda/images/cover.jpg';
				
			//THESE LINES ALLOW YOU TO ASSOCIATE A CUSTOM MARKER TO AN ORGANIZATION
				if(dmomarker != ''){
					markerimage = markerpath+dmomarker;
				}
				
			//THESE LINES OPEN THE DIRECTORY PANEL - IF THE CUSTOM PASSPORT COVER IS TURNED ON COMMENT OUT THE "openguestpassport()" FUNCTION.
				highslidecontrol('gueststuff');
				openguestpassport();
				
			//THESE LINES SET THE MAP CENTER BASED ON THE HARD CODED SEARCH VARIABLE -	initmapcenter.
				geopurpose='centermap';
				if(dmomapcenter != ''){
					callgeocode(dmomapcenter);
				}
				
		}else{
			document.getElementById("guestuser").innerHTML=userspage+'\'s<br><span class="cpfontbold">Cplanet Passport</span>';
			setmainusertitle(userspage);
			highslidecontrol('mystuffoff');
			openguestpassport();
		}
			
	}
	
	function setmainusertitle(mutitle){
		try{
			document.getElementById("mainusertitle").innerHTML = mutitle;
		}catch(err){
			//Nothing	
		}
	}
	
	function setusercthere(){
		var cthereusermessage = '<div align="center" style="width:400px;" ><i><span class="cpfontheading18">'+userarray[0].firstname+','
								+' try out the Cthere Tools and start adding destinations to your Cplanet Passport.</span>'
								+'<div align="left" style="width:275px;" class="cpfontreg"><ul><b>Fun ideas to help get started:</b><li>Create a tour of your home town.</li><li>Build your dream vacation.</li>'
								+'<li>Plan your wedding.</li><li>Re-create your favorite adventure.</li>'
								+'</ul></div></i></div>';
								
		document.getElementById("userdatadiv").innerHTML = cthereusermessage;	
		
	}
	
	function setuserdata(userstr){
		//alert(userstr);
		var userdetails = userstr.split("|");
		
		//alert(userdetails.length);
		
		if(userdetails.length==16){
			userarray[0] = new popuserdata(userdetails[0], userdetails[1], userdetails[2], userdetails[3], userdetails[4], userdetails[5], userdetails[6], userdetails[7], userdetails[8], userdetails[9], userdetails[10], userdetails[11], userdetails[12], userdetails[13], userdetails[14], userdetails[15], userdetails[16]);
		}
		
		senduserdata();
	}
	
	function senduserdata(){
		
		var userdatahtml = builduserarea();
		
		if(userdatahtml != 'blank'){
			try{
				//alert(activepagetype);
				if(activepagetype == 'cplanet'){
					
					document.getElementById("mystuffuser").innerHTML = currentuser+'\'s<br><span class="cpfontbold">Cplanet Passport</span>';
					setmainusertitle(currentuser);
					
					if(mainpagetype!='org'){
						document.getElementById("cpuserarea").innerHTML = builduserarea();
					}
					
					document.getElementById("mystuffcontrols").innerHTML = '<table cellpadding="0" cellspacing="0" width="100%" align="center"><tr>'
									+'<td align="left"><a href="wizards/addtopassport.html#passportaddmenu" id="addtopp" alt="Add a Destination"'
									+'onclick="return hs.htmlExpand(this, { objectType: \'ajax\', anchor: \'top right\', headingText: \'<i>Add to Passport Menu</i>\', width:80, height:200} )">'
									+'<img src="globalgraphics/general/pp_addbut.gif" border="0" /></a></td>'
									+'<td align="right"><a href="javascript:verifythenopen(\'editmystuff\')" alt="Edit your Groups, Desitinations and Events">'
									+'<img src="globalgraphics/general/pp_managebut.gif" border="0" /></a></td></tr></table>';
				}else{
					document.getElementById("mystuffuser").innerHTML = currentuser+'\'s<br><span class="cpfontbold">Cplanet Passport</span>';
					setmainusertitle(currentuser);
					setusercthere();
				}
			}catch(err){
				//Nothing	
				//alert('did nothing');
			}
		}
	}
	
	function popuserdata(firstname, lastname, address1, address2, city, state, zip, country, dob, gender, lastupdate, phone, screenname, cellnumber, avatar){
		
		this.firstname=firstname;
		this.lastname=lastname;
		this.address1=address1;
		this.address2=address2;
		this.city=city;
		this.state=state;
		this.zip=zip;
		this.country=country;
		this.dob=dob;
		this.gender=gender;
		this.lastupdate=lastupdate;
		this.phone=phone;
		this.screenname=screenname;
		this.cellnumber=cellnumber;
		this.avatar=avatar;
		
	}
	
	function builduserarea(){
		try{
			var userlocation = '';
			var useravatar = 'globalgraphics/general/useravatar.jpg';
			
			if(userarray[0].city != ''){
				userlocation += userarray[0].city;
			}
			
			if(userarray[0].state != ''){
				userlocation += ', '+userarray[0].state;
			}
			
			if(userarray[0].country != ''){
				userlocation += ', '+userarray[0].country;
			}
			
			if(userarray[0].avatar != ''){
				useravatar = userarray[0].avatar;
				//alert(useravatar);
			}
			
			var userareahtml = '<div align="center" style="padding:10px;">'
								+'<table width="100%" border="0" cellspacing="0" cellpadding="5" class="cpfont" style="border:solid 4px #CCCCCC;">'
								+'<tr><td colspan="2" class="cpfont_grayheading"><i>Welcome to the Planet, </i>'+userarray[0].firstname+'</td></tr>'
								+'<tr><td align="center"><img src="'+useravatar+'" width="128" height="128" alt="Upload / Change Avatar" id="useravatar" onmouseover="this.style.cursor=\'pointer\'" runat="server" onclick="opencontrol(\'uploadavatar\')" />'
								+'<br /><span class="cpfontreg"><a href="javascript:senduserlocation(\''+userlocation+'\')">'+userlocation+'</a>'
								+'<br><a href="controls/UserProfileEdit.aspx">Edit User Info</a></span></td>'
								+'<td align="center"><img src="globalgraphics/general/passportmedium.jpg" alt="Open your Cpalnet Passport" id="userpassport" onmouseover="this.style.cursor=\'pointer\'" runat="server" onclick="openuserpassport()" />'
								+'<br /><a href="javascript:edituserpassport()"><span class="cpfontreg">Edit Passport</span></a></td></tr>'
								+'<tr><td colspan="2" align="center"><span class="cpfont_gray14bold">Try out our Cthere Features:</span><br />'
								+'<img src="globalgraphics/general/cthere_userbut.jpg" onclick="makeHttpRequest(\'Wizards/cthere_menu.html\', setcthere)" onmouseover="this.style.cursor=\'pointer\'"/></td></tr>'
								+'</tr></table>'
								+'</div>';
								
			
			return userareahtml;
		}catch(err){
			var userareahtml = 'blank';
			return userareahtml;
		}
		
	}
	
	function openuserpassport(){
		highslidecontrol('mystuff');	
	}

	function edituserpassport(){
		opencontrol('editmystuff');	
	}

function senduserlocation(userlocation){
	geopurpose = 'locsearch';
	callgeocode(userlocation);	
}

//Checks and sets shared destination or group
function setsharedpage(){
	sharedguest = document.getElementById("HiddenFieldShared").value;
	//alert(sharedguest);
	if(sharedguest=='yes'){
		
		shareddestid = document.getElementById("HiddenFieldSharedID").value;    
		if (shareddestid){
			//highslidecontrol('mystuff');
			getdestinations(shareddestid,'DestinationName', 'invitation');
		 
		}
	}
}


function showLogin() {
	highslidecontrol('login');
	//document.getElementById("userName").focus();	
}


function hideLogin() {
	
	alert('Hiding Login Stuff');
	document.getElementById("login-link").style.visibility = "visible";
	document.getElementById("login-panel").style.visibility = "hidden";
	document.getElementById("login-panel").style.height = "0";

	// Blank out the username and password for security reasons.
	document.getElementById("userName").value = "";
	document.getElementById("password").value = "";
	
}


function verifythenopen(control){
    
	if(userok==true){
		try{
			if(control){
				switch(control){
					case 'mystuff':
						highslidecontrol(control);
					break;
					
					default:
						opencontrol(control);
					break;
				}
			}else{
				return true;
			}
		}catch(err){
			return true;
		}
	}else{
		showLogin();
		return false;
		//alert('Please login to save and edit.');
	}
	
}

function addeditmedia(destid){
	//alert(destid);
	
	if(!destid){
		document.getElementById("HiddenDestinationID").value=destid;
	}
	
	var createurl = '../destcontrolpanel.aspx?destid='+destid;
	top.location = createurl;
}


function closecontrol(refreshtourid, refreshtourname, openmystuff){
	//setfocusonparent();
	//alert(refreshtourid);
	closehscontrols();
	
	activetourname = refreshtourname;
	
	if(refreshtourid){
		setTimeout("refreshtours('"+refreshtourid+"')",0);
		setTimeout("refreshdestinations('"+refreshtourid+"')",0);
	}
	
	if (openmystuff==true){
		removeactivemarker();
		//highslidecontrol('mystuff');	
	}

}

function togglemapdisplaybutton(mapstate){
	
	if(mapstate == 'expanded'){
		document.getElementById('showmap').src = 'globalgraphics/general/midnav_hidemap.png';
		document.getElementById('showmap').onclick = function() {collapsemappane()}
	}
	
	if(mapstate == 'collapsed'){
		document.getElementById('showmap').src = 'globalgraphics/general/midnav_showmap.png';
		document.getElementById('showmap').onclick = function() {expandmappane()};
	}

}

function midnavsearchdisplay(state){
	
	if(state == 'on'){
		var midnavsearchhtml = '<table align="right" border="0" cellspacing="0" cellpadding="0">'
			  					+'<tr><td valign="middle" align="right">'
								+'<input id="txtLocationSearchMap" name="txtLocationSearchMap" value="Enter a location to explore" type="text" '
								+'size="25" style="font-size:16px; color:#999999;" onfocus="setthefocus(this.id)" /></td>'
								+'<td valign="top" align="right">'
								+'<img src="globalgraphics/general/midnav_go.png" alt="Set the Explore Center" id="btnLocationSearchMap"'
						  		+'onmouseover="this.style.cursor=\'pointer\'" onclick="processinput(\'txtLocationSearchMap\')" /></td></tr></table>';
								
								
		document.getElementById('minnavlocsearch').innerHTML = midnavsearchhtml;
	}else{
		document.getElementById('minnavlocsearch').innerHTML = '';	
	}
	
	if(mapstate == 'collapsed'){
		document.getElementById('showmap').src = 'globalgraphics/general/midnav_showmap.png';
		document.getElementById('showmap').onclick = function() {expandmappane()};
	}

}

function expandmappane(){
	mapstate = 'expanded';
	//togglemapdisplaybutton(mapstate);
	//sizeapp();
}

function collapsemappane(){
	mapstate = 'collapsed';
	//togglemapdisplaybutton(mapstate);
	//sizeapp();
}

function testmoreinfo(){
    var currentinfo = document.getElementById('infoholder').innerHTML;

    currentinfo += '<div>moreinfo<br>moreinfo<br>moreinfo<br>moreinfo<br>moreinfo<br>moreinfo<br>moreinfo<br>moreinfo<br>moreinfo<br>moreinfo<br></div>';

    document.getElementById('infoholder').innerHTML = currentinfo;
}


function sizeapp(){
	
	getwinsize();
	//alert('Map State: '+mapstate+'\nWindow Height: '+windowheight);
	
	if(windowheight < 850){
		if(mapstate == 'expanded'){
			document.getElementById('mapholder').style.visibility = 'visible';
			document.getElementById('mapholder').style.height = '650px';
			document.getElementById('map').style.height = '650px';
		}else{
			document.getElementById('mapholder').style.visibility = 'hidden';
			document.getElementById('mapholder').style.height = '0px';
			document.getElementById('map').style.height = '0px';
		}
	}else{
		var newwinheight = windowheight - 50;
		
		if(mapstate == 'expanded'){
			document.getElementById('mapholder').style.visibility = 'visible';
			document.getElementById('mapholder').style.height = newwinheight + 'px';
			document.getElementById('map').style.height = newwinheight + 'px';
		}else{
			document.getElementById('mapholder').style.visibility = 'hidden';
			document.getElementById('mapholder').style.height = '0px';
			document.getElementById('map').style.height = '0px';
		}
	}
	
	try{
		map.checkResize();
		map.enableDragging();
	}catch(err){
		 //alert('Cant find the map object');
	}


}

function openpassport() {

    document.getElementById('cppassport').innerHTML = '';
    document.getElementById('cppassport').style.visibility = 'hidden';

    document.getElementById('cppp_toc').style.visibility = 'visible';
    document.getElementById('cppp_toc').style.height = 'auto';
    document.getElementById('cppp_toc').style.overflow = 'visible';
    
}

function openguestpassport() {

    document.getElementById('guestcppassport').innerHTML = '';
    document.getElementById('guestcppassport').style.visibility = 'hidden';

    document.getElementById('guest_toc').style.visibility = 'visible';
    document.getElementById('guest_toc').style.height = 'auto';
    document.getElementById('guest_toc').style.overflow = 'visible';
    
}


function swapcontent(choice){
	
	contentchoice=choice;
	
	if (choice=='localinfo'){
		//document.getElementById('localinformation').style.visibility = 'visible';
		document.getElementById('content').style.visibility = 'hidden';
		document.getElementById('menu').style.visibility = 'hidden';
		//document.getElementById("contentnav").innerHTML='';
		document.getElementById("menu").innerHTML='';
		document.getElementById("content").innerHTML='';
	}

	if (choice=='content'){
		//document.getElementById('localinformation').style.visibility = 'hidden';
		document.getElementById('content').style.visibility = 'visible';
		document.getElementById('menu').style.visibility = 'hidden';
	}
	
	if (choice=='menu'){
		//document.getElementById('localinformation').style.visibility = 'hidden';
		document.getElementById('content').style.visibility = 'hidden';
		document.getElementById('menu').style.visibility = 'visible';
		document.getElementById("content").innerHTML='';
	}

}


function refreshdestinations(touridtorefresh){
	//getdestinations(touridtorefresh,'DestinationName','iframe');
	var destorderby = 'cplanet_tours.tblDestinations.DateCreated';
	var destcallfrom = 'self';
	getdestinations(touridtorefresh, destorderby, destcallfrom);
}

function setcpcontentsize(){
	alert('setting size');
	document.getElementById("cpcontent").style.width=contentforms_width;
	document.getElementById("cpcontent").style.height=contentforms_height;
}

function manualcalsetup(){
	
	if(calendarscripts == false){
		addjspage('calendar');
		addjspage('calendar-en');
		addjspage('calendar-setup');
		calendarscripts = true;
		//setTimeout("setupcalendar()", 2500);
	}
}

function setthefocus(activeid){
    //alert('Setting globalenter to: '+activeid );
	document.getElementById(activeid).value = '';
	var newfocus = 	document.getElementById(activeid);
	newfocus.focus();
	globalinputfield = activeid;
}

function resetfocus(){
	var newfocus = 	document.getElementById("mastercontrols");
	newfocus.focus();
}

function settextareareturn(){
	try{
		multilinetext = true;
	}catch(err){
		//NO ACTION
	}
}

function settextareareturnclear(textboxoject){
	try{
		multilinetext = true;
		textboxoject.value = '';
		textboxoject.style.color = '#000000';
	}catch(err){
		//NO ACTION
	}
}




//THE CHECH KEY FUNCTION SORTS OUT ALL KEY PRESSES EXCEPT THE ENTER KEY THEN TRIGGERS THE "processinput()" FUNCTION
//****NOTE: CHECK KEY FUNCTION REQUIRES THE JAVASCRIPT LINE "document.onkeypress = checkKey;" ON THE MASTER PAGE
//****NOTE: CHECK KEY FUNCTION REQUIRES A "processinput()" FUNCTION TO HANDLE THE ENTER KEY.
function checkKey(e)
{
	//alert(browsertype);
	var intKeyCode = 0;
	if (browsertype == "ie"){
		if (window.event.keyCode == 13){
			if(multilinetext==false){
				processinput();
				return false;
			}
		}
	}
	if (browsertype == "netscape"){
		//alert(e.which);
		intKeyCode = e.which;
		if (intKeyCode == 13){
			//alert('Enter key has been pressed');
			if(multilinetext==false){
				processinput();
				return false;
			}
		}
	}
	
}


function processinput(whichinput){
		
		if(globalinputfield == 'blank'){
			var activeinputfield = whichinput;
		}else{
			var activeinputfield = globalinputfield;	
		}
		
		//alert('activeinput: '+activeinputfield);
		
		var templocstring;
		var tempbizsearchterm;
		
      	switch (activeinputfield){
			case 'txtLocationSearchMain':
				geopurpose = 'comguide';
				templocstring = document.getElementById("txtLocationSearchMain").value;
				if(templocstring != ''){
					callgeocode(templocstring);
				}else{
					alert('Please enter a valid location search term');	
				}
			break;
			
			case 'txtLocationSearchAjax':
				processajax();
			break;
			
			case 'txtLocationSearchMap':
				geopurpose = 'comguide';
				templocstring = document.getElementById("txtLocationSearchMap").value;
				if(templocstring != ''){
					callgeocode(templocstring);
				}else{
					alert('Please enter a valid location search term');	
				}
			break;
			
			case 'txtLocationSearchGlobal':
				geopurpose = 'locsearch';
				templocstring = document.getElementById("txtLocationSearchGlobal").value;
				if(templocstring != ''){
					callgeocode(templocstring);
				}else{
					alert('Please enter a valid location search term');	
				}
			break;
			
			case 'txtBusinessSearchExplore':
				geopurpose = 'bizsearch';
				currentbizsearchterm = document.getElementById('txtBusinessSearchExplore').value;
				templocstring = document.getElementById("txtBusinessSearchLocationExplore").value;
				if((templocstring != '')&&(currentbizsearchterm != '')){
					callgeocode(templocstring);
				}else{
					alert('Please enter valid search terms');	
				}
			break;
			
			case 'dyn_bizsearch':
				geopurpose = 'bizsearch';
				currentbizsearchterm = document.getElementById('dyn_bizsearch').value;
				
				if(dmolocation){
					templocstring = dmolocation;
				}else{
					templocstring = globallocation;
				}
				
				if((templocstring != '')&&(currentbizsearchterm != '')){
					callgeocode(templocstring);
				}else{
					alert('Please enter valid search terms');	
				}
			break;
			
			case 'createbizsearchtext':
				geopurpose = 'bizsearch';
				currentbizsearchterm = document.getElementById('createbizsearchtext').value;
				templocstring = document.getElementById("createbizsearchloctext").value;
				if((templocstring != '')&&(currentbizsearchterm != '')){
					callgeocode(templocstring);
					highslidecontrol('dynhtmloff');
				}else{
					alert('Please enter valid search terms');	
				}
			break;
			
			case 'createaddressloctext':
				geopurpose = 'create';
				templocstring = document.getElementById("createaddressloctext").value;
				if(templocstring != ''){
					callgeocode(templocstring);
					//highslidecontrol('dynhtmloff');
				}else{
					alert('Please enter a valid location search term');	
				}
			break;
			
			case 'txtBusinessSearchBubble':
				geopurpose = 'bizsearch';
				currentbizsearchterm = document.getElementById('txtBusinessSearchBubble').value;
				templocstring = document.getElementById("txtBusinessSearchLocationBubble").value;
				if((templocstring != '')&&(currentbizsearchterm != '')){
					callgeocode(templocstring);
				}else{
					alert('Please enter valid search terms');	
				}
			break;
			
			case 'bubbleeverything':
				geopurpose = 'bizsearch';
				currentbizsearchterm = '*';
				templocstring = document.getElementById("txtBusinessSearchLocationBubble").value;
				if(templocstring != ''){
					callgeocode(templocstring);
				}else{
					alert('Please enter a location');	
				}
			break;
			
			case 'txtLocateSF_Business':
				findbusiness();
			break;
			
			case 'password':
				loginButton_Click();
			break;
			
			case 'saddr':
				getdirections('to', globaldirectionpoint);
			break;
			
			case 'daddr':
				getdirections('from', globaldirectionpoint);
			break;
		}
		
		globalinputfield = 'blank';
	  
}


function processajax(){
	
	//alert(ajaxpurpose);
	
	switch(ajaxpurpose){
		
		case 'locsearch':
			geopurpose = 'locsearch';
			templocstring = document.getElementById("txtLocationSearchAjax").value;
			if(templocstring != ''){
				callgeocode(templocstring);
			}else{
				alert('Please enter a valid location search term');	
			}
		break;
		
		
		case 'buildstorefront':
			geopurpose = 'createcthere';
			templocstring = document.getElementById("txtLocationSearchAjax").value;
			//alert(templocstring);
			if(templocstring != ''){
				expandmappane();
				callgeocode(templocstring);
				closeactiveexpander();
			}else{
				alert('Please enter a valid location search term');	
			}
		break;
		
		case 'createdest':
			geopurpose = 'adddesttopp';
			templocstring = document.getElementById("txtLocationSearchAjax").value;
			//alert(templocstring);
			if(templocstring != ''){
				expandmappane();
				callgeocode(templocstring);
				closeactiveexpander();
			}else{
				alert('Please enter a valid location search term');	
			}
		break;
		
		case 'tripbuilder':
			geopurpose = 'tripbuilder';
			templocstring = document.getElementById("txtLocationSearchAjax").value;
			if(templocstring != ''){
				callgeocode(templocstring);
				opentb_controlpanel();
				setTimeout("setripvariables()", 500);
			}else{
				alert('Please enter a valid location search term');	
			}
		break;
		
	}
	
}


function settextfields(){
	
		try{
			document.getElementById("txtLocationSearchMain").value=globallocation;
		}catch(err){
			 //alert('In Organization Mode');
		}
		
		try{
			document.getElementById('txtLocationSearchMap').value = globallocation;
		}catch(err){
			 //alert('In Organization Mode');
		}
		
		try{
			document.getElementById('txtBusinessSearchLocationExplore').value = globallocation;
		}catch(err){
			 //alert('In Organization Mode');
		}
		
		try{
			document.getElementById('explorepanelloc').innerHTML = globallocation; 
			document.getElementById('txtLocationSearchGlobal').value = globallocation;
		}catch(err){
			 //alert('In Organization Mode');
		}
		
		document.getElementById('txtBusinessSearchExplore').value=currentbizsearchterm;
	
}


function swaplatlngformat(choice){
	
	if (choice=='dec'){
		document.getElementById('latlngdecimal').style.visibility = 'visible';
		document.getElementById('latlngdegree').style.visibility = 'hidden';
	}

	if (choice=='deg'){
		document.getElementById('latlngdecimal').style.visibility = 'hidden';
		document.getElementById('latlngdegree').style.visibility = 'visible';
	}

}

function expandresults(resultsdiv){
	
	var expander = hs.getExpander();
	var activepanel = expander.contentId;
	var fullpanelheight = document.getElementById(activepanel).offsetHeight + 65;
	
	document.getElementById(activepanel).style.height = fullpanelheight;
	
	alert(expander.contentId);
	expander.reflow();
}


function singlesearchdest(tourid, orderby, wherefrom){
	highslidecontrol('dynhtmloff');
	getdestinations(tourid, orderby, wherefrom);
}


//PREPARES THE SELECTED RESULT FOR SEND OR INVITE FUNCTIONS IN SHAREFUNCTIONALITY.JS
function prepforsend(i, type){
	
	if(type == 'cpdest'){
		sendtomehtml = destboxes[i];
	}
	
	if(type == 'yahoo'){
		sendtomehtml = bizboxes[i];
	}
	
	buildsendbubble();
	
	setTimeout("highslidecontrol('sendtome')",500);
}



function scanvenues(sender, args){
	var currentnode = args.get_node();
	var vencatagory = currentnode.get_category();
	var venname = currentnode.get_text();
	var venvalue = currentnode.get_value();
	//Resets the page.
	expandmappane();
	markonmap=true;
	clearmap();
	
	setvenuemarker(vencatagory);
	activebizheader = venname;
	currentquery = '*';
	currentvenue = venvalue;
	searchyahoo('venue', 'initial');
}


function setvenuemarker(venue){
	
	markerimage = markerstandard;
	
	switch(venue) {
  	    	case 'Lodging':
			markericon = 'marker_lodging.png';
			break;
			
			case 'Restaurants':
			markericon = 'marker_restaurant.png';
			break;
			
			case 'Shopping':
			markericon='marker_shopping.png';
			break;
			
			case 'Bars and Clubs':
			markericon='marker_bar.png';
			break;
			
			case 'Beauty':
			markericon='marker_beauty.png';
			break;
			
			case 'Entertainment and Arts':
			markericon='marker_entertainment.png';
			break;
			
			case 'Recreation and Sports':
			markericon='marker_sports.png';
			break;
			
			case 'Travel':
			markericon='marker_travel.png';
			break;
			
			case 'Health and Medicine':
			markericon='marker_health.png';
			break;
			
			case 'Services':
			markericon='marker_service.png';
			break;
			
			case 'Real Estate':
			markericon='marker38.png';
			break;
			
			case 'ATMs':
			markericon='marker_atm.png';
			break;
			
			case 'PA':
			markericon='marker_parking.png';
			break;
			
			case 'Taxi Services':
			markericon='marker_taxi.png';
			break;
		
  		}
		
		markerimage = markerpath+markericon;
	
}


