
		function dosomething() 
		{
			//setLBWindownew($fGet('lb_display'),346,447);
			//do_showDashboard($fGet('lb_display'));
			var goofy = Effect.SlideUp('mainDisp',{duration:1.0});
			//goofy = Effect.SlideDown('mainDisp',{duration:1.0});
		}
		function doelse()
		{
			var goofy = Effect.SlideDown('mainDisp',{duration:1.0});
		}
		function setLBWindownew(idcontainer,widgetWidth,widgetHeight)
		{
			var heightOffset = 100;
			if(browser.ie)
			{
				if(browser.ie7)
				{ 
					var centerx = document.body.clientWidth / 2;
					var centery = (document.body.clientHeight / 2) + 150;
				}
				else
				{
					var centerx = document.body.clientWidth / 2;
					var centery = (document.body.clientHeight / 2) + 100;
				}
			}
			else
			{
				var centerx = window.outerWidth / 2;
				var centery = ((window.outerHeight + window.pageYOffset) / 2);
			}
			var lbleft = centerx - (widgetWidth / 2) + "px";
			var lbtop = centery - (widgetHeight / 2) - heightOffset + "px";
			$fGet('lb_display').style.left = lbleft;
			$fGet('lb_display').style.top = lbtop;			
			//$(idcontainer).style.left = lbleft;								
			//$(idcontainer).style.top = lbtop;			
		}
		function getWeddingInfo(whereto)
		{
			switch (whereto)
			{
				case 'Home':
					processRequest('/DataResource/home.php', 'DMID2');
					break;
				case 'BrideAndGroom':
					processRequest('/DataResource/brideandgroom.php', 'DMID3');
					break;					
				case 'HowWeMet':
					processRequest('/DataResource/howwemet.php', 'DMID3');
					break;					
				case 'TheProposal':
					processRequest('/DataResource/theproposal.php', 'DMID3');
					break;					
				case 'CeremonyAndReception':
					processRequest('/DataResource/ceremonyNreception.php', 'DMID4');
					break;
				case 'BridalParty':
					processRequest('/DataResource/bridalparty.php', 'DMID4');
					break;
				case 'Accommodations':
					processRequest('/DataResource/accommodations.php', 'DMID4');
					break;
				case 'WenteWineTasting':
					processRequest('/DataResource/winetasting.php', 'DMID4');
					break;
				case 'OurRegistry':
					processRequest('/DataResource/ourregistry.php', 'DMID4');
					break;
				case 'Photos':
					processRequest('/DataResource/slide.php', 'DMID5');
					break;
				case 'Slide2':
					processRequest('/DataResource/slide2.php', 'DMID5');
					break;
				case 'Wente':
					processRequest('/DataResource/slide3.php', 'DMID5');
					break;
				case 'Rome':
					processRequest('/DataResource/slide4.php', 'DMID5');
					break;
				case 'Florence':
					processRequest('/DataResource/slide5.php', 'DMID5');
					break;
				case 'Venice':
					processRequest('/DataResource/slide6.php', 'DMID5');
					break;					
				case 'Blog':
					window.open('http://www.jenieandfrank.com/blog');
					processRequest('/DataResource/blog.php', 'DMID6');
					break;
				case 'GuestBook':
					processRequest('/Misc/guestbook/index.php', 'DMID7');
					break;
				case 'Sign':
					processRequest('/Misc/guestbook/sign.php?', 'DMID7');
					break;
				case 'writeGB':
					var goofy = "";
					var myPar = new Array();
					myPar['name'] = $F('gbname');
					myPar['email'] = $F('gbemail');
					myPar['location'] = $F('gblocation');
					myPar['homepage'] = $F('gbhomepage');
					myPar['comment'] = $F('gbcomment');
					myPar['send'] = $F('Submit');
					new Ajax.Updater('mainDisp', '/Misc/guestbook/sign.php', {
						method:'post',
						parameters: myPar
					});
					break;
				case 'ContactUs':
					processRequest('/DataResource/contactus.php', 'DMID8');
					break;
				case 'SendEmail':
					var myPar = new Array();
					myPar['YourName'] = $F('YourName');
					myPar['YourEmail'] = $F('YourEmail');
					myPar['PersonalNote'] = $F('PersonalNote');
					myPar['ContactUS'] = $F('SendForm');
					new Ajax.Updater('mainDisp', '/DataResource/emailus.php', {
						method:'post',
						parameters: myPar
					});	
					break;
				default:
					processRequest('/DataResource/test.php', 'DMID2');
			}		
		}
		function getGBPage(pageno)
		{
			var myRequest = "/Misc/guestbook/index.php?offset="+pageno;
			processRequest(myRequest, 'DMID7');
		}
		function clearMenuStyles()
		{
			$('DMID2').style.color = "#FFFFFF";
			$('DMID3').style.color = "#FFFFFF";
			$('DMID4').style.color = "#FFFFFF";
			$('DMID5').style.color = "#FFFFFF";
			$('DMID6').style.color = "#FFFFFF";
			$('DMID7').style.color = "#FFFFFF";
			$('DMID8').style.color = "#FFFFFF";
		}
		function ProcessEmail()
		{
			var anyerror = false;
			var error = false;
			error = CheckEmpty($F('YourName'),'YourNameError');
			if(error) anyerror = true;
			error = Emailverify($F('YourEmail'),'YourEmailError');
			if(error) anyerror = true;
			error = CheckEmpty($F('PersonalNote'),'PersonalNoteError');
			if(error) anyerror = true;
			if(anyerror)
			{
				$('EmailError').style.visibility = "visible";
				return false;
			}
			else
			{
				$('EmailError').style.visibility = "hidden";
				return true;
			}
		}
		function ProcessGB()
		{
			var anyerror = false;
			var error = false;
			error = CheckEmpty($F('gbname'),'YourNameError');
			if(error) anyerror = true;
			error = Emailverify($F('gbemail'),'YourEmailError');
			if(error) anyerror = true;
			error = CheckEmpty($F('gbcomment'),'PersonalNoteError');
			if(error) anyerror = true;
			if(anyerror)
			{
				$('EmailError').style.visibility = "visible";
				return false;
			}
			else
			{
				$('EmailError').style.visibility = "hidden";
				return true;
			}
			
		}
		function Emailverify(inputvar,objval)
		{    
			var error=true;
			var pos,posdot,str,end;
			if (inputvar.indexOf("@")>=2)
			{    
				posdot=0;
				pos=0;
				str=inputvar;
				pos=str.indexOf(".");
				while(pos>0)
				{    
					posdot+=pos;
					posdot+=1;
					str=str.substring(pos+1,str.length);
					pos=str.indexOf(".");
				}
				end=str;
	      
				if(end!="")
					if(posdot>=4)
						if(end.length>=1)
							error=false;
			}
			if(error)
				$(objval).style.display = "inline";			
			else
				$(objval).style.display = "none";				
			return error;
		} 
		function CheckEmpty(text,objval)
		{	
			var error = false;
			if (text=='') { error=true; }
			if(error)
				$(objval).style.display = "inline";			
			else
				$(objval).style.display = "none";			
			return error;
		}
		function createCookie(name,value,days)
		{
			if (days) 
			{
				var date = new Date();
				date.setTime(date.getTime()+(days*24*60*60*1000));
				var expires = "; expires="+date.toGMTString();
			}
			else var expires = "";
			document.cookie = name+"="+value+expires+"; path=/";
		}
		function readCookie(name) 
		{
			var nameEQ = name + "=";
			var ca = document.cookie.split(';');
			for(var i=0;i < ca.length;i++)
			{
				var c = ca[i];
				while (c.charAt(0)==' ') c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
			}
			return null;
		}
		function eraseCookie(name) 
		{
			createCookie(name,"",-1);
		}
		function addslashes(str)
		{
			str=str.replace(/'/g,'\'');
			str=str.replace(/"/g,'\\\"');
			str=str.replace(/\\/g,'\\\\');
			str=str.replace(/\0/g,'\\0');
			return str;
		}
		function stripslashes(str) 
		{
			str=str.replace(/\\'/g,'\'');
			str=str.replace(/\\"/g,'"');
			str=str.replace(/\\\\/g,'\\');
			str=str.replace(/\\0/g,'\0');
			return str;
		}	
		function initialize(inputaddress, textonblob, divmap)
		{
			if (GBrowserIsCompatible()) 
			{
		        var map = new GMap2($(divmap));
				map.setCenter(new GLatLng(37.4419, -122.1419));
				map.setMapType(G_HYBRID_MAP);
		        map.addControl(new GLargeMapControl());
		        map.addControl(new GMapTypeControl());
		        geocoder = new GClientGeocoder();
		        geocoder.getLatLng(inputaddress,
					function(point) {
						map.setCenter(point, 16);
						var marker = new GMarker(point);
						GEvent.addListener(marker, "click",function(){
							marker.openInfoWindowHtml(textonblob);
						});
						map.addOverlay(marker);
						marker.openInfoWindowHtml(textonblob);
					}
		        );
			}
			$('progress').style.display = "none";
	    }
		function handleErrors()
		{
			if (directions.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
				alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + directions.getStatus().code);
			else if (directions.getStatus().code == G_GEO_SERVER_ERROR)
				alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + directions.getStatus().code);
			else if (directions.getStatus().code == G_GEO_MISSING_QUERY)
				alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + directions.getStatus().code);
			else if (directions.getStatus().code == G_GEO_BAD_KEY)
				alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + directions.getStatus().code);
			else if (directions.getStatus().code == G_GEO_BAD_REQUEST)
				alert("A directions request could not be successfully parsed.\n Error code: " + directions.getStatus().code);
			else alert("An unknown error occurred.");
		}
		function shine()
		{
			do_hideDashboard($fGet('lb_display'));
			$('mapinput').style.display = "block";
			$('mapoutput').style.display = "none";
			$('MapError').style.display = "none";
			$('directionmap').innerHTML = "";
			$('route').innerHTML = "";
			$('mapgetdir').style.visibility = "visible";
			return false;
		}	
		function processRequest(resource, menuid)
		{
			if(browser.ie)
			{
				clearMenuStyles();
				$(menuid).style.color = "#CD5C5C";
				new Ajax.Updater('mainDisp', resource);
			}
			else
			{
				var goofy = "";
				clearMenuStyles();
				$(menuid).style.color = "#CD5C5C";
				new Ajax.Updater('mainDisp', resource);
				goofy = Effect.SlideDown('mainDisp',{duration:1.0});				
			}
			if(resource == "/DataResource/ceremonyNreception.php")
			{
				setTimeout("initialize(address, msg, divid)",1500);
			}
		}	
		function doblackout() 
		{
			$fGet('blackout').style.display = 'block';
			$fGet('DestAddress').value = address;
			setLBWindownew($fGet('lb_display'),681,132);
			do_showDashboard($fGet('lb_display'));

		}			
		function domap()
		{
			$('mapgetdir').style.visibility = "hidden";
			var startfrom = $('StartAddress').value;
			startfrom = startfrom.toString();
			if((startfrom != "") && (startfrom.length >0))
			{
				setLBWindownew($fGet('lb_display'),850,800);
				$('mapinput').style.display = "none";
				$('mapoutput').style.display = "block";
				var todestination = $('StartAddress').value +" to "+$('DestAddress').value;
				setTimeout("getDirections(\""+todestination+"\")",1500);
			}
			else
			{
				$('MapError').style.display = "inline";
			}
		}
		function getDirections(todestination) 
		{
			widgetmap = new GMap2(document.getElementById("directionmap"));
			//widgetmap.setCenter(new GLatLng(42.351505,-71.094455), 10);
			widgetmap.setCenter(new GLatLng(37.548,-121.987), 10);
			widgetmap.setMapType(G_HYBRID_MAP);
			widgetmap.addControl(new GLargeMapControl());
			widgetmap.addControl(new GMapTypeControl());
			directionsPanel = document.getElementById("route");
			directions = new GDirections(widgetmap, directionsPanel);
			GEvent.addListener(directions, "load", onGDirectionsLoad);
			GEvent.addListener(directions, "error", handleErrors);
			directions.load(todestination);
	    }
		function onGDirectionsLoad(){
			var nubsteps = directions.getRoute(0).getNumSteps();
			if(nubsteps > 16)
			{
				$('directionmap').style.height = "700px";
				$('route').style.height = "700px";
				$('mapoutput').style.height = "740px";
			}
			else if (nubsteps >= 8)
			{
				$('directionmap').style.height = "550px";
				$('route').style.height = "550px";
				$('mapoutput').style.height = "590px";
			}
			else
			{
				$('directionmap').style.height = "400px";
				$('route').style.height = "400px";				
				$('mapoutput').style.height = "420px";
			}
			//$('mapgetdir').style.visibility = "hidden";
		}