/********************************************************************************
* DATUM:		AUTHEUR:	ISSUE:		OMSCHRIJVING:							*
*********************************************************************************
* 14-03-2008	SBLOKKER	---			voor het gebruik van oplichtende		*
*										invulvelden voor =< IE7					*
*********************************************************************************
* 20-03-2008	RKLANKE		---			Step1_validator verwijderd, omdat deze	*
*										niet meer gebruikt wordt nu de			*
*										"TMT_VALIDATOR"	gebruikt wordt			*
* 25-03-2008	RKLANKE		---			(tijdelijk terug gezet)					*
*********************************************************************************
* 30-05-2008	RKLANKE		---			Extra fuction voor de"TMT_VALIDATOR" om *
*										automatisch een moreInfo button te		*
*										genereren								*
*********************************************************************************
* 04-06-2008	RKLANKE		---			Extra fuction voor de rollovers van een	*
*										tabel met "rowspans"					*
*********************************************************************************/

var GB_ROOT_DIR = "/nl/welkom/data/greybox/";
var GB_myShow, AJS, AJSDeferred, script_loaded, GB_hide, GreyBox, _GB_update, _GB_setOverlayDimension, GB_showImage, GB_showPage, GB_Gallery,
	GB_showFullScreenSet, GB_showImageSet, GB_Sets, GB_show, GB_showCenter, GB_showFullScreen, GB_Window, ns_pixelUrl, ns_0, ns_1, i, j;

/*
function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }
  return elements;
}
*/
function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name){
	if (document.cookie.length>0){
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1){ 
			c_start=c_start + c_name.length+1; 
			c_end=document.cookie.indexOf("';",c_start);
			if (c_end==-1) c_end=document.cookie.length;
				return unescape(document.cookie.substring(c_start,c_end));
		} 
	 }
	return "";
}

function search_post(name){
	var searchkey = (name=='searchform')? 'search_key' : 'search_key2';
	if($(searchkey)){
		var key = $(searchkey).value; 
		if(key == '' || key == 'zoeken...'){
			alert("Er is geen onderwerp opgegeven waarop gezocht kan worden.")
		}else{
			$(name).submit();	
		}
	}
}

function clearInput(input, notvalue){
	if(input.getAttribute('value') == notvalue){
		input.setAttribute('value','');
		input.value = '';
	}	
}

