
//Verzend het formulier als from=ok en waarschuwing=ok
//***********************************
function sendForm() {
	if(checkFormProduct() == true){
		window.open("/producten/confirm_aanvraag.htm","Bevestigen","height=300, width=420");
	}
	return false;
}

//GotoUrl voor jumpmenu
//***********************************

function GotoURL(){
	idx = this.document.prodlink.products.selectedIndex;
	url = this.document.prodlink.products[idx].value;
	if (idx>0){
		this.document.location.href = url;
		return true;
	}else{
		return false;
	}
}

//-->

//Opent pagina voor euro ondersteuning

// ************************************
function gotoEuro()
{
	if(window.confirm("Als u het Euro teken niet ziet kunt u het hier downloaden"))
	{
		window.open("http://www.microsoft.com/windows/euro.asp");
	}
}



//Print
//***********************************
function Print(){
	if (window.print){
		window.print()
	}
	return
}

// print popup textarea met de premie berekening
//***********************************************
function printLayout()
{
	var sValue = window.location.href;
	sValue = sValue.slice(sValue.lastIndexOf("/")+1);
	if (sValue == "premie.asp")
	{
		openWindow("/producten/printPagina.htm","PrintPagina","640px","510px","No");
	}
	else
	{
		sValue = this.location.href+"?print=true";
		this.location.href=sValue;
		//window.open(sValue);
	}
}

//Print with parameters
//***********************************
//function Print(inVal){
//	if (window.inval.print){
//		window.inVal.print()
//	}
//	return
//}

//Bookmark
//***********************************
function Bookmark(){
	if (navigator.appName=='Microsoft Internet Explorer')
	{
	url = this.document.location;
	description = this.document.title;
	window.external.AddFavorite(url, description);
	}else{
	alert("Deze functie is alleen beschikbaar met Internet Explorer.\n\nVoor Netscape druk 'ctrl-D' om de pagina te bookmarken.");
	}
}


//Centered pop-up window
//***********************************
var popwin = null;

function openWindow(mypage,myname,w,h,scroll){

LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
popwin = window.open(mypage,myname,settings)
if(popwin.window.focus){popwin.window.focus();}

}

//Zoek checken voor TP
//***********************************
function tpQueryType(searchform){
	if (searchform.zoektype[searchform.zoektype.selectedIndex].value == 'pc'){
		searchform.postcode.value=searchform.zoekstring.value;
	}
	if (searchform.zoektype[searchform.zoektype.selectedIndex].value == 'pl'){
		searchform.plaats.value=searchform.zoekstring.value;
	}
	if (searchform.zoektype[searchform.zoektype.selectedIndex].value == 'nm'){
		searchform.naam.value=searchform.zoekstring.value;
	}
}


//Zoek checken
//***********************************
function checkZoek(){
	if (this.document.zoekform.zoektype[this.document.zoekform.zoektype.selectedIndex].value == 'tp'){
		this.document.location.href="/asp-bin/tp_zoek.asp";
	}
	if (this.document.zoekform.zoektype[this.document.zoekform.zoektype.selectedIndex].value == 'fo'){
		this.document.zoekform.action="/asp-bin/fo_zoek.asp";
	}
	if (this.document.zoekform.zoektype[this.document.zoekform.zoektype.selectedIndex].value == 'fq'){
		this.document.zoekform.action="/asp-bin/fq_zoek.asp";
	}
	if (this.document.zoekform.zoektype[this.document.zoekform.zoektype.selectedIndex].value == 'al'){
		this.document.zoekform.action="/asp-bin/al_zoek.asp";
	}
}


//Producten Form check
//***********************************
function checkFormProduct() {
	var altekst = 'S.v.p. de volgende gegevens invullen:\n\n'
	
  for (i=0 ; i < self.document.aanvraag.length ; i++) {
    field = this.document.aanvraag.elements[i];
    len = field.name.length;
    if (field.name.charAt(len-1)=='*' && field.value=='') {
      pos = 0;
			for (z=0; z<6; z++) {
				if (field.name.charAt(z) == '?') {
					pos = z+1;
				}
			}
			altekst = altekst + '- ' + field.name.substring( pos, field.name.length - 1) + '\n';
    }
  }
	if (altekst.length > 45) {
		alert(altekst);
		return false;
	} else {
	  return true;
	}
}

//Images Preloaden
//***********************************
function MM_preloadImages() { //v3.0
  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];}}
}

//Objecten Vinden (wordt gebruikt in swap image functie)
//***********************************
function MM_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=MM_findObj(n,d.layers[i].document); return x;
}

//Images Swappen
//***********************************
function MM_swapImage() { //v3.0
  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];}
}

//Images Restoren na Swap Image
//***********************************
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}