// JavaScript Document
var app=navigator.appName
function inter()
{
	if(app=="Microsoft Internet Explorer"){return 'MSIE'}
	if(app=="Netscape"){return 'ff'}
	return 'Misc'
}
var appName=inter()
var appver
var b=navigator.userAgent;
if (/MSIE (\d+\.\d+);/.test(b)){ //test for MSIE x.x;
 var version=new Number(RegExp.$1) // capture x.x portion and store as a number
 appver=version
 
 }
if (/Firefox(\/\d+\.\d+)/.test(b)){ //test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
 var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number
 appver=ffversion
}
$(document).ready(function()
	{	
	var pix=new Array()
	var imgdata=new Array()
	var titledata=new Array()
	var cateArray=new Array()
	var vname=new Array()
	var hlink=new Array()
	var title=new Array()
	var descrip=new Array()
	var evtdate=new Array()
	var menuItem=new Array()
	var menuDes=new Array()
	var package=new Array()
	var itemhold=new Array()
	var package1=new Array()
	var weddingItem=new Array()
	var weddingDescrip=new Array()
	var itemhold2=new Array()
	var heightchange
	
	var checkpage
	var math
	var signal
	
	if(appName=='MSIE'){var evt=window.event} 
	var image=document.getElementById('slide')
	var request
/////////////////////////////////
	var imgvalue
	var titlevalue
//////////////////////////////////////
	var ven
	var wurl
//////////////////////////////////////
	var evttitle
	var evtdes
	var eventdate
/////////////////////////////////////
	var pack
	var menuitem
	var menudes
//////////////////////////////////////
	var pack1
 	var weddingitem
	var weddingdes
/////////////////////////////////////
	var url
	var root	
	var area		
	var type		
	var section
	var category
	var menu=['#home','#wedding','#menu','#about','#contact','#event','#vendor']
	var pic=['home','wedding','menu','about','contact','event','vendor']
	var start=0
	var end=5
	var button
	var on=0
/////////////////////////////////////////////////////////////////////////////AJAX APPLICATION,AJAX APPLICATION///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AJAX APPLICATION,AJAX APPLICATION///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AJAX APPLICATION,AJAX APPLICATION/////////////////////////////////////////////////////////////////////////////////////////
	
	 function loadXML()
    {
	if(appName=='MSIE'){request=new ActiveXObject("Microsoft.XMLDOM")};
	if(appName=='ff'){request=new XMLHttpRequest()};
	request.async="false";
	request.onreadystatechange = readXML
	if(appName=='MSIE'){request.load(url)};
	if(appName=='ff')
		{
		request.open("GET",url,true)
		request.send(null)
		}
	}
	function readXML()
	{	
       if(request.readyState ===4)
		 {	var rootnode
		 	if(appName=="MSIE"){rootnode=request.getElementsByTagName(root)[0]}
			if(appName=="ff"){rootnode=request.responseXML.getElementsByTagName(root)[0];
			for (i=0;i<rootnode.childNodes.length;i++) 
				{
				if (rootnode.childNodes[i].nodeType == 3) {
					rootnode.removeChild(rootnode.childNodes[i]);
					}
				}
			}
			for(var recordNode=0;recordNode<rootnode.childNodes.length;recordNode++)
			{
			 var record=rootnode.childNodes.item(recordNode)
			 if(root=='content')
			 {
			 	for (var i=0; i < record.childNodes.length; i++)
				{var pull = (appName=="MSIE") ? 0 : 1
					if(i==0){imgvalue=record.childNodes[i+pull].firstChild.data}
					if(i==1){if(appName=='ff'){pull=2};titlevalue=record.childNodes[i+pull].firstChild.data}
				}
			 }
			 if(root=='vendor')
			  {
			 	for (var i=0; i < record.childNodes.length; i++)
				{var pull = (appName=="MSIE") ? 1 : 3
					if(i==0){ven=record.childNodes[i+pull].firstChild.data}
					if(i==1){if(appName=='ff'){pull=4};wurl=record.childNodes[i+pull].firstChild.data}
				}
			 }
			 if(root=='event')
			 {
			 	for (var i=0; i < record.childNodes.length; i++)
				{var pull = (appName=="MSIE") ? 0 : 1
					if(i==0){evttitle=record.childNodes[i+pull].firstChild.data}
					if(i==1){if(appName=='ff'){pull=2};evtdes=record.childNodes[i+pull].firstChild.data}
					if(i==2){if(appName=='ff'){pull=3};eventdate=record.childNodes[i+pull].firstChild.data}
				}
			 }
			  if(root=='menu')
			 {
			 	for (var i=0; i < record.childNodes.length; i++)
				{var pull = (appName=="MSIE") ? 0 : 1
					if(i==0){pack=record.childNodes[i+pull].firstChild.data}
					if(i==1){if(appName=='ff'){pull=2};menuitem=record.childNodes[i+pull].firstChild.data}
					if(i==2){if(appName=='ff'){pull=3};menudes=record.childNodes[i+pull].firstChild.data}
				}
			 }
			 if(root=='wedding')
			 {
			 	for (var i=0; i < record.childNodes.length; i++)
				{var pull = (appName=="MSIE") ? 0 : 1
					if(i==0){pack1=record.childNodes[i+pull].firstChild.data}
					if(i==1){if(appName=='ff'){pull=2};weddingitem=record.childNodes[i+pull].firstChild.data}
					if(i==2){if(appName=='ff'){pull=3};weddingdes=record.childNodes[i+pull].firstChild.data}
				}
			 }
			if(root=='menu'){package.push(pack);menuItem.push(menuitem);menuDes.push(menudes);}
			if(root=='wedding'){package1.push(pack1);weddingItem.push(weddingitem);weddingDescrip.push(weddingdes);}
			if(root=='event'){title.push(evttitle);descrip.push(evtdes);evtdate.push(eventdate);}
			if(root=='vendor'){vname.push(ven);hlink.push(wurl)}
			if(root=='content')
				{		
					var left
					var top
				if(appName=='MSIE'&& appver<8 && recordNode==0){left=-560;top=50}
				if(appName=='MSIE'&& appver>=8 && recordNode==0){left=100;top=50}
				if(recordNode==0&&appName=='ff'){left=100;top=-75}
				if(recordNode>0){left=left+100}
				var img=document.createElement('div')
				img.style.width='80px'
				img.style.height='80px'
				img.style.borderWidth='5px'
				img.style.borderColor='#000000'
				img.style.borderStyle='double'
				img.style.display='none'
				img.setAttribute('id','p'+imgvalue)
				img.setAttribute('name',recordNode)
				var id=img.id
				pix.push(id)
				imgdata.push(imgvalue)
				titledata.push(titlevalue)
				img.style.position='absolute'
				img.style.marginLeft=left+'px'
				img.style.marginTop=top+'px'
				//alert(imgdata)
				img.innerHTML="<a href=./WebImages/"+imgvalue+".jpg><img onmousemove='imghover(event)'src=./WebImages/"+imgvalue+".jpg border='0px' width='80px' height='80px'></img></a>"
				image.appendChild(img)
				}
			}
		 if(root=='vendor'){doit()}
		 if(root=='event'){create()}
		 if(root=='menu'){setTimeout(function(){menu()},100)}
		 if(root=='wedding'){setTimeout(function(){wmenu()},100)}
		 }
	}
/////////////////////////////////////////////////////////////////////////////AJAX APPLICATION,AJAX APPLICATION///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AJAX APPLICATION,AJAX APPLICATION///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AJAX APPLICATION,AJAX APPLICATION/////////////////////////////////////////////////////////////////////////////////////////
	if(appName=='ff'){$('#tbar').css('marginLeft','4px')}
	if(appName=='MSIE' && appver>=8){$('#tbar').css('marginLeft','4px')}
	for(var x=0;x<menu.length;x++)
		{	var left
			if(x==0)
			{
				left=25;
				$(menu[x]).css({'backgroundImage':'url("WebImages/button.png")','position':'relative','zIndex':'3','top':'10px'});
				$('#home > div[class=item]').css('backgroundImage','url(WebImages/'+pic[0]+'1.png)')
				section='home'
			}
			var top=-75
			if(x>0){left=left+81}
			if(x>0)
			{
				$(menu[x]).css({'marginLeft':left,'marginTop':top})	
				$(menu[x]+'> div[class=item]').css('backgroundImage','url(WebImages/'+pic[x]+'.png)')
			}
		}

rollover=function()	
	{
		category=this.id
		area=this.name
		if(appName=='ff'){if(category=='home'){area=0};if(category=='wedding'){area=1};
		if(category=='menu'){area=2};if(category=='about'){area=3};
		if(category=='contact'){area=4};if(category=='event'){area=5};
		if(category=='vendor'){area=6}}
		if(section!=category)
		{
			$('#'+category+'').css({'backgroundImage':'url("WebImages/button.png")','textDecoration':'underline','position':'relative','zIndex':'3','top':'10px'})
			$('#'+category+' > div[class=item]').css('backgroundImage','url(WebImages/'+pic[area]+'1.png)')
		}
		
		check()
	}
	
var option=0
Click=function()
	{	
	
		var area1
		if(section=='home'){area1=0};if(section=='wedding'){area1=1};
		if(section=='menu'){area1=2};if(section=='about'){area1=3};
		if(section=='contact'){area1=4};if(section=='event'){area1=5};
		if(section=='vendor'){area1=6}
		$('#'+section+'').css({'backgroundImage':'url("WebImages/noactive.png")','position':'relative','zIndex':'1','top':'0px'})
		$('#'+section+'> div[class=item]').css('backgroundImage','url(WebImages/'+pic[area1]+'.png)')
		section=this.id
		check()
		choose(section)
	}

	
	
rollout=function()
	{
		if(section!=category)
		{
			$('#'+category+'').css({'backgroundImage':'url("WebImages/noactive.png")','position':'relative','zIndex':'1','top':'0px'})
			$('#'+category+'> div[class=item]').css('backgroundImage','url(WebImages/'+pic[area]+'.png)')
		}
	} 
	
	
check=function()
{
		if(section==category){$('div[class=button1]').unbind('click',Click);}
		if(section=='wedding'&&signal=='on'){$('div[class=button1]').unbind('click',Click);}
		else if(section=='menu'&&signal=='on'){$('div[class=button1]').unbind('click',Click);}
		else{$('div[class=button1]').bind('click',Click)}
		
}
/////////////////////////////////////////////////////////////////////////////title bar//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////image application////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
srollover=function()
{
	if(section=='menu'){$('#slidebutton').css({'backgroundImage':'url("WebImages/slidebutton1.png")','marginTop':math+'px'})}
	else if(section=='wedding'){$('#slidebutton').css({'backgroundImage':'url("WebImages/slidebutton1.png")','marginTop':math+'px'})}
	else{$('#slidebutton').css({'backgroundImage':'url("WebImages/slidebutton1.png")','marginTop':'60px'})}
	
}

var id=['forward','backward']

var clickCount=0
sClick=function()
{
if(this.id=='slidebutton')
		{	clickCount=clickCount+1
			url='./scripts/data.php'
			root='content'
			if(imgdata==0){loadXML()}
		$('#slidebutton').hide()
		for (var x=0;x<id.length;x++)
		{
		var div=document.createElement('div')
		div.setAttribute('id',id[x])
		div.style.display='none'
		image.appendChild(div)
		if(appName=='MSIE'&&appver<8){$('#backward').css('marginTop','-77px')}
		div.style.backgroundPosition='0px 120px'
		div.style.backgroundRepeat='no-repeat'
		$('#'+id[x]+'').show().animate({backgroundPosition:'(0px 0px)'},1000)
		}
		
		$('#slide').show().animate({backgroundPosition:'(0px 0px)'},1000,function now(){setup()})
		}
	for(var xx=0;xx<id.length;xx++)
		{	
			//alert(id[xx])
			$('#'+id[xx]+'').bind('click',counter)
			$('#'+id[xx]+'').bind('mouseover',change)
			$('#'+id[xx]+'').bind('mouseout',buttonout)
			
		}
if(this.id=='slide')
	{	
		for(var x=0;x<pix.length;x++)
		{
		if(x!=end-1){$('#'+pix[x]+'').slideUp(500)}
		if(x==end-1){$('#'+pix[x]+'').slideUp(500,function()
									{
									$('#slide').show().animate({backgroundPosition:'(0px 120px)'},1000,function move1(){$('#slide').hide();$('#slidebutton').show()})
									
									for(var x=0;x<id.length;x++)
											{
											$('#'+id[x]+'').css('backgroundRepeat','no-repeat')
											$('#'+id[x]+'').show().animate({backgroundPosition:'(0px 120px)'},1000,function Delete(){image.removeChild(this)})
											}
									})}
		}
	
	}
}
				function change()
					{
						var bimg
						if(this.id=='backward'){if(start!=0){bimg='backward1'}else{bimg='backward'}}
						if(this.id=='forward'){if(end!=pix.length){bimg='forward1'}else{bimg='forward'}}
						$(this).css("backgroundImage","url(WebImages/"+bimg+".png)")
					}
				function counter()
					{
						if(this.id=='forward' && end<pix.length){start=start+1;end=end+1;var moveleft=end}
						if(this.id=='backward'&& end>5){start=start-1;end=end-1;var moveright=start}
						$('#slide').unbind('click',sClick)

	
							if(this.id=='forward')
								{
									for(var x=moveleft;x>=start;x--)
									{
									var remove=document.getElementById(pix[x-2])
									remove.setAttribute('id',pix[x-1])
									remove.setAttribute('name',x-1)
									if(x==end){var move=pix[x-1];remove.style.display="none"}
									if(move==pix[x-1]){$('#'+move+'').slideDown(500)}
									remove.innerHTML="<a href=./WebImages/"+imgdata[x-1]+".jpg><img onmousemove='imghover(event)' src=./WebImages/"+imgdata[x-1]+".jpg width='80px' border='0px' height='80px'></img></a>"
									}
								}
								if(this.id=='backward')
								{
									for(var x=moveright;x<=end;x++)
									{
									var remove=document.getElementById(pix[x+1])
									remove.setAttribute('id',pix[x])
									remove.setAttribute('name',x)
									if(x==start){var move=pix[x];remove.style.display="none"}
									if(move==pix[x]){$('#'+move+'').slideDown(500)}
									remove.innerHTML="<a href=./WebImages/"+imgdata[x]+".jpg><img onmousemove='imghover(event)' src=./WebImages/"+imgdata[x]+".jpg width='80px' border='0px' height='80px'></img></a>"
									}
								}
					}

					function setup()
					{	
						for(var x=start;x<end;x++)
								{	
									$('#'+pix[x]+'').slideDown(500)
									if(appName=='ff'&&clickCount!=1){$('#'+pix[x]+'').css('marginTop','50px')}
									if(appName=='MSIE'&& appver>=8 && clickCount!=1){$('#'+pix[x]+'').css('marginTop','50px')}
									$('#'+pix[x]+'').bind('mouseover',imgcheck)
									$('#'+pix[x]+'').bind('mouseout',imgout)
								}
					}
					var num
					imgcheck=function()
					{
						if(appName=='ff')
							{
								var findName=this.id
								num=pix.indexOf(findName)
							}
							if(appName=='MSIE'){num=this.name}
							$(this).css('borderColor','#f0d432')
							$('#slide').unbind('click',sClick)
					}
					imghover=function(evt)
					{	
						var imgmenu=document.getElementById('slide')
						var height
						var Mousex=evt.clientX+10
						var Mousey=imgmenu.offsetTop
						Mousey=Mousey-225
					$('#preview').css({'left':Mousex+'px','top':Mousey+'px','visibility':'visible'})
					$('#title').html(titledata[num])
					var image=new Image()
					image.src='WebImages/'+imgdata[num]+'.jpg'
					var Pre,Pre1,dimension
					if(image.width>image.height)
					{
						Pre=image.width*.3;
						dimension="width"
						$('#imgpreview').css('marginTop',Pre*.13+'px')
						$('#text').css('marginTop',Pre*.01+'px')
					}
					if(image.height>image.width)
					{
						Pre=image.height*.2;
						Pre1=image.width*.2;
						dimension="height"
						$('#text').css('marginTop',Pre*.13+'px')
						$('#imgpreview').css('marginTop','0px')
					}
					var cssWidth=(Pre1>0)?Pre1:Pre
					//alert(cssWidth)
					$('#imgpreview').css('width',cssWidth)
					$('#imgpreview').html("<img src=WebImages/"+imgdata[num]+".jpg "+dimension+"="+Pre+"></img>")
					$('#slide').unbind('click',sClick)
					var overheight
					if(section=='wedding')
						{
							overheight=heightchange
						}
					else {overheight=0}
						var lbOptions={
									txtImage:'GOV The Grand Oak Villa... '+titledata[num],
									imageBtnClose:'lightbox/images/close.gif',
									imageLoading:'lightbox/images/lightbox-ico-loading.gif'
									}
					$('#'+pix[num]+' a').lightBox(lbOptions)
					}
					
					imgout=function()
					{
						$(this).css('borderColor','#000000')
						$('#slide').bind('click',sClick)
						$('#preview').css('visibility','hidden')
					}
					function buttonout()
					{
						$('#slide').bind('click',sClick)
						var bimg
						if(this.id=='backward'){bimg='backward'}
						if(this.id=='forward'){bimg='forward'}
						$(this).css("backgroundImage","url(WebImages/"+bimg+".png)")
					}

srollout=function()
{
	if(section=='menu'){$('#slidebutton').css({'backgroundImage':'url("WebImages/slidebutton.png")','marginTop':math+'px'})}
	else if(section=='wedding'){$('#slidebutton').css({'backgroundImage':'url("WebImages/slidebutton.png")','marginTop':math+'px'})}
	else{$('#slidebutton').css({'backgroundImage':'url("WebImages/slidebutton.png")','marginTop':'59px'})}
	
}
//////////////////////////////////////////////////////////////////////////image application///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////clear fields for subcontainer////////////////////////////////////////////////////////////////
		
choose=function(page)
{	
var main=document.getElementById('container')
	var submain=document.getElementById('submain')
	if (submain.hasChildNodes())
			{
				while( submain.childNodes.length >= 1 ){submain.removeChild( submain.firstChild );} 
			}
//////////////////////////////////////////////////////////////////////////clear fields for subcontainer////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////home page///////////////////////////////////////////////////////////////////////////////////////////////
	if(page=="home"){if(on==1){remove(page)};if(on==2){remove2(page)};if(on==0){main.style.backgroundImage='url(WebImages/bg.png)'};submain.style.backgroundImage='url()'}
///////////////////////////////////////////////////////////////home page/////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////contact page///////////////////////////////////////////////////////////////////////////////////////////////	
	if(page=="contact")
		{	
			if(on==1){remove(page)}
			if(on==2){remove2(page)}
				main.style.backgroundImage="url()"
			if(on==0){main.style.backgroundImage='url(WebImages/info.png)'
			var label=['name','email','typevent','phone','fax','comments','submit']
			var option
			var fields=new Array()
			var form
			function set(field)
				{		field.style.backgroundColor='#000000'
						field.style.color='#ffffff'
						field.style.fontFamily="Times New Roman,Georgia"
						field.style.fontSize="16px"
						field.style.fontWeight="bold"
						field.style.paddingLeft='5px'
				}
			var forms=document.createElement('form')
			for(var x=0;x<2;x++)
			{
				var formContainer=document.createElement('div')
				var left,width
				if(x==0){left=20;width=200}
				if(x==1){left=240;width=345}
				formContainer.style.position='absolute'
				formContainer.style.width=width+'px'
				formContainer.style.height='450px'
				formContainer.style.marginTop='20px'
				formContainer.style.marginLeft=left+'px'
				//formContainer.style.backgroundColor='#ff0000'
				if(x==0)
				{
					for(var xx=0;xx<label.length;xx++)
					{	
						var fieldContainer=document.createElement('div')
						fieldContainer.style.width='150px'
						fieldContainer.style.height='30px'
						fieldContainer.style.marginTop='10px'
						if(xx==6&&appName=='MSIE'){fieldContainer.style.marginTop='180px'}
						if(xx==6&&appName=='ff'){fieldContainer.style.marginTop='205px'}
						fieldContainer.style.marginLeft='20px'
						fieldContainer.style.backgroundImage='url(WebImages/'+label[xx]+'.png)'
						formContainer.appendChild(fieldContainer)
					}
				}
				if(x==1)
				{	
					
					 form=document.createElement('form')
						form.setAttribute('id','contact')
						form.setAttribute('name','contact')
						form.setAttribute('method','post');
					for(var xy=0;xy<label.length;xy++)
					{	
						var fieldContainer=document.createElement('div')
						var element,type,val,type1,val1,type2,val2,type3,val3
						fieldContainer.style.width='250px'
						fieldContainer.style.height='30px'
						fieldContainer.style.marginTop='10px'
						if(xy==6&&appName=='MSIE'){fieldContainer.style.marginTop='180px'}
						if(xy==6&&appName=='ff'){fieldContainer.style.marginTop='205px'}
						fieldContainer.style.marginLeft='20px'
						//fieldContainer.style.backgroundColor='#0000FF'
						fieldContainer.style.marginLeft='auto'
						fieldContainer.style.marginRight='auto'
						if(xy==1||xy==0||xy==3||xy==4){element='input';type='type',val='text';type1='size';if(appName=='ff'){val1='27'}else{val1='25'};type2='id';val2='field'+[xy];type3='name';val3='change'+[xy]}
						if(xy==2){element='select';type='rows';val='10';type1='rows';val1='10';type2='id';val2='field'+[xy];type3='name';val3='change'+[xy]}
						if(xy==5){element='textarea';type='cols';if(appName=='MSIE'){val='33'}else{val='28'};type1='rows';val1='10';type2='id';val2='field'+[xy];type3='name';val3='change'+[xy]}
						if(xy==6){element='input';type='type';val='Submit';type3='name';val3='button'}
						var field=document.createElement(element)
						field.setAttribute(type,val)
						if(type1!=null&&val1!=null){field.setAttribute(type1,val1)}
						if(type2!=null&&val2!=null){field.setAttribute(type2,val2)}
						if(type3!=null&&val3!=null){field.setAttribute(type3,val3)}
						if(xy==6){field.value='Send To Email'}
						fieldContainer.appendChild(field)
						if(xy<=5){set(field)}
						if(xy<=4){field.style.marginLeft='10px'}
						if(xy==6&&appName=='MSIE'){field.style.marginLeft='60px'}
						if(xy==6&&appName=='ff'){field.style.marginLeft='70px'}
						if(xy==2)
						{ var ocassion=['Please Choose','Wedding','Private Party','Corporate Holiday Party','Testimonial','Bridal Shower','Offsite Catering','Other']
							if(appName=='MSIE'){field.style.marginLeft='25px'}else{field.style.marginLeft='30px'}
							for(var x=0;x<ocassion.length;x++)
							{	option='option'
								var selects=document.createElement(option)
								selects.setAttribute('name','change')
								selects.value=ocassion[x]
								selects.appendChild(document.createTextNode(ocassion[x]))
								field.appendChild(selects)
							}
						}
						fields.push(element)+1
						if(xy==2){fields.push(option)}
						form.appendChild(fieldContainer)
						formContainer.appendChild(form)
					}
				}
			forms.appendChild(formContainer)
			}
			submain.appendChild(forms)
			for(var x=0;x<fields.length;x++)
			{
			$(''+fields[x]+'[name*=change]').blur(function(){if(this.value!=""){$(this).animate({backgroundColor:'#714804'},500)}})
			$(''+fields[x]+'[name*=change]').focus(function(){set(this)})
			}
			$(''+fields[7]+'[name=button]').click(function(){validate()})
			function validate()
					{
					var RE_EMAIL = /^(\w+[\-\.])*\w+@(\w+\.)+[A-Za-z]+$/;
					var RE_PHONE=/^(1\s*[-\/\.]?)?(\((\d{3})\)|(\d{3}))\s*[-\/\.]?\s*(\d{3})\s*[-\/\.]?\s*(\d{4})\s*(([xX]|[eE][xX][tT])\.?\s*(\d+))*$/
					var errors = [];
					var email = form.field1.value;
					var phone=form.field3.value;
						if (!RE_PHONE.test(phone)) {errors[errors.length] = "You must enter a valid phone number.";form.onsubmit=function(){return false}}
						if (!RE_EMAIL.test(email)) {errors[errors.length] = "You must enter a valid email address.";form.onsubmit=function(){return false}}
						if(RE_PHONE.test(phone)&&RE_EMAIL.test(email)){form.action='sendmail.php';form.onsubmit=function(){return true}}
						if (errors.length > 0){reportErrors(errors);}
					}
		function reportErrors(errors)
			{
			var msg = "There were some problems...\n";
 			for (var i = 0; i<errors.length; i++) 
				{
  				var numError = i + 1;
  				msg += "\n" + numError + ". " + errors[i];
 				}
 			alert(msg);
			}
		}
	}
///////////////////////////////////////////////////////contactpage////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////vendorPage////////////////////////////////////////////////////////////////////////////////////
if(page=="vendor")
	{	
		if(on==1){remove(page)}
		if(on==2){remove2(page)}
		main.style.backgroundImage="url()"
		if(on==0){main.style.backgroundImage='url(WebImages/vend.png)'
		var holder=document.createElement('div')
		holder.style.width='400px'
		holder.style.height='50px'
		holder.style.backgroundImage='url(WebImages/category.png)'
		holder.style.marginLeft='auto'
		holder.style.marginRight='auto'
		var type=document.createElement('select')
		type.setAttribute('id','cate')
		type.style.marginLeft='228px'
		type.style.marginTop='10px'
		type.style.backgroundColor='#000000'
		type.style.color='#ffffff'
		type.style.fontFamily="Times New Roman,Georgia"
		type.style.fontSize="16px"
		type.style.fontWeight="bold"
		type.style.paddingLeft='5px'
		var vendors=['Please Choose','Entertainment','Florist','Wardrobe','Pastries','Photography','Miscellaneous']
		for(var x=0;x<vendors.length;x++)
		{
			var opt=document.createElement('option')
			opt.value=vendors[x]
			opt.appendChild(document.createTextNode(vendors[x]))
			type.appendChild(opt)
		}
		submain.appendChild(holder)
		submain.appendChild(type)
		
			$('#cate').change(function val()
				{
				if(vname!=0){
					vname.splice(0,vname.length)
					hlink.splice(0,hlink.length)
						for(var x=submain.childNodes.length-1;x>1;x--)
							{
							submain.removeChild(submain.lastChild)
							}
						}
				url='./scripts/vendata.php?cate='+this.value
				root='vendor'
				doit=function()
				{
						for(var x=0;x<hlink.length;x++)
						{	
							var linksrc=document.createElement('a')
							linksrc.setAttribute('href','http://'+hlink[x])
							linksrc.setAttribute('target','_blank')
							var linkDiv=document.createElement('div')
							linkDiv.style.width='300px'
							linkDiv.style.height='30px'
							linkDiv.style.marginLeft='auto'
							linkDiv.style.marginRight='auto'
							linkDiv.style.textDecoration='none'
							linkDiv.style.borderColor="#f0d432"
							linkDiv.style.borderStyle="double"
							linkDiv.style.backgroundImage="url(WebImages/conbg.png)"
							linkDiv.style.padding="5px"
							if(x==0){linkDiv.style.marginTop='20px'}
							linkDiv.style.textAlign='center'
							linkDiv.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
							linkDiv.style.fontSize='18px'
							linkDiv.style.color='#f0d432'
							linkDiv.style.cursor='defualt'
							linkDiv.setAttribute('id','links'+x)
							var linkId=linkDiv.id
							linkDiv.innerHTML=vname[x]
							linksrc.appendChild(linkDiv)
							submain.appendChild(linksrc)
							$('#'+linkId+'').bind('mouseover',linking)
							$('#'+linkId+'').bind('mouseout',linkgone)
						}
				}
				loadXML()	//submain.appendChild(mainholder)
				})
linking=function()
		{
			this.style.color="#ffffff"
			this.style.textDecoration="underline"
		}
linkgone=function()
		{
			this.style.color="#f0d432"
			this.style.textDecoration="none"
			this.style.cursor='default'
		}
	}
}
////////////////////////////////////////////////////////vendorPage////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////aboutPage////////////////////////////////////////////////////////////////////////////////////
if(page=="about")
		{	
			if(on==1){remove(page)}
			if(on==2){remove2(page)}
			main.style.backgroundImage="url()"
			if(on==0){main.style.backgroundImage='url(WebImages/abot.png)'
			var emp=document.createElement('div')
			emp.setAttribute('id','employee')
			emp.style.width="300px"
			emp.style.height="200px"
			//emp.style.backgroundColor="#0000ff"
			emp.style.backgroundImage='url(WebImages/emp.png)'
			emp.style.marginLeft="auto"
			emp.style.marginRight="auto"
			emp.style.marginTop="20px"
			//emp.style.borderStyle='double'
			//emp.style.borderColor='#f0d432'
			var detail=document.createElement('div')
			detail.setAttribute('id','us')
			detail.style.width="500px"
			detail.style.height="200px"
			detail.style.marginLeft="auto"
			detail.style.marginTop="20px"
			detail.style.marginRight="auto"
			detail.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
			detail.style.fontSize='14px'
			detail.style.borderStyle='double'
			detail.style.borderColor='#f0d432'
			detail.style.padding="10px"
			detail.style.backgroundImage='url(WebImages/conbg.png)'
			detail.style.color='#f0d432'
			detail.style.fontWeight='400'
			detail.style.textAlign='justify'
			detail.innerHTML='The Grand Oak Villa is run by Distasi Catering L.L.C which was established in 2003 by Michael and Libero DiStasi. Collectively we have over 25 years of restaurant and catering experience. Customer service and satisfaction is of utmost importance to us at DiStasi Catering. It is our goal to provide every client with the highest in quality cuisine, presentation and service that every one deserves. Our service begins with attention to detail. Listening to a clients menu ideas or how a bride would like there room set up for that special day to checking the freshness of product that is purchased. Our well trained staff continues in delivering personal attention to every need. Inspecting each finished dish as it is leaving our kitchen to serve your guest; our reputation is focusing on gaining your guest every expectation. Contact our office to schedule a consultation so we could help personalize your special event for a memorable celebration. '
			submain.appendChild(emp)
			submain.appendChild(detail)
			}
		}
////////////////////////////////////////////////////////aboutPage////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////eventPage////////////////////////////////////////////////////////////////////////////////////
if(page=="event")
	{	url='./scripts/eventdata.php'
		root='event'
		if(on==1){remove(page)}
		if(on==2){remove2(page)}
		if(on==0)
		{
		create=function()
		{
			main.style.backgroundImage="url()"
			main.style.backgroundImage='url(WebImages/eventbg.png)'
			var holder=document.createElement('div')
			holder.style.width='400px'
			holder.style.height='50px'
			holder.style.backgroundImage='url(WebImages/typeevt.png)'
			holder.style.marginLeft='auto'
			holder.style.marginRight='auto'
			var type=document.createElement('select')
			type.setAttribute('id','evt')
			type.style.marginLeft='200px'
			type.style.backgroundColor='#000000'
			type.style.color='#ffffff'
			type.style.fontFamily="Times New Roman,Georgia"
			type.style.fontSize="16px"
			type.style.fontWeight="bold"
			type.style.paddingLeft='2px'
			var opts=document.createElement('option')
			opts.appendChild(document.createTextNode('Please Choose'))
			opts.value='choose'
			type.appendChild(opts)
			for(var x=0;x<title.length;x++)
			{
				var opt=document.createElement('option')
				opt.value=x
				opt.appendChild(document.createTextNode(title[x]))
				type.appendChild(opt)
			}
			submain.appendChild(holder)
			submain.appendChild(type)
			
			$('#evt').change(function Event()
				{
				for(var x=submain.childNodes.length-1;x>1;x--)
							{
							submain.removeChild(submain.lastChild)
							}
				if(this.value!='choose')
				{	var evtheader=document.createElement('div')
						evtheader.setAttribute('id','events')
						evtheader.style.borderStyle='double'
						evtheader.style.borderColor='#f0d432'
						evtheader.style.backgroundImage='url(WebImages/conbg.png)'
						evtheader.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
						evtheader.style.fontSize='20px'
						evtheader.style.color='#f0d432'
						evtheader.style.fontWeight='400'
						evtheader.style.textAlign='center'
						evtheader.style.marginTop='20px'
						evtheader.style.padding='10px'
						evtheader.innerHTML=title[this.value].toUpperCase()
						
					var des=document.createElement('div')
						des.setAttribute('id','des')
						des.style.borderStyle='double'
						des.style.borderColor='#f0d432'
						des.style.backgroundImage='url(WebImages/conbg.png)'
						des.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
						des.style.fontSize='14px'
						des.style.color='#f0d432'
						des.style.fontWeight='400'
						des.style.textAlign='justify'
						des.style.marginTop='15px'
						des.style.padding='10px'
						des.innerHTML=descrip[this.value]
						
					var evt=document.createElement('div')
						evt.setAttribute('id','eventdate')
						evt.style.borderStyle='double'
						evt.style.borderColor='#f0d432'
						evt.style.backgroundImage='url(WebImages/conbg.png)'
						evt.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
						evt.style.fontSize='20px'
						evt.style.color='#f0d432'
						evt.style.fontWeight='400'
						evt.style.textAlign='center'
						evt.style.marginTop='20px'
						evt.style.padding='10px'
						evt.innerHTML='The Date Of The Event Is: '+evtdate[this.value]
						
						submain.appendChild(evtheader)
						submain.appendChild(des)
						submain.appendChild(evt)
					}
				})
		}
		if(title.length==0){loadXML()}
		else{create()}	
		}
	}
///////////////////////////////////////////////////////eventPage////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////menuPage//////////////////////////////////////////////////////////////////////////////////////
var clicks
var hcheck
if(page=='menu')
	{  signal='on'
		url='./scripts/menudata.php'
		root='menu'
		$('#frame').css('visibility','hidden')
		$('#slide').css('visibility','hidden')
		$('#gbar').css('marginTop','-600px');
		$('#slidebutton').css('visibility','hidden');
		$('#slide').css('visibility','hidden');
		$('#container').css('background-image','url()');
		if(menuItem.length==0&&on==0){loadXML();clicks=0}
		if(on==2){remove2(page)}
		if(menuItem.length!=0&&on!=2){setTimeout(function(){menu()},100)}
		menu=function()
			{$('#menuapp').css('backgroundImage','url(WebImages/menubar1.png)')
			if(appName=='ff')
			{
				$('#menuapp').css('marginLeft','-39px')
				$('#tbar').css('marginLeft','6px')
			}
			if(appName=='MSIE' && appver>=8)
			{
				$('#menuapp').css('marginLeft','-41px')	
			}
			if(appName=='MSIE'&& appver<8)
			{
				$('#tbar').css('marginLeft','4px')
			}
			$('#menuapp').show().animate({backgroundPosition:'(0px 0px)'},1000,function()
																						{
																						if(clicks==0)
																						{
																						for(var x=0;x<package.length;x++)
																							{	var count
																							if(package[x]!=package[x+1])
																								{	var left
																									if(package[x]=='Additional Enhancements'){left=100;count=0}
																									else{left=15}
																									
																									if(count<=3)
																									{
																											var items=document.createElement('div')
																											items.setAttribute('id','item'+count)
																											items.style.position='relative'
																											items.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
																											items.style.color='#000'
																											items.style.fontSize='12px'
																											items.style.fontWeight='500'
																											if(appName=='MSIE'){items.style.marginTop='69px';items.style.styleFloat='left'}
																											if(appName=='ff'){items.style.marginTop='70px';items.style.cssFloat='left'}
																											
																											items.style.marginLeft=left+'px'
																											items.style.cursor='default'
																											items.style.zIndex='3'
																											items.innerHTML=package[x]
																											itemhold.push(items.id)
																											document.getElementById('menuapp').appendChild(items)
																									}
																									if(count>3)
																									{	
																										var left2
																										if(package[x]=='Grand Dinner Buffet'){left2=100}
																										else{left2=15}
																											var items2=document.createElement('div')
																											items2.setAttribute('id','item'+count)
																											items2.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
																											items2.style.color='#000'
																											items2.style.position='relative'
																											items2.style.fontSize='12px'
																											items2.style.fontWeight='500'
																											if(appName=='MSIE'){items2.style.marginTop='17px';items2.style.styleFloat='left'}
																											if(appName=='ff'){items2.style.marginTop='17px';items2.style.cssFloat='left'}
																											items2.style.marginLeft=left2+'px'
																											items2.style.cursor='default'
																											items2.style.zIndex='3'
																											items2.innerHTML=package[x]
																											itemhold.push(items2.id)
																											document.getElementById('menuapp').appendChild(items2)
																									}
																									$('#item'+count).bind('mouseover',menuHover)
																									$('#item'+count).bind('mouseout',menuOut)
																									$('#item'+count).bind('click',menuClick)
																									count++
																								}
																							}
																						//document.getElementById('menuapp').appendChild(hmenu)
																						}
																						else{
																							$('#hmenu').css('visibility','visible');
																							for(var x=0;x<itemhold.length;x++)
																								{
																									$('#'+itemhold[x]+'').show()
																								}
																							}
																						clicks++
																						setTimeout(function(){signal='off'},1000)
																						})
			on=1
			menuHover=function()
				{
					var names=this.id
					var count=names.indexOf('m')+1
					var num=names.substr(count)
					$('#item'+num).css('textDecoration','underline')
				}
			menuOut=function()
				{
					var names=this.id
					var count=names.indexOf('m')+1
					var num=names.substr(count)
					$('#item'+num).css('textDecoration','none')
				}
				menuClick=function()
				{
					var names=this.id
					var count=names.indexOf('m')+1
					var num=names.substr(count)
					var findit=document.getElementById('item'+num).innerHTML
					var menuhold=document.getElementById('menuslide')
					if(menuhold.style.height!=""){hcheck=parseInt(menuhold.style.height)}
					else{hcheck=0}
					//alert(hcheck)
					if(appName=='MSIE'&&appver<8){$('#menuslide').css('marginLeft','-120px')}
					if(appName=='ff'){$('#menuslide').css('marginLeft','-90px')}
					if(appName=='MSIE'&&appver>=8){$('#menuslide').css('marginLeft','-90px')}
					//alert(findit+','+checkpage)
					if(hcheck>0&&findit!=checkpage)
					{
					$('#slidebutton').css('visibility','hidden');
					$('#slide').css('visibility','hidden')
					$('#menuslide').slideUp(1000,function(){$('#menuslide').show();$('#menuslide').css('visibility','hidden');down()})	
					}
					if(findit!=checkpage&&hcheck==0 )
					{
						down()
					}
													
						
				function down()
				{
							
							if (menuhold.hasChildNodes())
									{
									while( menuhold.childNodes.length >= 1 ){menuhold.removeChild( menuhold.firstChild );} 
									}				
								var hold=document.createElement('div')
								hold.style.marginTop='175px'
								for(var x=0;x<package.length;x++)
									{
										if(package[x]==findit)
										
											{
											var menuTitle=document.createElement('div')
											menuTitle.setAttribute('id','menuTitle'+x)
											menuTitle.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
											menuTitle.style.fontSize='20px'
											menuTitle.style.color='#f0d432'
											menuTitle.style.fontWeight='400'
											menuTitle.style.textAlign='center'
											menuTitle.style.marginTop='50px'
											menuTitle.style.padding='7px'
											menuTitle.innerHTML=menuItem[x]
											var menudes=document.createElement('div')
											menudes.setAttribute('id','menudes'+x)
											menudes.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
											menudes.style.fontSize='14px'
											menudes.style.width='675px'
											menudes.style.marginLeft='auto'
											menudes.style.marginRight='auto'
											menudes.style.color='#f0d432'
											menudes.style.fontWeight='400'
											menudes.style.textAlign='center'
											menudes.style.marginTop='15px'
											menudes.style.padding='10px'
											menudes.style.borderBottom='2px dashed #f0d432'
											var des=menuDes[x]
											var mendes=des.replace(/-/g,'<br>')
											menudes.innerHTML=mendes
											hold.appendChild(menuTitle)
											hold.appendChild(menudes)
											document.getElementById('menuslide').appendChild(hold)
											}
										
										
									}
									$('#menuslide').css('visibility','visible')
									var height=hold.offsetHeight+325
									var num=height
									$('#menuslide').css('height',num+'px')
									var bottom=document.createElement('div')
									bottom.style.backgroundImage='url(WebImages/menugbbar.png)'
									bottom.style.width='800px'
									bottom.style.height='4px'
									//bottom.style.marginLeft='2px'
									bottom.style.marginTop='150px'
									document.getElementById('menuslide').appendChild(bottom)
									$('#menuslide').hide()
									$('#menuslide').slideDown(1000,function()
																			{ math=num-608
																				var math2=math-122
																				$('#slidebutton').css('marginTop',math+'px')
																				$('#slide').css('marginTop',math2+'px')
																				$('#slidebutton').css('visibility','visible');
																				$('#slide').css('visibility','visible')
																			})
							
						checkpage=findit//document.getElementById('item'+num).innerHTML
					}
				}
			}
	}
/////////////////////////////////////////////////////////////////end of menu page///////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////start of wedding page////////////////////////////////////////////////////////////////////////////////////////////////////
var clicks2
var hcheck2
if(page=='wedding')
	{  signal='on'
	$('div[class=button1]').unbind('click',Click)
		url='./scripts/weddingdata.php'
		root='wedding'
		$('#frame').css('visibility','hidden')
		$('#slide').css('visibility','hidden')
		$('#slidebutton').css('visibility','hidden');
		$('#slide').css('visibility','hidden');
		$('#gbar').css('marginTop','-600px');
		$('#container').css('background-image','url()');
		if(weddingItem.length==0&&on==0){loadXML();clicks2=0}
		if(on==1){remove(page)}
		if(weddingItem.length!=0&&on!=1){setTimeout(function(){wmenu()},100)}
		wmenu=function()
			{$('#menuapp').css('backgroundImage','url(WebImages/menubar.png)')
			if(appName=='ff')
			{
				$('#menuapp').css('marginLeft','-39px')
				$('#tbar').css('marginLeft','6px')
			}
			if(appName=='MSIE' && appver>=8)
			{
				$('#menuapp').css('marginLeft','-41px')	
			}
			if(appName=='MSIE')
			{
				$('#tbar').css('marginLeft','4px')
			}
			$('#menuapp').show().animate({backgroundPosition:'(0px 0px)'},1000,function()
																						{
																						if(clicks2==0)
																						{
																						for(var x=0;x<package1.length;x++)
																							{
																							if(package1[x]!=package1[x+1])
																								{	var left
																									
																									var items3=document.createElement('div')
																									items3.setAttribute('id','witem'+x)
																									items3.style.position='relative'
																									items3.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
																									items3.style.color='#000'
																									items3.style.fontSize='12px'
																									items3.style.fontWeight='500'
																									if(appName=='MSIE'){items3.style.marginTop='99px';items3.style.styleFloat='left'}
																									if(appName=='ff'){items3.style.marginTop='100px';items3.style.cssFloat='left'}
																									if(package1[x]=='Exclusive Evening Reception'){left=80}
																									else{left=15}
																									items3.style.marginLeft=left+'px'
																									items3.style.cursor='default'
																									items3.style.zIndex='3'
																									items3.innerHTML=package1[x]
																									itemhold2.push(items3.id)
																									document.getElementById('menuapp').appendChild(items3)
																									$('#witem'+x).bind('mouseover',wmenuHover)
																									$('#witem'+x).bind('mouseout',wmenuOut)
																									$('#witem'+x).bind('click',wmenuClick)
																								}
																							}
																						//document.getElementById('menuapp').appendChild(hmenu)
																						}
																						else{
																							$('#hmenu').css('visibility','visible');
																							for(var x=0;x<itemhold2.length;x++)
																								{
																									$('#'+itemhold2[x]+'').show()
																								}
																							}
																						clicks2++
																						setTimeout(function(){signal='off'},1000)
																						})
			on=2
			wmenuHover=function()
				{
					var names=this.id
					var count=names.indexOf('m')+1
					var num=names.substr(count)
					$('#witem'+num).css('textDecoration','underline')
				}
			wmenuOut=function()
				{
					var names=this.id
					var count=names.indexOf('m')+1
					var num=names.substr(count)
					$('#witem'+num).css('textDecoration','none')
				}
				wmenuClick=function()
				{
					var names=this.id
					var count=names.indexOf('m')+1
					var num=names.substr(count)
					var findit=document.getElementById('witem'+num).innerHTML
					var menuhold=document.getElementById('menuslide')
					if(menuhold.style.height!=""){hcheck2=parseInt(menuhold.style.height)}
					else{hcheck2=0}
					//alert(hcheck)
					if(appName=='MSIE'&&appver<8){$('#menuslide').css('marginLeft','-120px')}
					if(appName=='ff'){$('#menuslide').css('marginLeft','-90px')}
					if(appName=='MSIE'&&appver>=8){$('#menuslide').css('marginLeft','-90px')}
					//alert(findit+','+checkpage)
					if(hcheck2>0&&findit!=checkpage)
					{
					$('#slidebutton').css('visibility','hidden');
					$('#slide').css('visibility','hidden')
					$('#menuslide').slideUp(1000,function(){$('#menuslide').show();$('#menuslide').css('visibility','hidden');down2()})	
					}
					if(findit!=checkpage&&hcheck2==0 ){down2()}
													
						
				function down2()
				{
							
							if (menuhold.hasChildNodes())
									{
									while( menuhold.childNodes.length >= 1 ){menuhold.removeChild( menuhold.firstChild );} 
									}				
								var hold=document.createElement('div')
								hold.style.marginTop='175px'
								for(var x=0;x<package1.length;x++)
									{
										if(package1[x]==findit)
										
											{
											var menuTitle=document.createElement('div')
											menuTitle.setAttribute('id','qmenuTitle'+x)
											menuTitle.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
											menuTitle.style.fontSize='20px'
											menuTitle.style.color='#f0d432'
											menuTitle.style.fontWeight='400'
											menuTitle.style.textAlign='center'
											menuTitle.style.marginTop='50px'
											menuTitle.style.padding='7px'
											menuTitle.innerHTML=weddingItem[x]
											var menudes=document.createElement('div')
											menudes.setAttribute('id','wmenudes'+x)
											menudes.style.fontFamily='Tahoma, Helvetica, Arial, sans-serif'
											menudes.style.fontSize='14px'
											menudes.style.width='675px'
											menudes.style.marginLeft='auto'
											menudes.style.marginRight='auto'
											menudes.style.color='#f0d432'
											menudes.style.fontWeight='400'
											menudes.style.textAlign='center'
											menudes.style.marginTop='15px'
											menudes.style.padding='10px'
											menudes.style.borderBottom='2px dashed #f0d432'
											var wed=weddingDescrip[x]
											var weddes=wed.replace(/-/g,'<br>')
											menudes.innerHTML=weddes
											hold.appendChild(menuTitle)
											hold.appendChild(menudes)
											document.getElementById('menuslide').appendChild(hold)
											}
										
										
									}
									$('#menuslide').css('visibility','visible')
									var height=hold.offsetHeight+325
									var num=height
									heightchange=num
									$('#menuslide').css('height',num+'px')
									var bottom=document.createElement('div')
									bottom.style.backgroundImage='url(WebImages/menugbbar.png)'
									bottom.style.width='800px'
									bottom.style.height='4px'
									//bottom.style.marginLeft='2px'
									bottom.style.marginTop='150px'
									document.getElementById('menuslide').appendChild(bottom)
									$('#menuslide').hide()
									$('#menuslide').slideDown(1000,function()
																			{ math=num-608
																				var math2=math-122
																				$('#slidebutton').css('marginTop',math+'px')
																				$('#slide').css('marginTop',math2+'px')
																				$('#slidebutton').css('visibility','visible');
																				$('#slide').css('visibility','visible')
																			})
							
						checkpage=findit//document.getElementById('item'+num).innerHTML
					}
				}
			}
	}
}
//////////////////////////////////////////////////////////////////////remove menu app//////////////////////////////////////////////////////////////////////////////////
remove=function(pages)
	{	
		var check=document.getElementById('menuslide')
		var numcheck
		checkpage=''
		if(check.style.height!=""){numcheck=parseInt(check.style.height)}
		else{numcheck=0}
		if(numcheck==0){gone()}
		if(numcheck>0)
		{
			$('#slidebutton').css('visibility','hidden');
			$('#slide').css('visibility','hidden');
			$('#menuslide').slideUp(1000,function(){gone()});
		}
		function gone()
		{for(var x=0;x<itemhold.length;x++)
			{
				$('#'+itemhold[x]+'').hide()
			}
		$('#menuapp').animate({backgroundPosition:'(0px -150px)'},1000,function(){
																				$('#gbar').css('marginTop','-600px');
																				$('#frame').css('visibility','visible');
											 									$('#gbar').css('marginTop','-600px');
																					var preimg
																						if(pages=='home')
																							{//alert('hello')
																								preimg='bg'
																							}
																						if(pages=='vendor')
																							{//alert('hello')
																								preimg='vend'
																							}
																						if(pages=='about')
																							{//alert('hello')
																								preimg='vend'
																							}
																						if(pages=='contact')
																							{//alert('hello')
																								preimg='info'
																							}
																						if(pages=='event')
																							{//alert('hello')
																								preimg='eventbg'
																							}
																							$('#container').css('backgroundImage',"url(WebImages/"+preimg+".png)")
																							on=0
																							choose(pages)
																							$('#slidebutton').css('marginTop','59px')
																							$('#slide').css('marginTop','-60px')
																							if(pages!='wedding'){$('#slidebutton').css('visibility','visible')};
																							if(pages!='wedding'){$('#slide').css('visibility','visible')};
																							$('#menuapp').hide()
																					})
		}
	}
remove2=function(pages)
	{	//	
		var check=document.getElementById('menuslide')
		var numcheck
		checkpage=''
		if(check.style.height!=""){numcheck=parseInt(check.style.height)}
		else{numcheck=0}
		if(numcheck==0){gone()}
		if(numcheck>0)
		{
			$('#slidebutton').css('visibility','hidden');
			$('#slide').css('visibility','hidden');
			$('#menuslide').slideUp(1000,function(){gone()});
		}
		function gone()
		{for(var x=0;x<itemhold2.length;x++)
			{
				$('#'+itemhold2[x]+'').hide()
			}
		$('#menuapp').animate({backgroundPosition:'(0px -150px)'},1000,function(){
																				$('#gbar').css('marginTop','-600px');
																				$('#frame').css('visibility','visible');
											 									$('#gbar').css('marginTop','-600px');
																					var preimg
																						if(pages=='home')
																							{//alert('hello')
																								preimg='bg'
																							}
																						if(pages=='vendor')
																							{//alert('hello')
																								preimg='vend'
																							}
																						if(pages=='about')
																							{//alert('hello')
																								preimg='vend'
																							}
																						if(pages=='contact')
																							{//alert('hello')
																								preimg='info'
																							}
																						if(pages=='event')
																							{//alert('hello')
																								preimg='eventbg'
																							}
																							$('#container').css('backgroundImage',"url(WebImages/"+preimg+".png)")
																							on=0
																							choose(pages)
																							$('#slidebutton').css('marginTop','59px')
																							$('#slide').css('marginTop','-60px')
																							if(pages!='menu'){$('#slidebutton').css('visibility','visible')};
																							if(pages!='menu'){$('#slide').css('visibility','visible')};
																							if(pages=='menu'){menu()}
																							$('#menuapp').hide()
																					})
		}
	}
//////////////////////////////////////////////////////////////////////remove menu app//////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////eventhandlers////////////////////////////////////////////////////////////////////////////////////////////
$('div[class=button1]').bind('mouseover',rollover)
$('div[class=button1]').bind('click',Click)
$('div[class=button1]').bind('mouseout',rollout)

$('#slidebutton').bind('mouseover',srollover)
$('#slidebutton').bind('mouseout',srollout)
$('#slidebutton').bind('click',sClick)
$('#slide').bind('click',sClick)
///////////////////////////////////////////////////eventhandlers///////////////////////////////////////////////////////////////////////////////////////////////////

})