// DEL 20-03-2008 RKLANKE
// deze kan als het goed is weg wanneer de "TMT_VALIDATOR"
// gebruikt gaat worden
/*
function check_step1(){
	var sMsg = ""
	var form = document.formNewMember

	if (form.frmInitials.value == "")	sMsg += "Uw initialen zijn niet ingevuld.\n";
	if (form.frmName.value == "")		sMsg += "Uw naam is niet ingevuld.\n";
	if (form.frmStreet.value == "")	sMsg += "De straatnaam is niet ingevuld.\n";
	if (form.frmNubmer.value == "")	sMsg += "Het huisnummer is niet ingevuld.\n";
	
	else {
		var nr = document.formNewMember.frmHuisnummer.value;
		if (isNaN(parseInt(nr)))							sMsg += "Het huisnummer is niet geldig.\n";
	}

	sPostcode = document.frmKlantworden.frmPostcode.value;
	re = /\ /g;
	sPostcode = sPostcode.replace(re,"");
	sPostcode = sPostcode.toUpperCase();
	document.frmKlantworden.frmPostcode.value = sPostcode;

	if (document.frmKlantworden.frmLand.value.toLowerCase() == "nederland") {
		rgx = new RegExp("([0-9]{4}[A-Za-z]{2})");
		bValid = rgx.test(sPostcode);
		if (sPostcode == "")	{
				sMsg += "De postcode is niet ingevuld.\n";
			} 
		else 
			{
				if (((!bValid) || (sPostcode.length > 6)) && (document.frmKlantworden.frmLand.value.toLowerCase() == "nederland")) 
				{
					sMsg += "De postcode is niet geldig.\n";
				}
			}
	}

	if (document.frmKlantworden.frmWoonplaats.value == "")	sMsg += "De woonplaats is niet ingevuld.\n"
	if (document.frmKlantworden.frmLand.value == "")		sMsg += "Het land is niet ingevuld.\n"


	//if (document.frmKlantworden.nieuwsbrief[0].checked) {
		var sEmail = document.frmKlantworden.frmEmail.value;
		if (sEmail == "") 
		{
			sMsg += "Het e-mailadres is niet ingevuld.\n"
		} 
		else 
		{
			rgx = new RegExp("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$","gi")
			bValid = rgx.test(sEmail)
			if (!bValid) 
			{
				sMsg += "Het e-mailadres is niet geldig.\n"
			}
		}
	
	//} else {
	//	var sEmail = document.frmKlantworden.frmEmail.value;
	//	if (sEmail != "") {
	//		rgx = new RegExp("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$","gi")
	//		bValid = rgx.test(sEmail)
	//		if (!bValid) 
	//		{
	//			sMsg += "Emailadres is niet geldig.\n"
	//		}
	//	}
	//}
	

		if (	(document.frmKlantworden.frmTelefoondag.value == "") && 
				(document.frmKlantworden.frmTelefoonavond.value == "") && 
				(document.frmKlantworden.frmTelefoonmob.value == "")
		) {
			sMsg += "Tenminste één telefoonnummer moet worden ingevuld.\n";
		} else {
				if (!IsNumeric(document.frmKlantworden.frmTelefoondag.value)) {
					sMsg += "Telefoonnummer overdag is niet geldig.\n";
				}
				if (!IsNumeric(document.frmKlantworden.frmTelefoonavond.value)) {
					sMsg += "Telefoonnummer 's avonds is niet geldig.\n";
				}
				if (!IsNumeric(document.frmKlantworden.frmTelefoonmob.value)) {
					sMsg += "Telefoonnummer mobiel is niet geldig.\n";
				}
		}



	if (sMsg != "") {
		alert("Het formulier kan niet worden verstuurd om de volgende reden(en):\n\n" + sMsg)
		return false;
	}else {
		//document.frmKlantworden.submit()
		return true;
	}
}

*/
function IsNumeric(sText){
	var ValidChars = "0123456789./- ";
	var IsNumber=true;
	var Char;

	for (i = 0; i < sText.length && IsNumber == true; i++) { 
		Char = sText.charAt(i); 
		if (ValidChars.indexOf(Char) == -1) {
			IsNumber = false;
		}
	}
	return IsNumber;
}

function info_per_email(){
	var bOk = true
	sMsg= "Het formulier kan niet worden verstuurd om de volgende reden(en):\n\n"
	//if (x == "email") {
		var sEmail = document.frmInfoPerMail.email.value
		rgx = new RegExp("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}\$","gi")
		bValid = rgx.test(sEmail)
		if (document.frmInfoPerMail.email.value == "") {
			sMsg+= "E-mail adres is niet ingevuld.\n"
			bOk = false
		} else {
			if (!bValid) {
				sMsg+= "E-mailadres is niet geldig.\n"
				bOk = false
			}
		}
	//}
	if (bOk) {
		document.frmInfoPerMail.submit()
	} else {
		alert(sMsg)
	}
}

// INS 26-02-2008 RKLANKE 
// voor het gebruik van een link i.p.v. een normale submit button
function submitlink(formName){

	var formObj = $(formName);
	var validate = tmt_validateForm(formObj);

	if(validate == true) formObj.submit();
}

// INS 13-03-2008 RKLANKE 
// voor het gebruik van een link i.p.v. een normale submit button
//(OLD...wanneer de tmt_validator gebruikt gaat worden is deze functie overbodig)
/*
function submitlink2(){

	var validate = check_step1();
	
	//if(validate == true) document.formNewMember.submit();
}
*/

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

function light_popup(file, title, width, height){
	window.open(file,title,'location=0, menubar=0, resizable=1, scrollbars=0, status=0, titlebar=0, toolbar=0, width='+width+', height='+height+', top=200, left=200');
}


// INS 14-03-2008 SBLOKKER
// voor het gebruik van oplichtende invulvelden voor =< IE7
function setStyle(x){
	var item = $(x); 
	item.style.border="1px solid #002A5F";
	item.style.background= "url(/nl/welkom/data/img/form_focus.gif)";
}
function resetStyle(x){
	var item = $(x); 
	item.style.border="1px solid #CFCFCF";
	item.style.background= "url(/nl/welkom/data/img/form.gif)";
}

