var uriWindow;
function windowURI(url, w, h,time,resizable)	// windowURI(link,width,height,time(close the new window after x seconds),resizable(1 -> true)
{
	if(time == undefined)
		time = 0;

	if(resizable == undefined)
		resizable = 1;

	uriWindow = window.open(url,"Window_print","menubar=no,scrollbars=1,left=10,top=0,width="+w +" ,height="+h +",resizable="+resizable);	

	if(time != 0 && time != -1)
	{
		setTimeout('uriWindow.close();',time);			
	}
}		

function windowPrint(url, w, h)
{
	//alert(url);2-7-2008
	printWindow=window.open(url,"Window_print","menubar=no,scrollbars=1,left=10,top=1,width="+w +" ,height="+h +",resizable=1")
}
1-9-2008
var exampleWindow;
function windowExample(url, w, h)
{
	//alert(url);
	if(exampleWindow)
		exampleWindow.focus();
	exampleWindow=window.open(url,"Window_print","menubar=no,scrollbars=1,left=10,top=1,width="+w +" ,height="+h +",resizable=1")
}

function openWindow(text)
{
	while((text.indexOf("%BR%") != -1))
	{
		text = text.replace("%BR%","<BR>");
	}
	myWin = window.open("","nCt", "left=400, top=300,width=180,height=30,status=no,toolbar=no,menubar=no,scrollbars=auto,resizable=yes");
	myWin.document.write("<html><head><title>Note</title></head>");
	myWin.document.write ("<body><script>function closeWindow(){window.close()} \n\n setTimeout(\"closeWindow()\",1000);</script>"+text+"</body></html>");
	//setTimeout("myWin.close()",200);
	//myWin.document.write("<center><p><input type='button' value='Afsluiten' name='close' onClick='window.close()'></p><center>");
}

function CheckTab(el)
{
	if ((document.all) && (9==event.keyCode) && (event.ctrlKey))
	{
		el.selection=document.selection.createRange(); 
	    setTimeout("ProcessTab('" + el.id + "')",0);
	}
	if ((document.all) && (83==event.keyCode) && (event.ctrlKey))
	{
		document.forms[0].submit();
		openWindow('De pagina is opgeslagen');
	}
}

function ProcessTab(id)
{
	document.all[id].selection.text=String.fromCharCode(9);
	document.all[id].focus();
}

function changeColor(el, color1, color2)
{
	//alert(el);
	document.getElementById(el).style.background = (document.getElementById(el).style.background == color1) ? color2 : color1;
}

function test(cell,color1,color2)
{
	cell.style.background = (cell.style.background == color1) ? color2 : color1;
}

function checkUserForm()
{	
	if(document.forms[0].username.value=="")
	{
		alert('U moet een gebruikersnaam opgeven!');
		return false;
	}
	
	/*if(document.forms[0].email.value=="")
	{
		alert('U moet email opgeven!');
		return false;
	}*/
	
	if(document.forms[0].password.value=="")
	{
		alert('U moet password opgeven!');
		return false;
	}
	
	var value = false;
	
	for(i=0;i<document.forms[0].elements.length;i++)
	{
		if(document.forms[0].elements[i].type=='checkbox')
		{
			if(document.forms[0].elements[i].checked==true)
			{
					value=true;
					break;
			}
		}
	}
	if(value==false)
	{
		alert('U dient minimaal 1 groep te selecteren!');
		return false;
	}
	return true;
}

function checkUpdateUserPropertiesForm()
{	
	if(document.forms[0].username.value=="")
	{
		alert('U moet een gebruikersnaam opgeven!');
		return false;
	}
	
	/*if(document.forms[0].email.value=="")
	{
		alert('U moet email opgeven!');
		return false;
	}*/
	
	if(document.forms[0].password.value=="")
	{
		alert('U moet password opgeven!');
		return false;
	}
	
	return true;
}

function checkGroupForm()
{
	if(document.forms[0].name.value=="")
	{
		alert('U moet een naam voor de groep opgeven!');
		return false;
	}
	
	if(document.forms[0].profileId.value=="")
	{
		alert('U moet een profiel selecteren!');
		return false;
	}
}

function checkDescriptionAmount(maxAmount)
{
	if(document.descForm.personAmount.value<maxAmount)
	{
		return true;
	}
	else
	{
		alert("U kunt niet meer dan " + maxAmount + " personen inschrijven");
		return false;
	}
}

