/*
* Open new window with content of element
*/
function QuickJump(object){
	var Element = object.selectedIndex;
	if (object.options[Element].value != 0){
		window.open(object.options[Element].value);
	}
}

function ToolTipShow(obj, text, xpos, ypos){
	$E('tooltip').innerHTML = text;
	$E('tooltip').setStyle('left:' + ($E(obj).cumulativeOffset().left + $E(obj).getWidth() + xpos) + 'px;top:' + ($E(obj).cumulativeOffset().top + ypos) + 'px') ;
	$E('tooltip').show();
}

function ToolTipHide(){
	$E('tooltip').hide();
	$E('tooltip').setStyle('left:-1000px') ;
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
		    return false
		 }

 		 return true
	}

function ValidateForm(){
	var emailID=document.frmSample.txtEmail

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }

 /*
 * Function for loading form from http://www.viel-wasserurlaub.de/anfrage.php?id=711
 */

 function loadAnfragenForm() {



	var linkURL = 'http://www.viel-wasserurlaub.de/anfrage.php?id=711';

	$('#div_content').append('<div id="formDiv"></div>'); // first append form div
	$('#formDiv').append('<iframe id="formFrame" width="100%"> </iframe>');

	$('#formFrame').load(linkURL);


 }


  $(document).ready(function() {
 	$('.leftmenu_small_section_anfrage span').css('color', '#FFFFFF');
	$('.leftmenu_small_section_buch span').css('color', '#FFFFFF');
	$('.leftmenu_small_section_bottom_selected span').css('color', '#FFFFFF');
	$('.leftmenu_small_section_top_selected span').css('color', '#FFFFFF');


	$('#tabMenu2 span').css('color', '#273767');
  });