// voor het gebruik van het tonen of hiden van 2 telefoonnummervelden
function toggleDivOL( elemID ){
	var elem = $( elemID );
	var info = $('meer_info');
	if( elem.style.display == '' || elem.style.display =='none' ){
		elem.style.display = "block";
		info.innerHTML = "Minder nummers";
	}	else	{
		elem.style.display = "none";
		info.innerHTML = "Meer nummers";
	}
}

// INS 19-03-2008 RKLANKE
// verplaatst vanuit de broncodes (open_rekening.asp enz).
// aangezien overal common.js doorgevoerd is, is het zonde dit in de broncode zelf te zetten.
// (niet verplaatsen naar "script_tmt_validator.js vanwege de e.v.t. updates hiervan")
//
// altijd proberen javascript uit de broncode zelf te houden. 
// het voordeel is nu dat we displayError overal kunnen hergebruiken i.p.v. overal te copieren.
/*function displayError(formNode, validators){
	var listNode = document.createElement("ul");
	for(var i=0;i<validators.length;i++){
	   var itemNode = document.createElement("li");
	   itemNode.appendChild(document.createTextNode(validators[i].message));
	   listNode.appendChild(itemNode);
	}
	var displayNode = document.getElementById("errorDisplay");
	displayNode.style.display = "block";
	displayNode.replaceChild(listNode, displayNode.firstChild);
}
*/
// INS 19-03-2008 RKLANKE
// Deze gebruiken i.p.v. de eigen gemaakte schermopties zoals: GB_myShow-wide
GB_myShow = function(caption, url, height, width, callback_fn) {
	var options = {
		caption: caption,
		height: height || 590,
		width: width || 790,
		fullscreen: false,
		show_loading: false,
		callback_fn: callback_fn
	}
	var win = new GB_Window(options);
	return win.show(url);
};


// INS 20-03-2008 RKLANKE
// dit gedeelte hoort eigenlijk bij "TMT_VALIDATOR", maar heb 
// het hier gezet om te voorkomen dat het wordt overschreven bij een update van "TMT_VALIDATOR"
// (er zijn wel kleine veranderingen in aangemaakt. dus check deze)
var tmt_globalTelErr = 0;
var tmt_globalTel    = 0;

// Create a validator for text and texarea fields
function tmt_phoneValidatorFactory(fieldNode, fieldArray){
	// Create a generic validator, than add specific properties and methods as needed
	var obj = new tmt_abstractValidator(fieldNode);
	obj.type = "text";
	var required = false;
	if(fieldNode.getAttribute("tmt:required")){
		required = fieldNode.getAttribute("tmt:required");
	}
	// Put focus and cursor inside the field
	obj.getFocus = function(){
		// This try block is required to solve an obscure issue with IE and hidden fields
		try{
			fieldNode.focus();
			fieldNode.select();
		}
		catch(exception){
		}
	}
	// Check if the field is empty
	obj.isEmpty = function(){
		return fieldNode.value == "";
	}
	// Check if the field is required
	obj.isRequired = function(){
		return required;
	}
	// Check if the field satisfy the rules associated with it
	// Be careful, this method contains multiple exit points!!!
	obj.isValid = function(){
		
		var lngt = fieldArray.length;
		var item;

		for(var x = 0; x<lngt; x++ ){
			item = fieldArray[x];
			if(item.getAttribute('tmt:phonenumber') && item.value!=""){
				tmt_globalTel ++;
			}
		}

		if(tmt_globalTel == 0 && tmt_globalTelErr == 0 ){
			tmt_globalTelErr ++;
			return false;
		}else{
			return true;
		}
	}
	return obj;
}

//INS 30-05-2008 RKLANKE
var tmt_infoButton;

tmt_infoButton = Class.create();