function TrackCount(fieldObj,countFieldName,maxChars)
{
	var countField = eval("fieldObj.form."+countFieldName);
	var diff = maxChars - fieldObj.value.length;

	// Need to check & enforce limit here also in case user pastes data
	if (diff < 0)
	{
		fieldObj.value = fieldObj.value.substring(0,maxChars);
		diff = maxChars - fieldObj.value.length;
	}
	countField.value = diff;
}

function LimitText(fieldObj,maxChars)
{
	var result = true;
	if (fieldObj.value.length >= maxChars)
		result = false;
  
	if (window.event)
		window.event.returnValue = result;
	return result;
}

function imgOn(menuObj)
{
	name = menuObj.name;
	leftImage = "img"+name+1;
	rightImage = "img"+name+2;
	document.images[leftImage].src="images/menu_low.gif";
	document.images[rightImage].src="images/menu2_low.gif";
}

function imgOut(menuObj)
{		
	name = menuObj.name;
	leftImage = "img"+name+1;
	rightImage = "img"+name+2;
	document.images[leftImage].src="images/menu_hi.gif";
	document.images[rightImage].src="images/menu2_hi.gif";
}

function imgSubOn(menuObj)
{
	name = menuObj.name;
	leftImage = "subimg"+name+1;
	rightImage = "subimg"+name+2;
	document.images[leftImage].src="images/menu_sub_low.gif";
	document.images[rightImage].src="images/menu2_low.gif";
}

function imgSubOut(menuObj)
{		
	name = menuObj.name;
	leftImage = "subimg"+name+1;
	rightImage = "subimg"+name+2;
	document.images[leftImage].src="images/menu_sub_hi.gif";
	document.images[rightImage].src="images/menu_sub2_hi.gif";
}

function checkAllFields(element)
{
	if(confirm("Hiermee gaat een eventuele selectie verloren"))
	{
		for(var i=0;i<document.forms[0].elements.length;i++)
		{
			document.forms[0].elements[i].checked=checkFields;
		}
		checkFields = !checkFields;
		if(checkFields)
			element.value = "alles aan";
		else
			element.value = "alles uit";
	}
}

function emptyForm()
{
	for(var i=0;i<document.forms[2].elements.length;i++)
	{
		if(document.forms[2].elements[i].type=="text")
			document.forms[2].elements[i].value="";
	}
}

function changeImage(img, newSrc)
{
	img.src = newSrc;
}

function open_new_window(location) 
{
	new_window = window.open(location,"mailafriend","width=400,height=450,scrollbars=yes,left=10,top=10");
}

function checkAll(formName)
{	
	for(var i=0;i<document.forms[formName].elements.length;i++)
	{
		if(document.forms[formName].elements[i].type=='checkbox' && document.forms[formName].elements[i].alt!='none')
			document.forms[formName].elements[i].checked = true;
	}
}

function unCheckAll(formName)
{	
	for(var i=0;i<document.forms[formName].elements.length;i++)
	{
		if(document.forms[formName].elements[i].type=='checkbox' && document.forms[formName].elements[i].alt!='none')
			document.forms[formName].elements[i].checked = false;
	}
}

function checkElement(elementId)
{
	document.getElementById(elementId).checked = true;
}

/*function checkForm(formName, userId)
{
	var found = false;
	for(var i=0;i<document.forms[formName].elements.length;i++)
	{
		if(document.forms[formName].elements[i].type=='checkbox')
		{
			if(document.forms[formName].elements[i].checked==true)
			{
				found = true;
				break;
			}
		}
	}
	if(!found)
	{
		alert('Gelieve minimaal 1 gebruiker aan te vinken');
		checkElement('author_'+userId);
	}
	return found;	
}*/

dropDownEdited = false;

function setEndHour(beginDropDown)
{
	var endHouresDropDown = document.getElementById('endhoures');
	var startMinutesDropDown = document.getElementById('startminutes');
	if(endHouresDropDown.selectedIndex<beginDropDown.selectedIndex)
	{
		endHouresDropDown.options[beginDropDown.selectedIndex].selected = true;
	}
	setEndMinute(startMinutesDropDown);
}

