function showColor(color) { //v2.0
  var pro=document.getElementById('procode').value;  
  window.location.href = "index.php?j=productdetails&color=" + color + "&procode=" + pro;
}
function showColorHtml(color) { //v2.0
  var pro=document.getElementById('procode').value;  
  window.location.href = "index.php?version=webshop&j=productdetails&color=" + color + "&procode=" + pro;
}
function showSize(size) { //v2.0
  var col=document.getElementById('colorid').value;   
  var pro=document.getElementById('procode').value;
  var subcode=pro+'/'+col+'/'+size;
  document.getElementById('art').value=subcode; 
}
function checkStock() {
  	with(document.form1) {
	var c=document.getElementById('art').value; // het artikelnummer
	var e=document.getElementById('bestel').value; // wat er ingevuld is	
	var f=document.getElementById(c).value; // ophalen voorraad
	check2=f-e;
	if(check2 < 0) {
	    alert('Let op!, u hebt een groter aantal opgegeven als dat er op voorraad is.');
	    document.getElementById('bestel').value = f;  		
		}
	}
}
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('geen kleur, maat of aantal ingevuld!');
    document.MM_returnValue = (errors == '');
} }
function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function noenter() {
  return !(window.event && window.event.keyCode == 13); 
}
$(function() {   
	var theWindow = $(window),
	$bg = $("#bg"),
	aspectRatio = $bg.width() / $bg.height();
function resizeBg() {
	if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
	$bg
    	.removeClass()
	.addClass('bgheight');
	} else {
	$bg
	.removeClass()
	.addClass('bgwidth');
	}
}
theWindow.resize(function() {
	resizeBg();
	}).trigger("resize");
}); 
$(window).load(function() {
		$('.myCorner').corner("20px");
});
