var last_tab='tab1';
function eid(ID){return document.getElementById(ID);}
function show(N){eid(N).style.display='block';}
function hide(N){eid(N).style.display='none';}
function toggle_visibility(id,idd){
   var e=eid(id);var ee=eid(idd);
   if(e.style.display=='block'){ee.src='/graphics/plus.gif';e.style.display='none';
   }else{ee.src='/graphics/minus.gif';e.style.display='block';}  
}
function toggle_verfijn(ID,IDD,IDDD){
   var e=eid(ID);var ee=eid(IDD);var eee=eid(IDDD);
   if(e.style.display=='block'){ee.src='/graphics/plus.gif';e.style.display='none';eee.innerHTML='Meer...';
   }else{ee.src='/graphics/minus.gif';e.style.display = 'block';eee.innerHTML='Minder';}  
}
function formFocus(ID){eid(ID).focus();}
function upperCase(ID){var y=eid(ID).value;eid(ID).value=y.toUpperCase();}
function upperCaseFirst(ID){eid(ID).value=eid(ID).value.substr(0, 1).toUpperCase() + eid(ID).value.substr(1);}
function setAnonymous(ID){DG=eid(ID);if(DG.value=='Anoniem'){DG.value='';}else{DG.value='Anoniem';}}
function show_next(N){eid(last_tab).style.textDecoration='none';var curr=eid(N);curr.style.textDecoration='underline';hide(last_tab+'_data');show(N+'_data');last_tab=N;}
function trackEvent(a,b,c){try{pageTracker._trackEvent(a,b,c);}catch(e){}}
function addLoadEvent(func) {
  var oldonload=window.onload;
  if (typeof window.onload != 'function') {
    window.onload=func;
  }else{
    window.onload=function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
if (document.getElementsByTagName) {
	var inputElements = document.getElementsByTagName("input");
	for (i=0; inputElements[i]; i++) {
		if (inputElements[i].className && (inputElements[i].className.indexOf("disableAutoComplete") != -1)) {
			inputElements[i].setAttribute("autocomplete","off");
		}
	}
}
//or
//if(eid) {
//	var obj = eid('disableAutoComplete');
//	if(obj.setAttribute) obj.setAttribute('autocomplete','off');
//}
function change_img(img_src,img_name){if(img_name==undefined){img_name='slide';}document[img_name].src=img_src;}
function toggleMe(whichLayer){
  var elem, vis;
  if( eid ) // this is the way the standards work
    elem = eid( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers )
    elem = document.layers[whichLayer];
  vis = elem.style;
  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';
}
function hidediv(byid) {
	if (eid){ // DOM3 = IE5, NS6
		eid(byid).style.visibility='hidden';
	}else{
		if(document.layers){ // Netscape 4
			document.byid.visibility='hidden';
		}else{ // IE 4
			document.all.byid.style.visibility='hidden';
		}
	}
}
function clear_last_visit(DOMAIN){Delete_Cookie('lvisit','/','.'+DOMAIN,'');top.location.href=top.location.href;}
function showdiv(byid) {
	if (eid) { // DOM3 = IE5, NS6
		eid(byid).style.visibility = 'visible';
	} else {
		if (document.layers) { // Netscape 4
			document.byid.visibility = 'visible';
		} else { // IE 4
			document.all.byid.style.visibility = 'visible';
		}
	}
}
function popOpen(URL,NAME,HEIGHT,WIDTH){var LEFT=(screen.width - WIDTH) / 2 - 20;var TOP=(screen.height - HEIGHT) / 2;NEWWINDOW=open(URL,NAME.replace(' ',''),'scrollbars=yes,toolbar=no,location=no,status=no,resizable=no,width=' + WIDTH + ',height=' + HEIGHT + ',left=' + LEFT + ',top=' + TOP + '');NEWWINDOW.focus();return false;}
function showMenu(IDMENU){
	var MYMENU=eid(IDMENU);
	if(MYMENU.style.display=="none" || MYMENU.style.display==""){
		MYMENU.style.display="block";
	}else{ 
	/*	MYMENU.style.display="none";*/
	}
}
function hideMenu(IDMENU){
	var MYMENU=eid(IDMENU);
	if(MYMENU.style.display=="none" || MYMENU.style.display==""){
	/*	MYMENU.style.display="block";*/
	}else{ 
		MYMENU.style.display="none";
	}
}
function intCheck(var1){
	var1 = var1.toString().replace(/\,|\.|\ /g,'');
	if (!isNaN(var1)) {
		while(''+var1.charAt(0)==' ')var1=var1.substring(1,var1.length);
		while(''+var1.charAt(var1.length-1)==' ')var1=var1.substring(0,var1.length-1);
		if (var1.length>4){
			var1=var1.substring(0,4)
		}
		return var1;
	} else {
		return 1;
	}
}
function intVar(ID,VALUE){show('d'+ID);eid(ID).value='';eid(ID).value=VALUE;}
function adToBasket(formName,productNrId,productNr){
	eid(formName).action='#productnr+productNrId';
	eid('hqty').value=eid('qty'+productNr).value;
	eid('hprod_id').value=productNrId;
	eid(formName).submit();
}
function showit(sid1,sid2){
	if(sid1=='trhead'){
		SetCookie('mszoek','true','','','muizenshop.nl','');
	}else if(sid1=='trzoek'){
		DeleteCookie('mszoek','','muizenshop.nl');
	}
	eid(sid1).style.visibility='hidden';
	eid(sid2).style.visibility='visible';
}
function Set_Cookie( name, value, expires, path, domain, secure ) {
	var today = new Date();
	today.setTime( today.getTime() );

if ( expires ){
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
( ( path ) ? ";path=" + path : "" ) + 
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
function Get_Cookie( name ) {
	
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ){
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}
// this deletes the cookie when called
function Delete_Cookie( name, path, domain ) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +
	( ( path ) ? ";path=" + path : "") +
	( ( domain ) ? ";domain=" + domain : "" ) +
	";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}
function check_Cookie(DOMAIN){
	Set_Cookie('test','none','','/','.'+DOMAIN,'');
	if (!Get_Cookie('test')){
		document.write('<div class="footer_warning"><b>Als u dit bericht ziet, dan accepteerd uw browser geen cookies.</b><br/>Voor het correct werken binnen deze site, moet u cookies aanzetten in uw browser. Heeft u vragen? Bel: +31 (0)35-603 51 06.</div>');
	}
}
function SetCookie(name, value, expires, path, domain, secure){
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}
function DeleteCookie(name, path, domain){
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
function changeC(productnr,kleur) {
	eid('nr'+productnr).bgColor='#'+kleur;
	eid('preview'+productnr).bgColor='#'+kleur;
	eid('naam'+productnr).bgColor='#'+kleur;
	eid('info'+productnr).bgColor='#'+kleur;
	eid('aantal'+productnr).bgColor='#'+kleur;
	eid('ad'+productnr).bgColor='#'+kleur;
}

function writeFlash(s,w,h,b,v) {
var alternateContent = '<br/>Deze muizenshop banner maakt gebruik van de flash 6 plugin van Macromedia. U dient deze te downloaden om de site te kunnen bekijken.<br/><a target="_blank" href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&P5_Language=English">Klik hier</A> om deze plugin te downloaden. Na het installeren kunt u hier de pagina opnieuw opvragen.'
var flashContent = '<object id="nav" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+w+'" height="'+h+'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
+ '<param name="movie" value="'+s+'?'+v+'">'
+ '<param name="play" value="true">'
+ '<param name="loop" value="true">'
+ '<param name="quality" value="high">'
+ '<param name="wmode" value="transparent"> '
+ '<param name="menu" value="false">'
+ '<param name=bgcolor value='+b+'>'
+ '<embed src="'+s+'?'+v+'" width="'+w+'" height="'+h+'" play="true" loop="true" wmode="transparent" quality="high" menu="false" bgcolor="'+b+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>'
+ '<noembed>'+alternateContent+'</noembed></object>';
document.write(flashContent);
}
function checkStatusCreateRequestObject(){
  var req;
  if(window.XMLHttpRequest){
    req = new XMLHttpRequest();
  } 
  else if(window.ActiveXObject){
    req = new ActiveXObject("Microsoft.XMLHTTP");
  }
  else{
    req = NULL;
    //alert('Probleem met het aanmaken van hetXMLHttpRequest object');
  }
  return req;
}
function checkStatus(iets){eid("res").innerHTML="<img src=/graphics/wait.gif align=absmiddle alt=>&nbsp;&nbsp;Een ogenblik geduld alstublieft.";setTimeout('check('+iets+')',2000);}
function check(iets){
	var http=checkStatusCreateRequestObject();
	http.open('get', '/stock.php?product='+iets);
	http.onreadystatechange=function(){
	if(http.readyState==4 && http.status==200){checkStatusHandleResponseSearch(http.responseText);}}
	http.send(null);
}
function checkStatusHandleResponseSearch(t){if(t){eid("res").innerHTML=t;}else{eid("res").innerHTML="<img src=/graphics/wait.gif align=absmiddle alt=>&nbsp;&nbsp;Een ogenblik geduld alstublieft.";}}
function address_check(postcode,huisnummer){
	var http=checkStatusCreateRequestObject();
	http.open('get', '/address_check.php?value='+postcode);
   	http.onreadystatechange=function(){
	if(http.readyState==4 && http.status==200){handle_address_check(http.responseText);}}
	http.send(null);
}
function handle_address_check(t){if(t){eid("straat").value=t;eid("woonplaats").value=t;}else{eid("straat").value="";eid("woonplaats").value="";}}
// http request
function createRequestObject(){
   var req;
   if(window.XMLHttpRequest){req=new XMLHttpRequest();
   }else if(window.ActiveXObject){req=new ActiveXObject("Microsoft.XMLHTTP");
   }else{req=NULL;}
   return req;
}
var http=createRequestObject();
var getter;
function sendRequestSearch(v){vv=v;if(getter){clearTimeout(getter);}getter=setTimeout("sendRequest(vv)",500);}
function handleResponseSearch(){if(http.readyState==4 && http.status==200){if(http.responseText){eid("hr").innerHTML=http.responseText;}else{eid("hr").innerHTML = "Loading...";}}}
function sh_d(ref,lvalue) {
	if(lvalue.length >1){
		if(document.all){eval( "document.all." + ref + ".style.visibility = 'visible'");}
		if(document.layers){document.layers[ref].visibility = 'visible';}
		if(eid && !document.all){maxwell_smart = eid(ref);maxwell_smart.style.visibility = 'visible';}
	}else{sh_d_hide(ref);}
}
function sh_i(ref,lvalue) {
	if(lvalue.length >1){
		if(document.all){eval( "document.all." + ref + ".style.visibility = 'visible'");}
		if(document.layers){document.layers[ref].visibility = 'visible';}
		if(eid && !document.all){maxwell_smart = eid(ref);maxwell_smart.style.visibility = 'visible';}
	}else{sh_i_hide(ref);}
}
function sh_d_hide(ref) {
		if(document.all){eval( "document.all." + ref + ".style.visibility = 'hidden'");}
		if(document.layers){document.layers[ref].visibility = 'hidden';}
		if(eid && !document.all){maxwell_smart = eid(ref);maxwell_smart.style.visibility = 'hidden';}
}
function sh_i_hide(ref) {
		if(document.all){eval( "document.all." + ref + ".style.visibility = 'hidden'");}
		if(document.layers){document.layers[ref].visibility = 'hidden';}
		if(eid && !document.all){maxwell_smart = eid(ref);maxwell_smart.style.visibility = 'hidden';}
}
function passwordStrength(V){
	var desc=new Array();desc[0]="Heel zwak";desc[1]="Zwak";desc[2]="Beter";desc[3]="Gemiddeld";desc[4]="Sterk";
	var score=0;
	if(V.length >= 6) score++;
	if( ( V.match(/[a-z]/) ) && ( V.match(/[A-Z]/) ) ) score++;
	if(V.match(/\d+/)) score++;
	if(V.length >= 8) score++;
	eid("passwordDescription").innerHTML=desc[score];
	eid("pStrength").className="strength" + score;
}