tmt_infoButton.prototype = {
	initialize: function(){
		var itemInfo;
		var itemDiv;
		var itemSpn2;
	},
	button: function(element, name){
		this.itemDiv  = document.createElement("div");
		var itemUrl   = document.createElement("a");
		var itemSpn   = document.createElement("span");
		var itemTxt   = document.createTextNode("info");
		this.itemInfo = document.createElement("div");
		this.itemSpn2 = document.createElement("span");
	
		itemUrl.href = "javascript:void(0)";
		this.itemDiv.className = name;
		this.itemInfo.className = name + "_Text";
		this.itemInfo.style.display = "none";
		this.itemInfo.style.position = "absolute";
		
		itemSpn.appendChild(itemTxt);
		itemUrl.appendChild(itemSpn);
		this.itemDiv.appendChild(itemUrl);
		element.parentNode.appendChild(this.itemDiv);
		this.itemInfo.appendChild(this.itemSpn2);
		element.parentNode.appendChild(this.itemInfo);
	},
	info: function(element){
		var button;
		var previous_btn;
		var nw1, nw2;

		Element.cleanWhitespace(element.parentNode);
		
		//kijk of er al een infobutton staat.
		//zo ja, voeg de teksten samen.
		previous_btn = element.parentNode.lastChild;
			
		if(previous_btn && previous_btn.className == "formInfo_Text"){			
			
			nw1 = previous_btn.firstChild.innerHTML;
			nw2 = element.getAttribute("tmt:info");
			previous_btn.firstChild.innerHTML = "<ul><li>" + nw1 + "</li><li>" + nw2 +"</li></ul>";
			
		}else{
			button = this.button(element, "formInfo");
				
			this.itemSpn2.innerHTML = element.getAttribute("tmt:info");

			Event.observe(this.itemDiv, 'mouseover', this.showInfo.bind(this));
			Event.observe(this.itemDiv, 'mouseout', this.hideInfo.bind(this));
		}
	},
	error: function(element){
		var button;
		var previous_btn;
		var nw1, nw2;

		Element.cleanWhitespace(element.parentNode);
		
		//kijk of er al een errorbutton staat.
		//zo ja, voeg de teksten samen.
		previous_btn = element.parentNode.lastChild;

		if(previous_btn && previous_btn.className == "formError_Text"){			
			
			nw1 = previous_btn.firstChild.innerHTML;
			nw2 = element.getAttribute("tmt:message");
			previous_btn.firstChild.innerHTML = "<ul><li>" + nw1 + "</li><li>" + nw2 +"</li></ul>";
			
		}else{
			
			button = this.button(element, "formError");
				
			this.itemSpn2.innerHTML = element.getAttribute("tmt:message");

			Event.observe(this.itemDiv, 'mouseover', this.showInfo.bind(this));
			Event.observe(this.itemDiv, 'mouseout', this.hideInfo.bind(this));
		}
	},
	showInfo: function(){
		
		var position = Position.cumulativeOffset(this.itemDiv);
		var x = position[0];
		var y = position[1];
		var w = this.itemDiv.offsetWidth;
		var h = this.itemDiv.offsetHeight;
				
		this.itemInfo.style.display = "block";
		var iets1 = Math.round(w-2);
		var iets2 = Math.round(this.itemInfo.offsetHeight/2) - ( h/2);
				
		this.itemInfo.style.left = x + iets1 + "px";
		this.itemInfo.style.top  = y - iets2 + "px";
	},
	hideInfo: function(){
		this.itemInfo.style.display = "none";
	},
	clearButtons: function(){
		
		var elementsx;
		var elementsy;
		var elementsxx;
		var elementsyy;
		var elements;

			elementsx = document.getElementsByClassName("formInfo");
			elementsy = document.getElementsByClassName("formError");
			elementsxx = document.getElementsByClassName("formInfo_Text");
			elementsyy = document.getElementsByClassName("formError_Text");
			
			elements = elementsx.concat(elementsy, elementsxx, elementsyy);
		
		for(var i=0; i < elements.length; i++){
				var item = elements[i];
				var parent = item.parentNode;				
				Element.cleanWhitespace(item.parentNode);
				item.parentNode.removeChild(item);
		}
		
		//printfire('verwijder alle knoppen, incl. infoButtons en errorButtons');
	},
	handleEvent: function(){}

}

function tmt_checkForInfo(element){
	//INS 30-05-2008 RKLANKE
	if(element.getAttribute("tmt:info")){			
		//tmt_infoButton(this,fieldsArray[i]);
		var info = new tmt_infoButton;
			info.info(element);			
	}else{
		Element.cleanWhitespace(element.parentNode);
	}
}

//INS 04-06-2008 RKLANKE
var tableRollOver;

tableRollOver = Class.create();

