function onload()
{
	if(document.getElementById('plotformtable') != undefined) {
		
		var tbody = document.getElementById('plotformtable').lastChild;
		
		if(document.getElementById('dezelfde').checked == true) {
	
			var cn_length = tbody.childNodes.length;
			
			for(i=1;i<=cn_length;i++) {
				
				if(tbody.childNodes[i] != undefined) {
					var tr = tbody.childNodes[i];
					
					if(tr.tagName == 'TR' && tr.id != 'plotformrow0') {
						tr.style.visibility = 'hidden';
					}
				}
			}
		}
	}
}


/*
// added by kasper
function selectall(checkbox)
{
	var aon = document.getElementsByName("allornothing")[0];
	aon.value = checkbox.checked;
	
	var f = document.getElementsByName("files_form")[0];
	var inputs = f.getElementsByTagName("input");
	
	for(var i=0; i < inputs.length; i++)
	{
		if(inputs[i].type == "checkbox")
		{
			inputs[i].checked = checkbox.checked;
		}
	}
	
	f.submit();
}
*/
//nathan 2008-11-03
function selectall(checkallbox)
{
	
	/*
	var checkallid = checkallbox.id;
	var prefixlength = "checkboxallornothing_".length;
	var dirid = checkallid.substring(prefixlength);
	*/
	/*
	if(document.getElementById(checkallid).checked == true) {
		document.getElementById(checkallid).checked = false;
	} else {
		document.getElementById(checkallid).checked = true;
	}
	*/

	var f = document.getElementById("files_form");
	
	/*
	var inputs = f.getElementsByTagName("input");	
	
	var cbprefixlength = "checkbox_".length;
	var cbi = 0;
	
	for(var i=0; i < inputs.length; i++)
	{
		if(inputs[i].type == "checkbox")
		{
			var cbid = inputs[i].id;
			
			if(cbid.substring(0,cbprefixlength) == "checkbox_") {
				
				if(inputs[i].id == "checkbox_"+dirid+"_"+cbi) {
					
					if(inputs[i].checked == true) {
						inputs[i].checked = false;						
					} else {
						inputs[i].checked = true;	
					}
					cbi++;
				}
			}
		}
	}
	*/

	f.submit();

}

function DeleteUserNameCookie()
{
	// delete the username and password cookie
	deleteCookie("cito_www[username]");
	deleteCookie("cito_www[password]");
	deleteCookie("cito_www[ip]");
	
	// set the default values back in the fields
	document.getElementById('username').value = 'gebruikersnaam';
	document.getElementById('password').value = 'wachtwoord';

}

function getCookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ';', len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function setCookie( name, value, expires, path, domain, secure ) {
	var today = new Date();
	today.setTime( today.getTime() );
	if ( expires ) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	document.cookie = name+'='+escape( value ) +
		( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + //expires.toGMTString()
		( ( path ) ? ';path=' + path : '' ) +
		( ( domain ) ? ';domain=' + domain : '' ) +
		( ( secure ) ? ';secure' : '' );
}

function deleteCookie( name, path, domain ) {
	if ( getCookie( name ) ) document.cookie = name + '=' +
			( ( path ) ? ';path=' + path : '') +
			( ( domain ) ? ';domain=' + domain : '' ) +
			';expires=Thu, 01-Jan-1970 00:00:01 GMT';
}

function CreateBookmarkLink(url,title) {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title);
	} else if(window.opera && window.print) { // Opera Hotlist
		return true;
	}
}


/*
function mainmenuMouseover(e, pPc_id)
	{
		//alert('dfgdfg');
		if ( (pPc_id != tplVar_pc_id) && (pPc_id != 14) ) {
			if (pPc_id == '33') {
				if (tplVar_newslink == '') {
					e.className = 'design_header_menu_ul_item-mouseover';
				}
			}else{
				if (pPc_id == '12') {
					e.className = 'design_header_menu_ul_home-mouseover';
				}else{
					e.className = 'design_header_menu_ul_item-mouseover';
				}
			}
		}
	}
	function mainmenuMouseout(e, pPc_id)
	{
		if( (pPc_id != tplVar_pc_id) && (pPc_id != 14) )  {
			if (pPc_id == '15') {
				if (tplVar_newslink == '') {
					e.className = 'design_header_menu_ul_item';
				}
			}else{
				if (pPc_id == '12') {
					e.className = 'design_header_menu_ul_home';
				}else{
					e.className = 'design_header_menu_ul_item';
				}
			}
		}
	}
	
	function bottommenuMouseover(e, pPc_id)
	{
		if (pPc_id != tplVar_pc_id) {
			e.className = 'design_bottom_menu_link-mouseover';
		}
	}
	function bottommenuMouseout(e, pPc_id)
	{
		if (pPc_id != tplVar_pc_id) {
			e.className = 'design_bottom_menu_link';
		}
	}
	
	function onLoad()
	{
		if (tplVar_pc_id != '') {
			if (tplVar_pc_id == 26 || tplVar_pc_id == 27) {
				e = document.getElementById("bottommenuId_"+tplVar_pc_id);
				e.className = 'design_bottom_menu_link-selected';
			}else{
				e = document.getElementById("mainmenuId_"+tplVar_pc_id);
				if (tplVar_pc_id == 12) {
					e.className = 'design_header_menu_ul_home-selected';
				}else{
					e.className = 'design_header_menu_ul_item-selected';
				}
			}
		}else if (tplVar_newslink != '') {
			e = document.getElementById("mainmenuId_15");
			if(e == undefined)
				return;
			e.className = 'design_header_menu_ul_item-selected';
		}
	}
	*/
	
	/*
	startList = function() {
		//alert('hoi'); 
		if (document.all && document.getElementById) {
			navRoot = document.getElementById("mainmenu_nav");
			for (i=0; i<navRoot.childNodes.length; i++) {
				node = navRoot.childNodes[i];
				if (node.nodeName=="LI") { 
					node.onmouseover=function() {
						this.className+=" over";
						//alert('onmouseover: '+this.className);
					}
					node.onmouseout=function() {
						//alert('onmouseout');
						this.className=this.className.replace(" over", "");
					}
				}
			}
		}
	}
	*/
