<!--//

var billigerGesehen_min_x = 270;
var billigerGesehen_min_y = 92;
var billigerGesehen_max_x = 270;
var billigerGesehen_max_y = 490;

var billigerGesehen_step_x = 5;
var billigerGesehen_step_y = 10;

var billigerGesehen_time = 5;

var billigerGesehen_action = 0;

function billigerGesehenWidth(obj)
{
	if (i = obj.style.width.match(/\d+/)) { return parseInt(i); } else { return billigerGesehen_min_x; }
}

function billigerGesehenHeight(obj)
{
	if (i = obj.style.height.match(/\d+/)) { return parseInt(i); } else { return billigerGesehen_min_y; }
}




function billigerGesehenOpen(obj)
{
	if (billigerGesehen_action==0)
	{
		document.getElementById(obj.id+"_body").style.display="block";
		document.getElementById(obj.id+"_head").style.display="none";
		document.getElementById(obj.id+"_submitButton").style.display="block";

		window.setTimeout("billigerGesehen_action=\"open\"; billigerGesehenFadeIn('"+obj.id+"')", 1);
	}
}

function billigerGesehenClose(obj)
{
	if (billigerGesehen_action==0)
	{
		document.getElementById(obj.id+"_body").style.display="none";		
		document.getElementById(obj.id+"_head").style.display="block";
		document.getElementById(obj.id+"_submitButton").style.display="none";
		
		window.setTimeout("billigerGesehen_action=\"close\"; billigerGesehenFadeOut('"+obj.id+"')", 1);
	}
}

function billigerGesehenFadeIn(obj_id)
{
	if (billigerGesehen_action=="open")
	{
		var obj=document.getElementById(obj_id);
		var loopFlag=false;
	
		if (billigerGesehenHeight(obj) < billigerGesehen_max_y)
			{ loopFlag=true; obj.style.height=(billigerGesehenHeight(obj) + billigerGesehen_step_y) + "px"; }

		if (billigerGesehenWidth(obj) < billigerGesehen_max_x)
			{ loopFlag=true; obj.style.width=(billigerGesehenWidth(obj) + billigerGesehen_step_x) + "px"; }

		if (loopFlag==true)
			{ window.setTimeout("billigerGesehenFadeIn('"+obj_id+"')", billigerGesehen_time); }
		else
			{ billigerGesehen_action=0; }
	}
}

function billigerGesehenFadeOut(obj_id)
{
	if (billigerGesehen_action=="close")
	{
		var obj=document.getElementById(obj_id);
		var loopFlag=false;
	
		if (billigerGesehenHeight(obj) > billigerGesehen_min_y)
			{ loopFlag=true; obj.style.height=(billigerGesehenHeight(obj) - billigerGesehen_step_y) + "px"; }

		if (billigerGesehenWidth(obj) > billigerGesehen_min_x)
			{ loopFlag=true; obj.style.width=(billigerGesehenWidth(obj) - billigerGesehen_step_x) + "px"; }

		if (loopFlag==true)
			{ window.setTimeout("billigerGesehenFadeOut('"+obj_id+"')", billigerGesehen_time); }
		else
			{ billigerGesehen_action=0; }
	}
}