tableRollOver.prototype = {
	initialize: function(){
		var table = $('mytable');
		var elements = table.getElementsByTagName("tr");
	
		for(var i=0; i < elements.length; i++){
			Element.cleanWhitespace(elements[i]);
			Event.observe(elements[i], 'mouseover', this.rollover.bind(elements[i]));
			Event.observe(elements[i], 'mouseout', this.rollout.bind(elements[i]));
		}
	},
	rollover: function(){
		var parent = this.parentNode;
		
		for(var i = 0; i < parent.childNodes.length; i++){
			for(var j = 0; j < parent.childNodes[i].childNodes.length; j++){
				if(parent.childNodes[i].childNodes[j].getAttribute('rowspan') > 1){
					parent.childNodes[i].childNodes[j].className += " hover";
				}		
			}
		}	
	},
	rollout: function(){
		var parent = this.parentNode;
		
		for(var i = 0; i < parent.childNodes.length; i++){
			for(var j = 0; j < parent.childNodes[i].childNodes.length; j++){
				if(parent.childNodes[i].childNodes[j].getAttribute('rowspan') > 1){
					parent.childNodes[i].childNodes[j].className = parent.childNodes[i].childNodes[j].className.replace(/\s*hover/, "");
				}		
			}
		}	
	},
	handleEvent: function(){} //RKLANKE error in FF
}

function displayError(formNode, validators){}


function getTvProducts(bank){

	if(!this.window) bank = this;

	var url     = '/fr/accueil/tarifs/load_elements.asp';
	var element = 1;
	var param   = 'element=' + element + '&bank='+bank.value;

	//document.cookie = "product = 10" ;

	var oke = new Ajax.Request(url,{method: 'post', parameters: param, onComplete:changeTvProducts.bind(this), contentType:'text/xml', encoding:'UTF-8' });
}


function changeTvProducts(value){
	
	var element = $('fm_product');
	var opt = element.options;
	var txt = value.responseText;
	var xml = value.responseXML.documentElement;
	
	element.innerHTML = "";

	element.disabled = (txt == "")? true : false;
	
	if(typeof xml == "object"){
		Element.cleanWhitespace(xml);
	}

	opt.length = 0;
	
	for(var i=0;i<xml.childNodes.length;i++){
		
		var text  = xml.childNodes[i].getElementsByTagName('text')[0].firstChild.nodeValue;
		var value = xml.childNodes[i].getElementsByTagName('value')[0].firstChild.nodeValue;
		var select= (getCookie("product") == value)? "selected" : "";
		
		opt[i] = new Option();
		opt[i].selected = select;
		opt[i].value = value;
		opt[i].text  = text;
	}
}

// INS 20-03-2008 RKLANKE PRINTFIRE
// om variabelen in firebug te printen
function printfire() {
   if (document.createEvent){
    
	printfire.args =  arguments;
    // console.log(arguments);
	console.log('', arguments);
	// console.warn(arguments);
	// var ev = document.createEvent("Events");
    //  ev.initEvent("printfire", false, true );
    //  dispatchEvent(ev);
   }
}

if (document.images)
{
  var pic1, pic2, pic3, pic4, pic5, pic6, pic7, pic8, pic9, pic10;

  pic1= new Image(92,30); 
  pic1.src="/nl/accueil/data/img/nav_button_01-hover.gif"; 

  pic2= new Image(100,30); 
  pic2.src="/nl/accueil/data/img/nav_button_02-hover.gif"; 

  pic3= new Image(83,30); 
  pic3.src="/nl/accueil/data/img/nav_button_03-hover.gif"; 
  
  pic4= new Image(160,30); 
  pic4.src="/nl/accueil/data/img/nav_button_04-hover.gif"; 

  pic5= new Image(97,30); 
  pic5.src="/nl/accueil/data/img/nav_button_05-hover.gif"; 

  pic6= new Image(92,30); 
  pic6.src="/nl/accueil/data/img/nav_button_01-hactive.gif"; 

  pic7= new Image(100,30); 
  pic7.src="/nl/accueil/data/img/nav_button_02-hactive.gif"; 

  pic8= new Image(83,30); 
  pic8.src="/nl/accueil/data/img/nav_button_03-hactive.gif"; 
  
  pic9= new Image(160,30); 
  pic9.src="/nl/accueil/data/img/nav_button_04-hactive.gif"; 

  pic10= new Image(97,30); 
  pic10.src="/nl/accueil/data/img/nav_button_05-hactive.gif"; 

}