function setEndMinute(beginDropDown)
{
	var startHouresDropDown = document.getElementById('starthoures');
	var endHouresDropDown = document.getElementById('endhoures');
	var endMinutesDropDown = document.getElementById('endminutes');
	if(startHouresDropDown.selectedIndex==endHouresDropDown.selectedIndex)
	{
		if(endMinutesDropDown.selectedIndex<beginDropDown.selectedIndex)
		{
			endMinutesDropDown.options[beginDropDown.selectedIndex].selected = true;
		}
	}
}

function checkEmpty(elementNames)
{
	var errorElements = new Array();
	var j=0;
	for(var i=0;i<elementNames.length;i++)
	{
		if(document.getElementById(elementNames[i]).value=='')
		{
			errorElements[j] = elementNames[i];
			j++;
		}
	}
	return errorElements;
}

function checkAgenda()
{
	var elementArray = new Array("mainhead");
	var errorElements = checkEmpty(elementArray);
	var errorMessage = '';
	if(errorElements.length != 0)
	{
		for(var k=0;k < errorElements.length;k++)
		{
			if(errorElements[k]=='mainhead')
			{
				errorMessage += 'Gelieve een titel in te vullen';
			}
		}
		alert(errorMessage);
		return false;
	}
	return true;
}

var currentlySelected = -1;
function selectOne(dropDown,optionid)
{
	if(currentlySelected!=-1 || optionid)
	{
		for(var i=0;i<dropDown.options.length;i++)
		{
			if(optionid)
			{
				if(dropDown.options[i].id==optionid)
					dropDown.options[i].selected = true;
				else
					dropDown.options[i].selected = false;
			}
			else
			{
				if(i==currentlySelected)
					dropDown.options[i].selected = false;
				if(i==dropDown.selectedIndex)
					dropDown.options[i].selected = true;
			}
		}
	}
	currentlySelected = dropDown.selectedIndex;
}

function mouseOver(adminButton)
{
	var splittedSrc = adminButton.src.split("/");
	var restSrc = "";
	fileName = splittedSrc[splittedSrc.length-1];
	for(var i=0;i<splittedSrc.length-1;i++)
	{
		restSrc += splittedSrc[i] + "/";
	}
	var splittedFileName = fileName.split(".");
	adminButton.src =  restSrc + splittedFileName[0] + "_hov" + "." + splittedFileName[1];
}

function mouseOut(adminButton)
{
	var splittedSrc = adminButton.src.split("/");
	var restSrc = "";
	fileName = splittedSrc[splittedSrc.length-1];
	for(var i=0;i<splittedSrc.length-1;i++)
	{
		restSrc += splittedSrc[i] + "/";
	}
	var splittedFileName = fileName.split(".");	
	var newFileName = splittedFileName[0].substring(0,splittedFileName[0].length-4);
	adminButton.src =  restSrc + newFileName + "." + splittedFileName[1];
}

function checkGroups()
{
	for(var i=0;i<document.forms.sendGroups.elements.length;i++)
	{
		if(document.forms.sendGroups.elements[i].type=="checkbox" && document.forms.sendGroups.elements[i].checked)
		{
			return true;
		}
	}
	alert('Gelieve een groep te kiezen.');
	return false;
}

function checkGroupAmount()
{
	var currentForm = document.forms[0];
	for(var i=0;i<currentForm.elements.length;i++)
	{
		if(currentForm.elements[i].type=="checkbox")
		{
			if(currentForm.elements[i].checked)
				return true;
		}
	}
	return confirm("Deze gebruiker is nu niet meer gekoppeld aan een groep. U vindt hem nu alleen nog terug in het overzicht van alle gebruikers.");
}

function displayFormat(dropDown)
{
	if(dropDown.options[dropDown.selectedIndex].value == 322)
		document.getElementById("obl_format").style.display = "";
	else
		document.getElementById("obl_format").style.display = "non";
}

function executeAction(action,actionObject)
{
	//alert(actionObject.id + ":" + action);
	switch(action)
	{
		case "display":
		{	
			if(actionObject.style.display!="")
				actionObject.style.display = "";
			break;
		}
		case "hide":
		{
			if(actionObject.style.display!="none")
				actionObject.style.display = "none";
			break;
		}
	}
}

function getElementValue(elementName)
{
	return document.getElementById(elementName).value;
}

function getElementLength(elementName)
{
	//alert(document.getElementById(elementName).value.length);
	return document.getElementById(elementName).value.length;
}

