		var flash2Installed  = false;	// boolean. true if flash 2 is installed
	var flash3Installed  = false;	// boolean. true if flash 3 is installed
	var flash4Installed  = false;	// boolean. true if flash 4 is installed
	var flash5Installed  = false;	// boolean. true if flash 5 is installed
	var flash6Installed  = false;	// boolean. true if flash 6 is installed
	var flash7Installed  = false;	// boolean. true if flash 7 is installed
	var flash8Installed  = false;	// boolean. true if flash 8 is installed
	var flash9Installed  = false;	// boolean. true if flash 9 is installed
	var flash10Installed = false;	// boolean. true if flash 10 is installed
	var maxVersion       = 10;    // highest version we can actually detect
	var actualVersion    = 0;     // version the user really has
	var hasRightVersion  = false;  // boolean. true if it's safe to embed the flash movie in the page
	
	// true if we're on ie
	var isIE  = (navigator.appVersion.indexOf('MSIE') != -1) ? true : false;
	// true if we're on windows
	var isWin = (navigator.appVersion.toLowerCase().indexOf('win') != -1) ? true : false;
	
	
	function swf(idname, flashURL, swfWidth, swfHeight, reqVersion, GETURL) {
		htmlCode = '';
		hasRightVersion = detectFlash(reqVersion);
		if (hasRightVersion === true) {
			htmlCode += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="' + swfWidth + 'px" height="' + swfHeight + 'px">';
			htmlCode += '<param name="allowScriptAccess" value="crossDomain" />';
			htmlCode += '<param name="movie" value="' + flashURL + "?" + GETURL + '" />';
			htmlCode += '<param name="quality" value="best" />';
			htmlCode += '<param name="menu" value="false" />';
			htmlCode += '<param name="wmode" value="transparent" />';
			htmlCode += '<embed menu="false" wmode="transparent" quality="best" src="' + flashURL + '?' + GETURL + '" width="' + swfWidth + 'px" height="' + swfHeight + 'px" />';
			htmlCode += '</object>';
			document.getElementById(idname).innerHTML = htmlCode;
		}
	}
	
	// DETECTION FLASH PLAYER
	function detectFlash(requiredVersion) {
		if (isIE && isWin) {
			// Write vbscript detection on ie win. IE on Windows doesn't support regular JavaScript plugins array detection.
			document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
			document.write('on error resume next \n');
			document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
			document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
			document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
			document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
			document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
			document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
			document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
			document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
			document.write('<\/SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script
		}
		
		if (navigator.plugins && (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"])) {
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			
			var flashVersion = parseInt(flashDescription.substring(16));
			flash2Installed  = flashVersion == 2;
			flash3Installed  = flashVersion == 3;
			flash4Installed  = flashVersion == 4;
			flash5Installed  = flashVersion == 5;
			flash6Installed  = flashVersion == 6;
			flash7Installed  = flashVersion == 7;
			flash8Installed  = flashVersion == 8;
			flash9Installed  = flashVersion == 9;
			flash10Installed = flashVersion >= 10;
		}
	  
		// Loop through all versions we're checking, and set actualVersion to highest detected version.
		for (var i = 2; i <= maxVersion; i++) {
			if (eval("flash" + i + "Installed") == true) {
				actualVersion = i;
			}
	  }
		
		// If we're on msntv (formerly webtv), the version supported is 4 (as of January 1, 2004).
		// Note that we don't bother sniffing varieties of msntv. You could if you were sadistic...
		if (navigator.userAgent.indexOf("WebTV") != -1) {
			actualVersion = 4;
	  }
	  if (actualVersion >= requiredVersion) {
			hasRightVersion = true;
	  }
		else {
			hasRightVersion = false;
		}
		
		//alert("requiredVersion: " + requiredVersion + " - actualVersion: "+actualVersion +  " " + " - hasRightVersion: " + hasRightVersion + "  " + " - maxVersion: "+maxVersion);
		return hasRightVersion;
	}
	
	// TOP MENU IE6 HOVER DETECTION
	<!--//--><![CDATA[//><!--
	startList = function() {
		if (document.all&&document.getElementById) {
			navRoot = document.getElementById('nav');
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName == "LI") {
					node.onmouseover = function() {
						this.className+= ' over';
					}
					node.onmouseout = function() {
						this.className = this.className.replace(' over', '');
					}
				}
			}
		}
	}
	//window.onload = startList;
	//--><!]]>
	
	function labelHide(){
		document.getElementById('hideLabel').innerHTML = '<a href="#" onclick="labelShow();">toon alle ongeselecteerde telefoons</a>';
		document.getElementById('tr_5').style.display = 'none';
		document.getElementById('tr_12').style.display = 'none';
	}
	function labelShow(){
		document.getElementById('hideLabel').innerHTML = '<a href="#" onclick="labelHide();">verberg alle ongeselecteerde telefoons</a>';
		document.getElementById('tr_5').style.display = 'table-row';
		document.getElementById('tr_12').style.display = 'table-row';
	}
	function MM_displayStatusMsg(msgStr) { //v1.0
	  status = msgStr;
	  document.MM_returnValue = true;
	}
	function showPictures(status){
		for (var i =1; i<=11; i++) {
			document.getElementById('img_'+i).style.display = status;
		}
	}
	
	function leesmeer(divId) {
		if ((document.getElementById(divId).style.display == 'block')) {
			document.getElementById(divId).style.display = 'none';
		}
		else {
			document.getElementById(divId).style.display = 'block';
		}
		SetCookie(divId, document.getElementById(divId).style.display, '', '/');  
	}
	
	/* COOKIE READ WRITE FOR MATRIX*/
	function getCookieVal(offset) {
		var endstr = document.cookie.indexOf (";", offset);
		if (endstr == -1) {
			endstr = document.cookie.length;
		}
		return unescape(document.cookie.substring(offset, endstr));
	}
	
	function GetCookie(name) {
		var arg = name + '=';
		var alen = arg.length;
		var clen = document.cookie.length;
		var i = 0;
		while (i < clen) {
			var j = i + alen;
			if (document.cookie.substring(i, j) == arg)
			return getCookieVal (j);
			i = document.cookie.indexOf(" ", i) + 1;
			if (i == 0) break; 
		}
		return null;
	}
	
	function writeCookie(p_sName, p_sValue){
		var w_aArgv       = writeCookie.arguments;
		var w_iArgc       = writeCookie.arguments.length;
		var p_sExpireDays = ((w_iArgc > 2) &&  (w_aArgv[2] != '')) ? w_aArgv[2] : null;
	 	SetCookie(p_sName, p_sValue, p_sExpireDays);
	}

	function SetCookie(p_sName, p_sValue) {
		var w_aArgv       = SetCookie.arguments;
		var w_iArgc       = SetCookie.arguments.length;
		var p_sExpireDays = ((w_iArgc > 2) &&  (w_aArgv[2] != '')) ? w_aArgv[2] : null;
		var p_sPath       = ((w_iArgc > 3) &&  (w_aArgv[3] != '')) ? w_aArgv[3] : null;
		var p_sDomain     = ((w_iArgc > 4) &&  (w_aArgv[4] != '')) ? w_aArgv[4] : null;
		var p_bSecure     = ((w_iArgc > 5) &&  (w_aArgv[5] != '')) ? w_aArgv[5] : false;
		if(p_sExpireDays){
			var today = new Date();
			today.setTime(today.getTime());
			var p_sExpires = new Date(today.getTime() + (p_sExpireDays*24*60*60*1000));
		}
		else{
			var p_sExpires = null;
		}
		                              
		document.cookie =
			p_sName + '=' + escape(p_sValue)
			+ ((p_sExpires == null) ? '' : ('; expires=' + p_sExpires.toGMTString()))
			+ ((p_sPath == null) ? '' : ('; path=' + p_sPath))
			+ ((p_sDomain == null) ? '' : ('; domain=' + p_sDomain))
			+ ((p_bSecure == true) ? '; secure' : '')
		;
	}
	
	function DeleteCookie(name) {
		var exp = new Date();
		exp.setTime (exp.getTime() - 1000000000);  // This cookie is history (changed -1 to make it previous time)
		var cval = GetCookie (name);
		document.cookie = name + '=' + cval + '; expires=' + exp.toGMTString();
		alert(name + 'The cookie has been deleted.');
	}
	
	function setFormActionAndSubmit(p_sFormName, p_sAction) {
		document.forms[p_sFormName].action = p_sAction;
		document.forms[p_sFormName].submit();
	}
	function setFormAction(p_sFormName, p_sAction, p_sActionAddField, p_sActionAddValue) {
		var w_sAction = p_sAction + '&' + p_sActionAddField + '=' + p_sActionAddValue;
		document.forms[p_sFormName].action = w_sAction;
	}

