/** Show the current date
 * 	Format: Dayname day month year */
function printCurrentDate()
{
	date = new Date();
	
	daynames = new Array("Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag");
	monthnames = new Array("januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december");
	
	document.write(daynames[date.getDay()] + " " + date.getDate() + " " + monthnames[date.getMonth()] + " " + date.getFullYear() + " ");
}

/*
*/
function getParam(name)
{  
	name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");  
	var regexS = "[\\?&]"+name+"=([^&#]*)";  
	var regex = new RegExp( regexS );  
	var results = regex.exec( window.location.href );  
	if( results == null )    
		return "";  
	else    
		return results[1];
	}

function check()
{
	var idNr = getParam("id");
	if (idNr != 1)
		window.location.replace("http://www.desteviadrogist.nl");
}

/**
 * Dit mooi stukje javascript mag er voor gaan zorgen dat mensen die vanaf de nieuwsbrief komen goed doorgestuurd worden.
 */

function linkReferentie()
{  
	var url = window.location.href;	
	var linkNaam = url.substring(44,document.URL.length);

	if(linkNaam == "idealCancelled")
    contentframe.location.replace("http://www.desteviadrogist.nl/payment.aspx?state=cancelled")
	else if (linkNaam == "idealSuccess")
	  contentframe.location.replace("http://www.desteviadrogist.nl/payment.aspx?state=success")
	else if (linkNaam == "idealFailed")
	  contentframe.location.replace("http://www.desteviadrogist.nl/payment.aspx?state=failed");
	else if (linkNaam == "produkten")
		contentframe.location.replace("http://www.desteviadrogist.nl/frames/Producten.html?id=1");
	else if (linkNaam == "massageolie")
		contentframe.location.replace("http://www.desteviadrogist.nl/frames/Massageolie.html?id=1");
	else if (linkNaam == "hengelsport")
		contentframe.location.replace("http://www.desteviadrogist.nl/frames/Hengelsport.html?id=1");
	else if (linkNaam == "kontakt")
		contentframe.location.replace("http://www.desteviadrogist.nl/frames/Contact.html?id=1");
	else if (linkNaam == "algemenevoorwaarden")
		contentframe.location.replace("http://www.desteviadrogist.nl/frames/AlgemeneVoorwaarden.html?id=1");
	else if (linkNaam == "register")
		contentframe.location.replace("http://www.desteviadrogist.nl/Register.aspx");
	else if (linkNaam == "login")
		contentframe.location.replace("http://www.desteviadrogist.nl/Login.aspx");
	else if (linkNaam == "tellafriend")
		contentframe.location.replace("http://www.desteviadrogist.nl/TellAFriend.aspx?id=1");
	else
		contentframe.location.replace("http://www.desteviadrogist.nl/frames/Home.html?id=1");
}