function setVisibility(element)
{
	if(document.getElementById(element) != undefined)
	{
		if(document.getElementById(element).style.display == "")
			document.getElementById(element).style.display = "none";
		else
			document.getElementById(element).style.display = "";
	}
}

function displayFormat(dropDown)
{
	if(dropDown.options[dropDown.selectedIndex].value == 1656)
		document.getElementById("obl_format").style.display = "";
	else
		document.getElementById("obl_format").style.display = "none";
}

function checkEmptyId(inputId)
{
	var translationArray = new Array(2);
	translationArray['content'] = '[[TRANSLATION.error_content]]';
	translationArray['mainhead'] = '[[TRANSLATION.error_mainhead]]';

	if(document.getElementById(inputId).value == '')
	{

		alert(translationArray[inputId]);
		return false;
	}
	return true;
}

function copyInputTo(copyFromElement,copyElementId) /* Copy the value from an element to another element onchange (e.g. menutitle to mainhead) */
{
	document.getElementById(copyElementId).value = document.getElementById(copyFromElement).value;
}

function createTarget(t)
{
    window.open("", t, "width=600,height=550,scrollbars=1");
    return true;
}

function getHTTPObject() {

  var xmlhttp;

  /*@cc_on

  @if (@_jscript_version >= 5)

    try {

      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    } catch (e) {

      try {

        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

      } catch (E) {

        xmlhttp = false;

      }

    }

  @else

  xmlhttp = false;

  @end @*/

  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {

    try {

      xmlhttp = new XMLHttpRequest();

    } catch (e) {

      xmlhttp = false;

    }

  }

  return xmlhttp;

}

function popUp(URL, width, height)
{
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+width+",height="+height+",left = 320,top = 272');");
}

function checkNumeric(textfield,message)		// Checks whether the userinput is numeric or not
{
	inputstring = textfield.value;
	for (i = 0; i < inputstring.length; i++)
	{
		ch = inputstring.substring(i, i+1);
		if (ch < "0" || ch > "9")
		{
			if(message != '')
				alert(message);
			textfield.value = textfield.value.substring(0, i);
			textfield.focus();
			return false;
		}
	}
	return true;
}


function handleLoginSubmit(form)
{

	if(!md5_vm_test())
	{
		return true;
	}
	else
	{

		p = document.getElementById('password').value;
		c = document.getElementById('challenge').value;

		document.getElementById('passwordS').value = hex_md5(hex_md5(p) + c);
		document.getElementById('loginnameS').value = document.getElementById('loginname').value
		document.getElementById('shadowForm').submit(); 
		return false;
	}

}

function generateRandomString(length) 
{
    
	var retVal = '';
    
	for (i=0; i < length; i++) 
	{
		retVal += String.fromCharCode((parseInt(Math.random() * 1000) % 94) + 33);
	}
  
	return retVal;
}

var emptiedElements = new Array();
function js_in_array(the_needle, the_haystack)
{
	var the_hay = the_haystack.toString();
	if(the_hay == ''){
		return false;
	}
	var the_pattern = new RegExp(the_needle, 'g');
	var matched = the_pattern.test(the_haystack);
	return matched;
}

function emptyValue(element)
{
	if(!js_in_array(element.id,emptiedElements))
	{
		emptiedElements[emptiedElements.length] = element.id;
		element.value='';
	}
}

var fixedModuleWindows = new Array();

function showModuleInfoDiv(elmId)
{
	if (!js_in_array(elmId, fixedModuleWindows))
	{
		scrollTop = window.getScrollTop();
		topCoord = scrollTop+20;

		document.getElementById(elmId).style.top = topCoord+'px';
		document.getElementById(elmId).style.left = '20px';
		document.getElementById(elmId).style.display = 'block';
	}
}

function clickModuleWindow(elmId)
{
	if (js_in_array(elmId, fixedModuleWindows))
	{
		// Remove this module window from the array
		tempArray = new Array();

		for (i=0; i<fixedModuleWindows.length; i++ )
		{
			if (fixedModuleWindows[i] != elmId)
			{
				tempArray[tempArray.length] = fixedModuleWindows[i];
			}
		}

		fixedModuleWindows = tempArray;
		delete tempArray;

		document.getElementById(elmId).style.display = 'none'; // Hide the module window
	}
	else
	{
		fixedModuleWindows[fixedModuleWindows.length] = elmId; // Put this module window in the array
		new Drag.Move($(elmId), {'container': bodyC});
		$(elmId).style.cursor = 'move';
	}
}