/* COOKIE READ WRITE FOR MATRIX*/

function f_openCommercial(){
  document.getElementById('container').style.display = 'none';
  document.getElementById('commercial').style.display = 'block';
}

function f_closeCommercial(){
  document.getElementById('container').style.display = 'block';
  document.getElementById('commercial').style.display = 'none';
}var TelPrijs = 0;
	
	function rollOut(id, type, netwerknaamcontract, netwerknaam) {
		if (document.getElementById('imgphone') != undefined) {
			document.getElementById('imgphone').style.display = 'none';
		}
		
		document.getElementById('tr' + id).style.backgroundColor = '#FFFFFF';
		TelPrijs = '';
		
		if ((type == 'abonnement') || (type == 'SO') || (type == 'verlenging')) {
			Content = '';
			Content+= '<table class="tabel_preview_telefoon" cellspacing="0">';
			Content+= '<tr><td class="title">abonnement:</td>';
			Content+= '<td class="title_awnser">'+netwerknaam+'</td></tr>';
			Content+= '<tr><td class="title">contractsduur:</span></td>';
			Content+= '<td  class="title_awnser">'+netwerknaamcontract+'</td></tr>';
			Content+= '</table>';
			if (document.getElementById('telActie') != undefined) {
				document.getElementById('telActie').innerHTML = '';
			}
			document.getElementById('abonnementenInfo').innerHTML = Content ;
		}
		
	  if ((type == 'abonnement') || (type == 'HS') || (type == 'PP') || (type == 'verlenging')) {
	  	document.getElementById('toestelInfo').innerHTML = '<span class="panelLabel">Telefoon: <div id="toestelMerk"></div></span> Kies een toestel';
			
			if (document.getElementById('imgphone') != undefined) {
				document.getElementById('imgphone').src = 'media/interface/leeg.gif';
			}
		}
		if (document.getElementById('newPhoneImage') != undefined) {
			document.getElementById('newPhoneImage').style.display = 'none';
		}
	}
	
	function rollOver(id, merk, kleur, model, handsetgroepen, type, prijs){
		if ((prijs != undefined) && (TelPrijs == '')) {
			TelPrijs = prijs;
		}
		var Content = '';
		document.getElementById('tr' + id).style.backgroundColor = '#ecf6d9';
		document.getElementById('imgphone').src = '/media/phones/' + merk.toLowerCase() + '/logo_115x265/' + id + '_' + kleur + '.png';
		
		Content = '';
		Content+= '<table id="telSpecs" class="tabel_preview_telefoon" cellspacing="0">';	
		Content+= '<tr><td class="title">merk:</td>';
		Content+= '<td class="title_awnser">' + merk + '</td></tr>';	
		Content+= '<tr><td class="title">model:</td>';
		Content+= '<td class="title_awnser">' + model + '</td></tr>';	
		Content+= '<tr><td class="title">prijs:</td>';
		Content+= '<td id="toestelprijs" class="prijs">' + TelPrijs + '</td></tr>';
		Content+= '</table>';
		
		document.getElementById('toestelInfo').innerHTML = Content;
		
		if (document.getElementById('newPhoneImage') != undefined) {
			if (handsetgroepen.indexOf('new') != -1) {
				document.getElementById('newPhoneImage').style.display = 'block';
			}
			else {
				document.getElementById('newPhoneImage').style.display = 'none';
			}
		}
		document.getElementById('imgphone').style.display = 'block';
	}
	
	function rollOverColumn(prijs, netwerk, logo, maandelijkseKosten, netwerknaam, netwerknaamcontract, sms, aansluiting, actie, type) {
		if (document.getElementById('imgnetwerk')) {
			document.getElementById('imgnetwerk').src = '/media/netwerken/logo_100x50/' + logo;
			Content = '';
			if (type != 'PP') {
				Content+= '<table class="tabel_preview_telefoon" cellspacing="0">';
				Content+= '<tr><td colspan="2" id="telActie" class="actie">' + actie + '<br></td></tr>';
				Content+= '<tr><td class="title">abonnement:</td>';
				Content+= '<td class="title_awnser">' + netwerknaam + '</td></tr>';
				Content+= '<tr><td class="title">belminuten:</td>';
				Content+= '<td class="title_awnser">' + sms + '</td></tr>';
				Content+= '<tr><td class="title">contractsduur:</span></td>';
				Content+= '<td  class="title_awnser">' + netwerknaamcontract + '</td></tr>';
				Content+= '<tr><td class="title">aansluiting:</span></td>';
				Content+= '<td class="prijs">&euro; ' + aansluiting + '</td></tr>';
				Content+= '<tr><td class="title">kosten p/m:</span></td>';
				Content+= '<td class="prijs" >&euro; ' + maandelijkseKosten + '</td></tr>';
				Content+= '</table>';	
			}
			if (prijs == '0.00') {
				TelPrijs = 'GRATIS';
			}
			else {
				TelPrijs = '&euro; '+prijs;
			}
			document.getElementById('abonnementenInfo').innerHTML = Content ;
		}		
		
		if (prijs == '0.00') {
			TelPrijs = 'GRATIS';
		}
		else {
			TelPrijs = '&euro; '+prijs;
		}
	}
	
	function formControllerVerleng(netwerk) {
		if (document.getElementsByName('mobielNummer')[0].value == '') {
			document.getElementById('tekstVerleng').className = 'titlefout';
			var fout = true;
		}
		if (!fout) {
			document.getElementsByName('netwerk')[0].value = netwerk;
			document.getElementById('tekstVerleng').className = '';
			document.forms['verwerkOnline'].submit();
		}
	}/* adsl formulier check */

var selectedProvider = '';

function submitAdsl(formulier){
var lijst = new Array();
var goedelijst = new Array();

  for (i=0;i<5;i++) {
    box = formulier.elements[i];
    if(box.name!='pc'){
        if ((!box.value)||(box.value=='!')){
          lijst.push(box.name);
        }else{
          goedelijst.push(box.name);
        }
    }
  }
  for (j=0;j<lijst.length;j++){
    formulier[lijst[j]].value='!';
    formulier[lijst[j]].style.background='#ffe9e9';
  }
  for (k=0;k<goedelijst.length;k++){
    formulier[goedelijst[k]].style.background='#ffffff';
  }


  if (lijst.length){
    alert('U heeft niet alles ingevuld');
  }else{
    if (formulier.pc){
      formulier.action = formulier.action.substr(0, (formulier.action.length - selectedProvider.length)) + formulier.pc.value;
      selectedProvider = formulier.pc.value;
    }
    formulier.submit();
  }

}


function changeFormSelect(provider,hetformulier){
  for (t=0;t<hetformulier.pc.options.length;t++){
    if (hetformulier.pc.options[t].value==provider){
      hetformulier.pc.options[t].selected=true;
    }
  }
}

