// JavaScript Document
<!--
function resizeWindow(width,height){
	if (document.layers) {
		// resizeTo sets inner size, so use this instead
		window.outerWidth = width;
		window.outerHeight = height;		
	} else window.resizeTo(width,height);
}

// reszie handle
function resizeFullScreen() {
	x = screen.availLeft; // ns only
	y = screen.availTop;
	window.moveTo(x,y);
	resizeWindow(screen.width,screen.height);
}


function opensite(lan) {

	var platform = navigator.platform.toLowerCase();

	var w = 984;
	var h = 683;

	var l = (screen.width - w) / 2;
	var t = ((screen.height - h) / 2);

	if(platform.indexOf("mac") != -1) {
		winprops = 'height='+h+',width='+w+',top='+(t-20)+',left='+l+',scrollbars=no,resizable=no,scrollable=no'
	} else {
		if((screen.height) <= 600) {
			t = 10;
		}
			 
		winprops = 'height='+h+',width='+w+',top='+t+',left='+l+',scrollbars=no,resizable=no'
	}
	
	win = window.open('main.php', 'DucDo', winprops)
	
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus();}

}

function printWindow() {
    bUserAgent = navigator.userAgent;
    if (bUserAgent.indexOf("Mac") != -1) {
        alert("Press 'Cmd+p' on your keyboard to print article.");
    } else {
        window.print();
    }
}


function ValidateForm(theForm,lan)
{

  if(lan == "nl") {
	error_msg = new Array("Gelieve een naam in te vullen.", "Gelieve een voornaam in te vullen.", "Gelieve een bedrijf in te vullen.", "Gelieve een telefoon in te vullen.", "Please fill in a valid e-mail address");
  } else if (lan == "fr") {
	error_msg = new Array("Veuillez remplir un nom s.v.p.", "Veuillez remplir un prénom s.v.p.", "Veuillez remplir une entreprise s.v.p.", "Veuillez remplir un numéro de téléphone.", "Please fill in a valid e-mail address");
  } else if (lan == "en") {
	error_msg = new Array("Please fill in a name.", "Please fill in a first  name.", "Please fill in a company name.", "Please fill in a phone number.", "Please fill in a valid e-mail address");
  } else {
	error_msg = new Array("Bitte füllen Sie einen Namen aus.", "Bitte füllen Sie einen Vornamen aus", "Bitte füllen Sie ein Unternehmen aus", "Bitte füllen Sie eine Rufnummer aus", "Please fill in a valid e-mail address");
  }

  if (theForm.name.value == "")
  {
    alert(error_msg[0]);
    theForm.name.focus();
    return (false);
  }

  if (theForm.firstname.value == "")
  {
    alert(error_msg[1]);
    theForm.firstname.focus();
    return (false);
  }

  if (theForm.company.value == "")
  {
    alert(error_msg[2]);
    theForm.company.focus();
    return (false);
  }

  if (theForm.telephone.value == "")
  {
    alert(error_msg[3]);
    theForm.telephone.focus();
    return (false);
  }

  num1 = theForm.email.value.length
  num2 = theForm.email.value.indexOf("@")
  if (theForm.email.value.indexOf("@") < 1 || 
  theForm.email.value.lastIndexOf(".") < num2 + 3 || 
  theForm.email.value.lastIndexOf(".") > num1 - 3)
  {
     alert(error_msg[4]);
     theForm.email.focus();
     return (false);
  }
        
  return (true);
}


function ExpandMenu(id) 
{ 
var element = document.getElementById(id); 

if (element.style.display == "none") 
element.style.display = "block"; 
else if (element.style.display == "block") 
element.style.display = "none"; 

//var element = parent.fraction.document.getElementById("assortiment"); 

//element.style.display = "none"; 

} 

function HideMenu(id) 
{ 
var element = document.getElementById(id); 

element.style.display = "none"; 
} 
function ShowMenu(id) 
{ 

var divs = document.getElementsByTagName("div");
for(i = 0; i < divs.length; i++){
    divs[i].style.display = "none";
}

var element = document.getElementById("main"); 

element.style.display = "block"; 
var element = document.getElementById(id); 

element.style.display = "block"; 

var element = parent.fraction.document.getElementById("assortiment"); 

element.style.display = "none"; 
}

function hidemenumain(id) 
{ 

var element = document.getElementById("main"); 

element.style.display = "none"; 
}
function hidemenuwho(id) 
{ 

var element = document.getElementById("whoweare"); 

element.style.display = "none"; 
}
function HideAllSubdivs()
{
HideMenu('Seashells');
HideMenu('Caffe_Latte');
HideMenu('Hearts');
HideMenu('Pralines');
HideMenu('Mendiants');
HideMenu('Truffles');
HideMenu('BarsStandard');
HideMenu('BarsOrigine');
HideMenu('BarsNoSugar');
HideMenu('Mini_bars');

}

// Switch product-pictures in right frame
 function switch_product(imgname)
 {
  //cframe = parent.document.getElementById("fraction")
  parent.fraction.document.images["img1"].src = 'img/' + imgname + '.gif';
  //eval('document.img'+k+'.src=img'+k+'_on.src');
  }

//Set Country
function setCountry(country) { 
document.getElementById("co").innerHTML=country;
} 


//-------------------------- Macromedia shit ----------------------------------------- //

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;
}

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];}}
}

function MM_findObj(n, d) { //v4.01
  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() { //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];}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//-->