var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
var EDIT = false;

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function Resize()
{
// waarde omhoog = banners omhoog.
document.getElementById("tabel_one").style.height=ns6? window.innerHeight-359+"px" : iecompattest().clientHeight-359+"px"
//document.getElementById("menubackground").style.height=ns6? window.innerHeight-550+"px" : iecompattest().clientHeight-240+"px"
document.getElementById("top_row").style.height=ns6? window.innerHeight-352+"px" : iecompattest().clientHeight-352+"px"
}

function show(divnaampje)
{divie=document.getElementById(divnaampje)
divie.style.visibility ="visible";}
function hide(divnaampje)
{divie=document.getElementById(divnaampje)
 divie.style.visibility ="hidden";}
 
function swap(id)
	{

	el     = document.getElementById(id);
    el_pic = document.getElementById(id+'_pic');

	var display     = el.style.display ? '' : 'none';
    var display_pic = el.style.display ? 'images/min.gif':'images/plus.gif'

	el.style.display = display;
	el_pic.src       = display_pic;
    }
    
function showhideprice()
	{

	el     = document.getElementById('price');
	var display     = document.c_profile.verkoopbaar.value == "Ja" ? '' : 'none';
	el.style.display = display;

    }

function c_swap(licence)
	{
    if (!licence)
    	{
        document.c_profile.merk.value='';
        document.getElementById('standaard_button').disabled=true;
        document.getElementById('delete_button').disabled=true;  
        document.c_profile.standaard.value='';       
        document.c_profile.type.value='';
        document.c_profile.voertuigtype.options[0].selected=true;
        document.c_profile.kleur.value='';
        document.c_profile.bouwjaar.options[0].selected=true;
  	    document.c_profile.verkoopbaar.options[1].selected=true;
        document.c_profile.prijs.value='';
        document.getElementById('button').disabled=true;
        showhideprice();
        }
        else
        {
        document.c_profile.merk.value=licence[2][1];
        document.getElementById('standaard_button').disabled = ( licence[3][1] == "Ja" ? true : false );
        document.getElementById('delete_button').disabled = ( licence[3][1] == "Ja" ? true : false );        
        document.c_profile.standaard.value=licence[3][1];
        document.c_profile.type.value=licence[4][1];
        document.c_profile.voertuigtype.value=licence[5][1];
        document.c_profile.kleur.value=licence[6][1];
        document.c_profile.bouwjaar.value=licence[7][1];
        document.c_profile.verkoopbaar.value=licence[8][1];
        document.c_profile.prijs.value=licence[9][1];
        document.getElementById('button').disabled=false;
        showhideprice();
        }
    }

function add_licence()
    {
    new_lic = prompt('Geef het kenteken van het toe te voegen voertuig','');
    if (!new_lic){return null;}
    console = document.getElementById('console'); 
    document.location.href="index.php?act=c_profile&child=gebruiker&code=add_licence&licence="+new_lic.toUpperCase();
    }
function set_standaard()
	{
    licence = document.getElementById('licence').value;
	console = document.getElementById('console');
    document.location.href="index.php?act=c_profile&code=set&child=gebruiker&licence="+licence;
    }
        
function delete_licence(licence)
	{
    if (licence[3][1] == "Ja")
   		{
        alert('Het standaard kenteken kan hier niet gewist worden');
        return null;
        }
	    else
    	{
	    licence = document.getElementById('licence').value;
        if (confirm("Kenteken "+licence+" wissen?"))
        	{
    		document.location.href="index.php?act=c_profile&code=delete_licence&child=gebruiker&licence="+licence;
            }
            else 
            {
            return null;
            }
        }
    }
function CheckAll(cb) 
	{
    var fmobj = document.messages;
   for (var i=0;i<fmobj.elements.length;i++) 
   {
   var e = fmobj.elements[i];
   if ((e.name != 'allbox') && (e.type=='checkbox') && (!e.disabled)) {
   e.checked = fmobj.allbox.checked;
                            }
                         }
                     }