function prijsmeldingCheck()
{

//------Naam--------------------------------------------------------------------------

		str = document.Aanvraag.naam.value;
		
		// Return false if name field is blank.
		if (str == ""){
		alert("\nVul uw naam in a.u.b.");
		document.Aanvraag.naam.focus();
		return false;
		}

		// Return false if characters are not a-z, A-Z, or a space.
		for (var i = 0; i < str.length; i++){
		ch = str.substring(i, i + 1);
		if (((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)) && ch != ' '){
		alert("\nHet NAAM veld accepteert alleen letters & spaties.\n\nVul uw naam opnieuw in a.u.b.");
		document.Aanvraag.naam.select();
		document.Aanvraag.naam.focus();
		return false;
		}}
		
//------Postcode 1------------------------------------------------------------------------

		str      = document.Aanvraag.Postkode1.value;
		// Return false if postkodecijferveld is blank.
		if (str == ""){
		alert("\nVul uw postcodecijfers in a.u.b.");
		document.Aanvraag.Postkode1.focus();
		return false;
		}

 		// Return false als geen 4 posities
		if (str.length != 4){
		alert("\nDe POSTCODE moet uit 4 cijfers bestaan.\n\nVul de 4 postcodecijfers opnieuw in a.u.b.");
		document.Aanvraag.Postkode1.select();
		document.Aanvraag.Postkode1.focus();
		return false;
		}

		str      = document.Aanvraag.Postkode1.value;
		// Return false if characters are not numbers.
		for (var i = 0; i < str.length; i++){
		ch = str.substring(i, i + 1);
   		if (ch < "0" || "9" < ch){
		alert("\nDe POSTCODECIJFERS mogen alleen CIJFERS zijn.\n\nVul uw postcodecijfers opnieuw in a.u.b.");
		document.Aanvraag.Postkode1.select();
		document.Aanvraag.Postkode1.focus();
		return false;
		}}

//------Postkode 2--------------------------------------------------------------------

		str      = document.Aanvraag.Postkode2.value;
		// Return false if postcodeletterveld is blank
 		if(document.Aanvraag.Postkode2.value =="")
   		{alert("\nVul uw postcodeletters in a.u.b. ");
  	 	document.Aanvraag.Postkode2.focus();
	  	return false;
 		}

		// Return false als geen 2 posities
		if (str.length != 2){
		alert("\nDe POSTCODE moet uit 2 letters bestaan.\n\nVul de 2 postcodeletters opnieuw in a.u.b.");
		document.Aanvraag.Postkode2.select();
		document.Aanvraag.Postkode2.focus();
		return false;
		}

		// Return false if characters are not a-z, A-Z, or a space.
		for (var i = 0; i < str.length; i++){
		ch = str.substring(i, i + 1);
 		if ((ch < "a" || "z" < ch) && (ch < "A" || "Z" < ch)){
		alert("\nDe POSTCODELETTERS mogen alleen LETTERS zijn.\n\nVul uw postcodeletters opnieuw in a.u.b.");
		document.Aanvraag.Postkode2.select();
		document.Aanvraag.Postkode2.focus();
		return false;
		}}

//------Huisnummer--------------------------------------------------------------------

		str      = document.Aanvraag.Huisnr.value;
		// Return false if Huisnummer field is blank.
		if (str == ""){
		alert("\nVul uw Huisnummer in a.u.b.");
		document.Aanvraag.Huisnr.focus();
		return false;
		}		
		
		
//-------E mail-----------------------------------------------------------------------

 		// Return false als e-mail veld is blank.


//		var mail = document.Aanvraag.from.value;
//		document.Zendaanvraag.from.value = mail;
 
		if(document.Aanvraag.from.value == "")
   		{alert("\nVul uw e-mail adres in a.u.b. ");
   		document.Aanvraag.from.focus();
	 	return false;
		}

    	if (document.Aanvraag.from.value.indexOf("@") == -1)
      	{alert(" U heeft geen '@' in uw E-mail adres ingegeven");
      	document.Aanvraag.from.focus();
		return false;
		}

      	if(document.Aanvraag.from.value.indexOf(".") == -1)
       	{alert(" U heeft geen '.' in uw E-mail adres ingegeven");
        document.Aanvraag.from.focus();
		return false;
		}
				
//-------Gezien bij -----------------------------------------------------------------------		
		
		if(document.Aanvraag.Gezienbij.value == "")
   		{alert("\nVul in waar u het artikel gezien heeft a.u.b. ");
   		document.Aanvraag.Gezienbij.focus();
	 	return false;
		}
		
		if(document.Aanvraag.Gezienprijs.value == "")
   		{alert("\nVul in voor welke prijs u het artikel gezien heeft a.u.b. ");
   		document.Aanvraag.Gezienprijs.focus();
	 	return false;
		}		
			
//------DATUM, KLOK = NUMMER ----------------------------------------------------------------


//var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("01","02","03","04","05","06","07","08","09","10","11","12");

var mydate=new Date();
var year=mydate.getYear();
if (year < 1000)
year+=1900;
var day=mydate.getDay();
var month=mydate.getMonth();
var daym=mydate.getDate();
if (daym<10)
daym="0"+daym;
var hours=mydate.getHours();
var minutes=mydate.getMinutes();
var seconds=mydate.getSeconds();
//var dn="AM"
//if (hours>=12)
//dn="PM"
//if (hours>12){
//hours=hours-12
//}
//if (hours==0)
if (minutes<=9)
minutes="0"+minutes;
if (minutes ==0)
minutes=minutes;
if (seconds<=9)
seconds="0"+seconds;

//-------------- onderwerpregel samenstellen ------------------------------------------------------
		
		var zendadr1 = document.Aanvraag.Postkode1.value;
		var zendadr2 = document.Aanvraag.Postkode2.value;
		var zendadr3 = document.Aanvraag.Huisnr.value;

 		var postc  	= zendadr1 + zendadr2 + zendadr3;
  		var datum 	= year + montharray[month] + daym;
  		var tijd 	= hours+":"+minutes;

		document.Aanvraag.datum.value= "-" + datum;
		
		document.Aanvraag.subject.value= 
		"Witgoedland prijsmelding : " + postc + "-" + datum + "-" + tijd;		
				
		
}	
// -->	

