//---------------------------------------------------------------------------------------/
//	Copy rights: Het Wep development - www.hetwep.nl
//	By: Wouter van Kastel
//---------------------------------------------------------------------------------------/	

	window.defaultStatus = ":: Voigt Travel b.v. ::";
		
	function NewWindow(WindowName,Features) {
	    var Url = window.event.srcElement;
		   
		if (Url) {
			window.open(Url,WindowName,Features).Focus;
			return false;
		}
	}
		
	function Expland(mName,mAction) {
		
		var name = mName;
		var acti = mAction;
			
		if (acti == "over") {
			document.getElementById(name).style.display='block';
		}
		if (acti == "out") {
			document.getElementById(name).style.display  = "none";
		}
	}
		
	function findObj(n, d) { //v3.0
	  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document); return x;
	}
		
	function setTextOfTextfield(objName,x,newText) { //v3.0
	  var obj = findObj(objName); if (obj) obj.value = newText;
	}
	
	
	function CreateFlash(targetElement, flashData, flashWidth, flashHeight) {
	  var innerHtml;

		obj = document.getElementById(targetElement);
	  
	  innerHtml = '<object type="application/x-shockwave-flash" data="'+flashData+'" width="'+flashWidth+'" height="'+flashHeight+'">';
	  innerHtml += '<param name="movie" value="'+flashData+'" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" />';
	  innerHtml += '<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" onclick="window.open(this.href,\'_blank\');return false;"><img src="noflash.gif" width="'+flashWidth+'" height="'+flashHeight+'" alt="Your browser doesn\'t support Flash! Click here to upgrade to Flash free." /></a>';
	  innerHtml += '</object>';
	  
	  obj.innerHTML = innerHtml;
	}


	function validateEmail(obj,msgOK,mgsFalse)
	{
		var obj = document.getElementById(obj)
		
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(obj.value) != true)
		{  
		
			document.getElementById('errorMSG').innerHTML = mgsFalse;
			boolValid = false;
	    }
	    else
	    {   
			document.getElementById('errorMSG').innerHTML = msgOK;
			boolValid = true;
	     }   
	    
		return boolValid;
	}
