var sFontSize;

function setFontSize(o, s) {
	if(o == "*") {
		o = "body";
	}
	
	$(o).css("fontSize", s);
	
	sFontSize = s;
}

function toggleInputValue(o) {
	if(o.value == o.title) o.value = "";
	else if($.trim(o.value) == "") o.value = o.title;
}


function CheckDateNew(id,oLayout,isReq){
	
	var oDay 	= document.getElementById(id+"_DAY")
	var oMonth	= document.getElementById(id+"_MONTH")
	var oYear	= document.getElementById(id+"_YEAR")
	var vDay 	= oDay.value
	var vMonth	= oMonth.value
	var vYear	= oYear.value
	
	if ((isReq==0)&&(vDay=="")&&(vMonth=="")&&(vYear=="")){
		return true
	}
	else{
		if ((vDay=="")&&(vMonth=="")&&(vYear=="")){
			alert("Het veld " +oLayout+ " is leeg.\nVul dit veld alsnog in.")
			oDay.focus();
			return false
		}
		if (vDay==""){
			alert("Het veld " +oLayout+ " - DAG is leeg.\nVul dit veld alsnog in.")
			oDay.focus();
			return false
		}
		if (vMonth==""){
			alert("Het veld " +oLayout+ " - MAAND is leeg.\nVul dit veld alsnog in.")
			oMonth.focus();
			return false
		}
		if (vYear==""){
			alert("Het veld " +oLayout+ " - JAARTAL is leeg.\nVul dit veld alsnog in.")
			oYear.focus();
			return false
		}
		
		
		if (((vMonth==2)||(vMonth==4)||(vMonth==6)||(vMonth==9)||(vMonth==11))&&(vDay==31)){
			alert("De maand van " +oLayout+ " heeft geen 31 dagen.\nPas dit aan.")
			oDay.focus();
			return false
		}
		if ((vMonth==2)&&(vDay==30)){
			alert("De maand van " +oLayout+ " heeft geen 30 dagen.\Pas dit aan.")
			oDay.focus();
			return false
		}
		
		var schrikkelYear	= String(vYear/4)
		var matchyear		= schrikkelYear.indexOf(".")
		
		if (matchyear>0){
			if ((vMonth==2)&&(vDay==29)){
				alert("Februari van " +oLayout+ " heeft geen 29 dagen.\Pas dit aan.")
				oDay.focus();
				return false
			}
		}
		
		document.getElementById("_"+id).value = (vDay + "/" + vMonth + "/" + vYear)
		return true
	}
}

// Flash

function renderFlash(o) {

	$(o).html("");
	
	var options = $(o).metadata({type:'attr',name:'options'});
	
	// standard
	var sSrc = options.src;
	var sType = options.type;
	var nWidth = options.width;
	var nHeight = options.height;
	var sLink = options.link;
	var bAllowFullScreen = options.allowfullscreen;
	
	if(sType == "flash") {
	
		$(o).flash({
			swf: sSrc,
			width: nWidth, 
			height: nHeight,
			expressInstall: true,
			params : {
				allowfullscreen: bAllowFullScreen
			}
		});
	
	
	} else if (sType == "flv") {
	
		$(o).flash({
			swf: _root + "swf/player.swf",
			width: nWidth, 
			height: nHeight,
			allowfullscreen: 'true',
			expressInstall: true,
			flashvars : {
				file: _wwwroot + sSrc,
				autostart: options.autostart,
				type: 'http',
				link: sLink
			},
			params : {
				allowfullscreen: bAllowFullScreen
			}
		});
		
	} else if (sType == "mp3") {
	
		$(o).flash({
			swf: _root + "swf/player.swf",
			width: nWidth, 
			height: nHeight,
			allowfullscreen: 'true',
			expressInstall: true,
			flashvars : {
				file: _wwwroot + sSrc,
				autostart: options.autostart,
				type: 'sound',
				link: sLink
			},
			params : {
				allowfullscreen: bAllowFullScreen
			}
		});
		
	} else if (sType == "youtube") {
	
		$(o).flash({
			swf: _root + "swf/player.swf",
			width: nWidth, 
			height: nHeight,
			allowfullscreen: 'true',
			expressInstall: true,
			flashvars : {
				file: options.file,
				autostart: options.autostart,
				type: 'youtube'
			},
			params : {
				allowfullscreen: bAllowFullScreen
			}
		});
	
	};

}

function makeFlashObj(sID, sPath, sWidth, sHeight, sBG)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="' + sID + '" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + sWidth + '" height="' + sHeight + '">');
	document.write('<param name="movie" value="' + sPath + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="bgcolor" value="' + sBG + '">');
	document.write('<embed bgcolor="' + sBG + '" src="' + sPath + '" quality="high" id="' + sID + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + sWidth + '" height="' + sHeight + '"></embed>');
	document.write('</object>');
}