function moduleWindowOut(elmId)
{
	if (!js_in_array(elmId, fixedModuleWindows))
	{
		document.getElementById(elmId).style.display = 'none'; // Hide the module window
	}
}

function changeDivContents(url, divName)
{ 
	if (url != undefined && divName != undefined)
	{
		new Ajax(url, {update: $(divName), evalScripts: true, onComplete: function()
		{
		

		}}).request();
	}
}

function changeCartStatus(url, divName)
{
	changeDivContents(url, divName);

	(function()
	{
		a_otherDivs = {'add_to_cart_wrapper_sidebar' : 'add_to_cart_wrapper', 'add_to_cart_wrapper' : 'add_to_cart_wrapper_sidebar'};

		if (document.getElementById(a_otherDivs[divName]) != undefined)
		{
			document.getElementById(a_otherDivs[divName]).innerHTML = document.getElementById(divName).innerHTML;
		}
	}).delay(150, '', divName);
}

function modifyNumProductsInCart(modus)
{

	if (modus == 'add')
	{
		numProductsInCart = parseInt(numProductsInCart)+1;
	}
	else if (modus != 'add' && numProductsInCart > 0)
	{
		numProductsInCart = parseInt(numProductsInCart)-1;
	}

	document.getElementById('productInCartCounter').innerHTML = numProductsInCart;
}

function toggleProductMenuItem(elmId)
{
	for (i=0; i<allTabIds.length; i++)
	{		
		if (allTabIds[i] == elmId) // Clicked tab
		{
			styleSuffix = '_style_active';		
		}
		else // Inactive tab
		{
			styleSuffix = '_style';			
		}	
		
		document.getElementById(allTabIds[i]).className = allTabIds[i]+styleSuffix;
	}
}

function trimAll(sString) 
{
	while (sString.substring(0,1) == ' ')
	{
		sString = sString.substring(1, sString.length);
	}

	while (sString.substring(sString.length-1, sString.length) == ' ')
	{
		sString = sString.substring(0,sString.length-1);
	}
	
	return sString;
}


function validateSysForm(elementsToCheck)
{	
	if (elementsToCheck != undefined)
	{		
		tinyMCE.triggerSave();
		var numErrors = 0;

		for (i=0; i<elementsToCheck.length; i++)
		{			
			if (trimAll(document.getElementById(elementsToCheck[i]).value) == '')
			{
				document.getElementById(elementsToCheck[i]+'Error').style.display = 'block';				
				numErrors++;
			}
			else
			{
				document.getElementById(elementsToCheck[i]+'Error').style.display = 'none';
			}
		}

		if (document.getElementById('forcetypeName') && document.getElementById('forcetypeName').value != '')
		{
			forceTypeChecked = /^\w*$/i.test(document.getElementById('forcetypeName').value);

			if (!forceTypeChecked)
			{
				document.getElementById('forcetypeNameError').style.display = 'block';	
				numErrors++;
			}
			else
			{
				forcetypeName = document.getElementById('forcetypeName').value;				
				forcetypeName.toLowerCase();

				if (reservedForcetypeNames && reservedForcetypeNames.contains(forcetypeName))
				{
					document.getElementById('forcetypeNameError').style.display = 'block';				
					numErrors++;
				}
			}
		}

		if (numErrors > 0)
		{
			alert('Er zijn een of meerdere velden niet (correct) ingevuld.');
			return false;
		}
		else
		{
			return true;
		}
	}
}

function validateDutchZipCode(strPC)
{ 
	return typeof strPC=='string' ?strPC.match(/[1-9][0-9]{3}?[a-zA-Z]{2}/)==strPC:false;
}

function inInteger(s)
{
	var isInt = /^-?\d+$/.test(s);

	if (isInt)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function validateEmail(emailAddress)
{
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(emailAddress))
		return true;

	return false;
}



function resizeFonts(fontsize)
{
    if (fontsize == 1)
    {
        document.getElementById('bodyContainer').className='smallSize';
		setFontsizeInCookie('smallSize');
    }
    else if (fontsize == 2)
    {
        document.getElementById('bodyContainer').className='normalSize';
		setFontsizeInCookie('normalSize');
    }
    else
    {
        document.getElementById('bodyContainer').className='largeSize';
		setFontsizeInCookie('largeSize');
    }
}

