<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//
// Sets cookie values. Expiration date is optional
//

function setCookie(name, value, expire) {
   document.cookie = name + "=" + escape(value)
   + ((expire == null) ? "" : ("; expires=" + expire.toGMTString()))
}


function getCookie(Name) {
   var search = Name + "="
   if (document.cookie.length > 0) { // if there are any cookies
      offset = document.cookie.indexOf(search) 
      if (offset != -1) { // if cookie exists 
         offset += search.length 
         // set index of beginning of value
         end = document.cookie.indexOf(";", offset) 
         // set index of end of cookie value
         if (end == -1) 
            end = document.cookie.length
         return unescape(document.cookie.substring(offset, end))
      } 
   }
}

function set_language(language, environment) {
   var today = new Date()
   var expires = new Date()
   expires.setTime(today.getTime() + 1000*60*60*24*31) //31 dagen expiry
   setCookie("ors_lang"+environment, language, expires)
}
function set_language_admin(language, environment) {
   var today = new Date()
   var expires = new Date()
   expires.setTime(today.getTime() + 1000*60*60*24*31) //31 dagen expiry
   setCookie("ors_lang_admin"+environment, language, expires)
}
function set_user_admin(user, environment) {
   var today = new Date()
   var expires = new Date()
   expires.setTime(today.getTime() + 1000*60*60*24*31) //31 dagen expiry
   setCookie("ors_user_admin"+environment, user, expires)
}

function js_array_to_php_array (a)
// This converts a javascript array to a string in PHP serialized format.
// This is useful for passing arrays to PHP. On the PHP side you can 
// unserialize this string from a cookie or request variable. For example,
// assuming you used javascript to set a cookie called "php_array"
// to the value of a javascript array then you can restore the cookie 
// from PHP like this:
//    <?php
//    session_start();
//    $my_array = unserialize(urldecode(stripslashes($_COOKIE['php_array'])));
//    print_r ($my_array);
//    ?>
// This automatically converts both keys and values to strings.
// The return string is not URL escaped, so you must call the
// Javascript "escape()" function before you pass this string to PHP.
{
    var a_php = "";
    var total = 0;
    for (var key in a)
    {
        ++ total;
        a_php = a_php + "s:" +
                String(key).length + ":\"" + String(key) + "\";s:" +
                String(a[key]).length + ":\"" + String(a[key]) + "\";";
    }
    a_php = "a:" + total + ":{" + a_php + "}";
    return a_php;
}

// This function sets or unsets the default price
// id= id of period
// value= new value
function set_default_schema_price(schema_id, value)
{
	if (value == true)
	{
		document.getElementById('txt_price' + schema_id).value = '';
		document.getElementById('txt_price' + schema_id).disabled = true;
		document.getElementById('txt_price' + schema_id).className = 'postdisabled';
		document.getElementById('sel_cur' + schema_id).selectedIndex=0;
		document.getElementById('sel_cur' + schema_id).disabled = true;
		document.getElementById('sel_cur' + schema_id).className = 'postdisabled';
	}

	if (value == false)
	{
		var default_price=document.getElementById('default_price').value; 
		var default_currency=document.getElementById('default_currency').value; 
		
		document.getElementById('txt_price' + schema_id).value = default_price;
		document.getElementById('txt_price' + schema_id).disabled = false;
		document.getElementById('txt_price' + schema_id).className = 'post';

		document.getElementById('sel_cur' + schema_id).disabled = false;
		for(i=0;i<document.getElementById('sel_cur' + schema_id).length;i++)
		{
			if(document.getElementById('sel_cur' + schema_id).options[i].value==default_currency)
			{
				document.getElementById('sel_cur' + schema_id).selectedIndex=i
				document.getElementById('sel_cur' + schema_id).className = 'post';
			}
		}
	}
}

// This function sets or unsets the default price
// id= id of period
// value= new value
function set_schema_price(schema_id, value)
{
	if (value == 2 || value == 3)
	{
		document.getElementById('sel_cur' + schema_id).selectedIndex=0;
		document.getElementById('sel_cur' + schema_id).disabled = true;
		document.getElementById('sel_cur' + schema_id).className = 'postinvisible';
		document.getElementById('txt_price' + schema_id).disabled = false;
		document.getElementById('txt_price' + schema_id).className = 'post';
	}

	if (value == 1)
	{
		document.getElementById('txt_price' + schema_id).value = '';
		document.getElementById('txt_price' + schema_id).disabled = true;
		document.getElementById('txt_price' + schema_id).className = 'postdisabled';
		document.getElementById('sel_cur' + schema_id).selectedIndex=0;
		document.getElementById('sel_cur' + schema_id).disabled = true;
		document.getElementById('sel_cur' + schema_id).className = 'postdisabled';
	}
	
	if (value == 0)
	{
		var default_price=document.getElementById('default_price').value; 
		var default_currency=document.getElementById('default_currency').value; 
		
		document.getElementById('txt_price' + schema_id).value = default_price;
		document.getElementById('txt_price' + schema_id).className = 'post';

		document.getElementById('sel_cur' + schema_id).disabled = false;
		for(i=0;i<document.getElementById('sel_cur' + schema_id).length;i++)
		{
			if(document.getElementById('sel_cur' + schema_id).options[i].value==default_currency)
			{
				document.getElementById('sel_cur' + schema_id).selectedIndex=i
				document.getElementById('sel_cur' + schema_id).className = 'post';
			}
		}
	}
}


// return the value of the radio button that is checked
// return an empty string if none are checked, or
// there are no radio buttons
function getCheckedValue(radioObj) {
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
	return "";
}

// set the radio button with the given value as being checked
// do nothing if there are no radio buttons
// if the given value does not exist, all the radio buttons
// are reset to unchecked
function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

// simpele functies om een object te tonen/verbergen
// gebruikt voor splashscreen
function showObject(obj) {
		obj.style.visibility = "visible";
	}
function hideObject(obj) {
		obj.style.visibility = "hidden";
	}
	
function calcMinMax()
{
	
	var arrObjids = document.forms.combi_form.obj_id

	var totMin = 0;
	var totMax = 0;

	for(var i = 0; i< arrObjids.length; i++)
	{
		var obj_id = arrObjids[i].value;
		var nameMin = "MinPers" + obj_id;
		var valueMin = document.getElementById(nameMin).value;
		var nameMax = "MaxPers" + obj_id;
		var valueMax = document.getElementById(nameMax).value;
		var nameAmt = "number_of_places" + obj_id;
		var valueAmt = document.getElementById(nameAmt).value;
		totMin += valueMin * valueAmt;
		totMax += valueMax * valueAmt;
	}
	
	document.forms.combi_form.MinPersTot.value = totMin
	document.forms.combi_form.MaxPersTot.value = totMax

}

    
-->