function setPageBrowser(oPageBrowserForm, iStep){
	oPageBrowserForm.iFirstRow.value = iStep;
	oPageBrowserForm.submit();
}
function showhideBookingBox(){
	if(myBookingBox!=null&&myBookingBox!="undefined"){
		//myShowdowBox!=null&&myShowdowBox!="undefined"
		if(myBookingBox.style.display == "block"){
			myBookingBox.style.display = "none";
			if(myShadoBox!=null&&myShadoBox!="undefined") myShadoBox.style.display = "none";			
		}
		else{
			myBookingBox.style.display = "block";
			if(myShadoBox!=null&&myShadoBox!="undefined") myShadoBox.style.display = "block";
			newHref = document.location.href.replace("#top","")+"#top";
			document.location.href = newHref;
		}
	}
}

function checkBookingForm(oForm){
	if(oForm.Name.value==""){
		alert(bookingEmptyNameAlert);
		oForm.Name.focus()
		return false;
	}	
	if(oForm.Phone.value==""){
		alert(bookingEmptyPhoneAlert);
		oForm.Phone.focus()
		return false;
	}		
	return checkMail(oForm.Email.value, oForm.Email, bookingEmptyEmailAlert)
}

function checkContactForm(oForm){
	if(oForm.Namn.value==""){
		alert(noNameML);
		oForm.Namn.focus()
		return false;
	}	
	return checkMail(oForm.Email.value, oForm.Email)
}

function checkMail(sInputValue,oFormField, oFormFieldAlert){
	var myRe = /[a-z0-9_.=-]+@([a-z0-9-]+\.)+([a-z]{2,3})/i;
	if (!(sInputValue).match(myRe))	{
		alert(oFormFieldAlert)
		oFormField.focus()
		return false
	}
	else {
		//alert(sInputValue)
		return true
	}
}

function getOffsetLeft(oElm){
	var iOffsetLeft = oElm.offsetLeft;
	var oOffsetParent = oElm.offsetParent;
	while(oOffsetParent){
		//if(oOffsetParent.tagName=="BODY") break;	
		iOffsetLeft += oOffsetParent.offsetLeft;
		oOffsetParent = oOffsetParent.offsetParent;
	}
	return iOffsetLeft;
}
