function loadNewPage(temp) 

{

	sendHttpRequest(temp,'displayResults1');	

}



function loadGallery(temp)

{

	sendHttpRequest(temp,'displayResults1');

	document.getElementById("text").style.width = "735px";

	document.getElementById("photo").style.display = "none";

	document.getElementById('submenu').style.display="none";

}
function animateMenu2() {
var growDiv = new Fx.Style($("menucont"), "height", {duration: 1000}).addEvent("onStart", function() {
		setTimeout("document.getElementById('hmlink').style.visibility = 'visible'",1250)
		setTimeout("document.getElementById('lnlink').style.visibility = 'visible'",1450)
		setTimeout("document.getElementById('melink').style.visibility = 'visible'",1650)
		setTimeout("document.getElementById('calink').style.visibility = 'visible'",1850)
		setTimeout("document.getElementById('gllink').style.visibility = 'visible'",2050)
		setTimeout("document.getElementById('ktlink').style.visibility = 'visible'",2250)
		setTimeout("document.getElementById('menutext').style.visibility = 'visible'",2350)
		});
	growDiv.start(320);
}
function animateCont() {
	var expandDiv = new Fx.Styles($('rightcont'),
	{duration: 1000});
	
	expandDiv.start({
	'min-height': 400
	})
}

function animateMenu() {
	var expandDiv = new Fx.Styles($('menucont'),
	{duration: 1000});
	
	expandDiv.start({
	'height': 250, 'width': 250
	})
	setTimeout("document.getElementById('menutext').style.visibility = 'visible'",1250)
}

function removeElement(divNum) 

{

	var d = document.getElementById('contain');

	var olddiv = document.getElementById(divNum);

	d.removeChild(olddiv);

}



function addElement() 

{

	document.getElementById("photo").style.display = "block";

	document.getElementById("text").style.width="590px";  

}



function check_fields()

		{

		 var emailRegEx = /^([a-zA-Z0-9_\.\-\u00F6\u00E4\u00E5\u00D6\u00C5\u00C4])+\@(([a-zA-Z0-9\-\u00F6\u00E4\u00E5\u00D6\u00C5\u00C4])+\.)+([a-zA-Z0-9\u00F6\u00E4\u00E5\u00D6\u00C5\u00C4]{2,4})+$/;
		str = document.getElementById('epost').value;
		if(document.getElementById('antal').value == " Antal personer...")
		{
		alert('Please enter valid Antal personer');
		return false;
		}
		if(document.getElementById('date').value == " Date...")
		{
		alert('Please enter valid date');
		return false;
		}
		if(document.getElementById('time').value == " Time...")
		{
		alert('Please enter valid time');
		return false;
		}
		if(!str.match(emailRegEx)){
		alert('Please enter a valid email address.');
		return false;
		}
		if(document.getElementById('message').value == "Arende...")
		{
		alert('Please provide message text');
		return false;
		}
		document.emailform.submit();

		}



function show_form_error(error)

{

	table=document.getElementById("photo");

	table.innerHTML = "<font style='color: #444444;  font: bold 12px Palatino Linotype; '>"+ error +" </font>";

}

		

function displayResults(userData)

{	

	var datacont=document.getElementById('rightcon');

	

	if(!datacont){return};

	datacont.innerHTML='';

	datacont.innerHTML=userData;

}



function displayResults1(userData)

{

	var datacont=document.getElementById('rightcon');

	if(!datacont){return};

	datacont.innerHTML='';

	datacont.innerHTML=userData;

	

}



function displayResults2(userData)

{

	var datacont=document.getElementById('mail');

	if(!datacont){return};

	datacont.innerHTML='';

	datacont.innerHTML=userData;

}



function sendHttpRequest(url,callbackFunc,respXml)

{

	var xmlobj=null;

	try

		{

		xmlobj=new XMLHttpRequest();

		}

	catch(e)

		{

		try

			{

			xmlobj=new ActiveXObject("Microsoft.XMLHTTP");

			}

		catch(e)

			{

			alert('AJAX is not supported by your browser!');

			return false;

			}

		} 

	xmlobj.onreadystatechange=function(){

	if(xmlobj.readyState==4)

		{

		if(xmlobj.status==200)

			{

				

			respXml?eval(callbackFunc+'(xmlobj.responseXML)'):eval(callbackFunc+'(xmlobj.responseText)');

			}

		}



	}

	// open socket connection

	xmlobj.open('GET',url,true);

	// send http header

	xmlobj.setRequestHeader('Content-Type','plain/text; charset=UTF-8');

	// send http request

 	xmlobj.send(null);

	

}

function sendHttpRequest1(url,callbackFunc,respXml)

{

	var xmlobj=null;

	try

		{

		xmlobj=new XMLHttpRequest();

		}

	catch(e)

		{

		try

			{

			xmlobj=new ActiveXObject("Microsoft.XMLHTTP");

			}

		catch(e)

			{

			alert('AJAX is not supported by your browser!');

			return false;

			}

		} 

	xmlobj.onreadystatechange=function(){

	if(xmlobj.readyState==4)

		{

		if(xmlobj.status==200)

			{

			alert('sendhttp;')

			respXml?eval(callbackFunc+'(xmlobj.responseXML)'):eval(callbackFunc+'(xmlobj.responseText)');

			}

		}



	}

	// open socket connection

	xmlobj.open('GET',url,true);

	// send http header

	xmlobj.setRequestHeader('Content-Type','plain/text; charset=UTF-8');

	// send http request

 	xmlobj.send(null);

}

function roll_over(img_name, img_src)

{

   document[img_name].src = img_src;

}// JavaScript Document

function browser_det()

{

	var browser=navigator.appName;

    var b_version=navigator.appVersion;

    var version=parseFloat(b_version);

	var data = browser + ' ';

	verdata = b_version.split(";");

	if(verdata[1]==' MSIE 6.0')

		{

		document.getElementById('top').style.display = "none";

		document.getElementById('bottom').style.display = "none";

		alert(document.getElementById('page').style.width)

		

		}

	if(browser=='Netscape')

		{

		

		//document.bottomborder.width = "916";

		

		//document.getElementById('bottom').style.marginTop = "20px";

		}

}

function toggleLayer( whichLayer )

{  

	var elem, vis;  

	if( document.getElementById ) 

	// this is the way the standards work    

	elem = document.getElementById( whichLayer );  

	else if( document.all ) 

	// this is the way old msie versions work      e

	lem = document.all[whichLayer];  

	else if( document.layers ) 

	// this is the way nn4 works   

	elem = document.layers[whichLayer];  

	vis = elem.style;  

	//if the style.display value is blank we try to figure it out here 

	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)   

	vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';  

	vis.display = (vis.display==''||vis.display=='block')?'none':'block';

	loadNewPage('page3.php');

}