function changeImage(img_id, img_src)
{
    document.getElementById(img_id).src = img_src;
}

function setFontsizeInCookie(className)
{
	var cookie_date = new Date();
	cookie_date.setYear(cookie_date.getFullYear()+1);    
	document.cookie = "fontSize=" + className + ";expires="+cookie_date.toGMTString()+";path=/;";    
}

function displayFaqComment(faqItemNumber, openCommentSpan)
{
	/*for (var i = 1; i <= numberOfItems ; i++)
	{
		document.getElementById('answer_question_' + i ).style.display= "none";
	}*/

	var style = document.getElementById(faqItemNumber).style.display;

	if (style == 'none')
	{
			document.getElementById(faqItemNumber).style.display= "block";
			document.getElementById(openCommentSpan).className = "faqCommentArrowDown";
			//document.getElementById(openCommentSpan).innerHTML = 'Was deze informatie nuttig? <img src="/images/bluearrowDown.gif" alt="" />';
	}
	else
	{
			document.getElementById(faqItemNumber).style.display= "none";
			document.getElementById(openCommentSpan).className = "faqCommentArrowUp";
			//document.getElementById(openCommentSpan).innerHTML = 'Was deze informatie nuttig? <img src="/images/bluearrow.gif" alt="" />';	
	}

}


// Declaring required variables
var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
s=stripCharsInBag(strPhone,validWorldPhoneChars);
return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}

function removeSpaces(string) {
	var tstring = "";
	string = '' + string;
	splitstring = string.split(" ");
	for(i = 0; i < splitstring.length; i++)
	tstring += splitstring[i];
	return tstring;
}

function resetBreadcrumbContent()
{
	document.getElementById('breadcrumbContainer').innerHTML = breadCrumbContents;
}

function resetProductMainheadContent(mainheadString)
{
	if (mainheadString == '')
	{
		mainheadString = productMainheadContents;
	}

	$('productMainhead').remove();

	var layer = $('productMainheadWrapper');
	var h3 = document.createElement('h3');

	h3.appendChild(document.createTextNode(mainheadString));
	h3.setAttribute('id', 'productMainhead');	
	layer.appendChild(h3);	
	$('productMainhead').className = 'productMainhead';	

	sIFR.replace(dszwFont, {
	selector: 'h3.productMainhead'
	,css: [
	'.sIFR-root { color: #3366FF; font-size:18px; font-weight:normal; }'
	]
	, wmode: 'transparent'
	,fitExactly: true
	,tuneHeight: '-2' 
	});	
}

function isDate(dateStr)
{
	var datePat = /^(\d{1,2})(\/|-)(\d{1,2})(\/|-)(\d{4})$/;
	var matchArray = dateStr.match(datePat);

	if (matchArray == null)
	{
		alert('Voer uw geboortedatum in volgens het volgende formaat: dd-mm-jjjj.');
		return false;
	}

	day = matchArray[1]; 
	month = matchArray[3];
	year = matchArray[5];

	if (month < 1 || month > 12)
	{
		alert('De geboortemaand moet liggen tussen 1 en 12.');
		return false;
	}

	if (day < 1 || day > 31)
	{
		alert('De geboortedag moet liggen tussen 1 en 31.');
		return false;
	}

	if ((month==4 || month==6 || month==9 || month==11) && day==31)
	{
		alert('De gekozen geboortemaand heeft geen 31 dagen.');
		return false;
	}

	if (month == 2)
	{
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
		
		if (day > 29 || (day==29 && !isleap)) 
		{
			alert('Februari ' + year + ' heeft geen ' + day + ' dagen.');
			return false;
		}
	}

	return true;
}

function checkForValidDate(dateValue)
{
	dateValueParts = dateValue.split('-');

	if (!isDate(dateValueParts[0] + '/' + dateValueParts[1] + '/' + dateValueParts[2]))
	{ 
		return(false); 
	}

	return(true);
}

function toggleConstants()
{
	if ($('myObj').style.display == 'none')
	{
		$('myObj').style.display = 'block';
		$('toggleConstantsButton').innerHTML = 'Verberg constanten';
	}
	else
	{
		$('myObj').style.display = 'none';
		$('toggleConstantsButton').innerHTML = 'Toon constanten';
	}
}