function lib_bwcheck() { //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck();

function dp(price) { 
   string = "" + price;
   number = string.length - string.indexOf('.');
   if(string.indexOf('.') == -1) return string + '.00';
   if(number == 1) return string + '00';
   if(number == 2) return string + '0';
   if(number > 3) return string.substring(0,string.length-number+3);
	return string;
}

function handleOver() {
	el = window.event.srcElement;
	if (el.tagName == "IMG") { //Check if over image
		if ((el.overSrc != null) && (el.overSrc != "")) { //check if valid overSrc
			el.srcBackup = el.src;		//Back up the src
			el.src = el.overSrc;
		}
	}
}

function handleOut() {
	el = window.event.srcElement;
	if (el.tagName == "IMG") { //Check if over image
		if ((el.overSrc != null) && (el.overSrc != "") && (el.srcBackup != null)) { //Also check for valid backup
			el.src = el.srcBackup;
		}
	}
}

function ShowBigImage(lcImageBig){
	if(llImageBigLoaded){
		llImageBigLoaded = false;
	
		loImageBig = new Image();
		loImageBig.src = lcImageBig;
		
		if(loImageBig.height>0 && loImageBig.height != null){
			Loaded();
		}else{
			loImageBig.onload = Loaded;
		}
	}else{
		//alert("Er is al een image aan het laden...");
	}
	function Loaded(){
		llImageBigLoaded = true;
		consoleRef = window.open('','popup','width='+loImageBig.width+',height='+loImageBig.height+',menubar=0,toolbar=0,status=0,scrollbars=auto,resizable=0');
		consoleRef.document.writeln('<html><head><title>Kidwalk and Art</title><link rel="stylesheet" href="css/website.css" type="text/css"></head><body bgcolor="#FFFFFF" onLoad="self.focus()"><a href="JavaScript:close()"><img src="'+loImageBig.src+'" border="0"></a></body></html>');
		consoleRef.document.close();
	}
}

function CheckEmail(cAddress) {
	var validRegExp = /^\w(\.?[\w-])*@\w(\.?[\w-])*\.[a-z]{2,6}$/i;
	if(cAddress.search(validRegExp) == -1) {
		return false;
	}
	if(cAddress.indexOf("@") == -1)
		return false;
	if(AmpersandInString(cAddress))
		return false;
	return true;
}

function AmpersandInString(cString) {
	return (cString.indexOf("&")>-1);
}

function QuoteInString(cString) {
	return (cString.indexOf("'")>-1);
}

var llImageBigLoaded = true;
document.onmouseover=handleOver;
document.onmouseout=handleOut;
