// JavaScript Document

function checkformSearch ( form ){
	if (form.searchword.value.length < 4) 
	{ 
	alert("Voer een zoekwoord in van minstens 4 karakters."); 
	return false; 
	} 
	return true ;
}


function checkAanmeldForm ( form )
{
  if (form.mailad.value == "") {
    alert( "Vul je e-mail adres in." );
    form.mailad.focus();
    return false ;
  }
  return true ;
}

function checkAfmeldForm ( form )
{
  if (form.mailad.value == "") {
    alert( "Vul je e-mail adres in." );
    form.mailad.focus();
    return false ;
  }
  return true ;
}
	
// highlighting button onload
function highlightButtons(){
	catMenu(cat, '_over');
	}

// highlighting buttons menu onmouseover
function catMenu(id, newClass) {
	if (! document.getElementById )
        return;
		//alert(id);
	if (id == cat){ newClass = "_over";}
	newClass = "menu_a"+newClass;
	//alert(newClass);
	var testId = document.getElementById (id);
	if (! testId )
		//alert("stop");
		return;
    document.getElementById(id).className=newClass;
}

function changeSrc(id, newSrc) {
   document.getElementById(id).src=newSrc;
} 

//open browserwindow
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function huurinfo(){
	MM_openBrWindow('http://www.erocinema.nl/huurinfo.html','huurinfo','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=480,height=326,left=20,top=20')
}

function coverWin(theFront,theBack) { 
theURL = "http://www.sexfilmnu.nl/covers.php?front="+theFront+"&back="+theBack; 
winName = "Covers";              
features = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=470,height=710,top=0,left=0';           
xsWin = window.open(theURL,winName,features); 
xsWin.focus(); 
}

function popUp(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, 'freeclip', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=450,height=330,left = 440,top = 362');");
}

// Cookies
function createCookie(name,value,days){
	if (days){
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
	//alert("Expires: "+expires);
}

function readCookie(name){
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++){
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function resizeDiv() {
	document.getElementById('content').style.height = (document.getElementById('body').scrollHeight - 113)+"px";
}
function reloadpage(delay){
setTimeout("document.location.reload();",delay);
}

function openWin() {               
theURL = "http://www.maxx-xs.nl/pages/covers.php?front=http://www.maxx-xs.nl/images/covers/large/cover_6769_front.jpg&back=http://www.maxx-xs.nl/images/covers/large/cover_6769_back.jpg";              
winName = "Covers";              
features = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=476,height=726,top=0,left=0';           
xsWin = window.open(theURL,winName,features);              
xsWin.focus();       
}   

function rightclickbuttons()
{
	return false;
}

cat = "[HIGHLIGHT]";

function MM_preloadImages() { 
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { 
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { 
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function blinkIt() {
 if (!document.all) return;
 else {
   for(i=0;i<document.all.tags('blink').length;i++){
      s=document.all.tags('blink')[i];
      s.style.visibility=(s.style.visibility=='visible')?'hidden':'visible';
   }
 }
}


var ns6=document.getElementById&&!document.all
var ie=document.all

var customcollect=new Array()
var i=0

function jiggleit(num){
if ((!document.all&&!document.getElementById)) return;
customcollect[num].style.left=(parseInt(customcollect[num].style.left)==-1)? customcollect[num].style.left=1+"px" : customcollect[num].style.left=-1+"px"
}

function init(){
if (ie){
while (eval("document.all.jiggle"+i)!=null){
customcollect[i]= eval("document.all.jiggle"+i)
i++
} 
}
else if (ns6){
while (document.getElementById("jiggle"+i)!=null){
customcollect[i]= document.getElementById("jiggle"+i)
i++
}
}

if (customcollect.length==1)
setInterval("jiggleit(0)",300)
else if (customcollect.length>1)
for (y=0;y<customcollect.length;y++){
var tempvariable='setInterval("jiggleit('+y+')",'+'100)'
eval(tempvariable)
}
}

window.onload=init
