function newImage(src,width,height) {
var img=new Image(width,height);
img.src=src;
return img;
}
pics = [
{
img : newImage("images/spacer.gif",120,16),
href : "#"
},
{
img : newImage("img/chatopen.gif",120,16),
href : "1300.php"
},
{
img : newImage("img/chatopen.gif",120,16),
href : "2300.php"
}];
pics.position=0;
function melding_plaatsen(vars){
	pics.position=vars;
	document.getElementById("chat_open").src=pics[pics.position].img.src;;
}


function isLayered() {
	return parseInt(window.navigator.userAgent.charAt(window.navigator.userAgent.indexOf("/")+1),10) >= 4;
}

function isMac() {
	return window.navigator.userAgent.indexOf("Mac") > 0;
}

function isIE() {
	return window.navigator.userAgent.indexOf("MSIE") > 0;
}

function getStyle(doc, o) {
	if(isIE()) {
		return doc.all.tags("div")[o].style;
	} else {
		return getObject(doc, o, 0);
	}
}

function getObject(d, n) {
	var p,i,x;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!d) {	// start at first doc in full tree...
		if(parent.frames.length) {
			d = top.frames[0].document;
		} else {
			d = top.document;
		}
	}
	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=getObject(d.layers[i].document, n);
	if(!x && d.getElementById)
		x=d.getElementById(n);

	return x;
}

function setImage(doc, name, url) {
	var _o = null;
	_o = getObject(doc, name);
	if (_o) _o.src = url;
}

function go(doc, act) { return go(doc, act, '','','',''); }
function go(doc, act, par1) { return go(doc, act, par1,'','',''); }
function go(doc, act, par1, par2) { return go(doc, act, par1, par2,'',''); }
function go(doc, act, par1, par2, par3) { return go(doc, act, par1, par2, par3,''); }
function go(doc, act, par1, par2, par3, par4) { return go(doc, act, par1, par2, par3, par4); }

function go(doc, act, par1, par2, par3, par4) {
//alert('go(doc,'+act+','+par1+','+par2+','+par3+','+par4+')');
	var f = doc.forms["silhouet"];
	var e = doc.forms["silhouet"].elements;

	e["act"].value = act;
	if(par1) e["par1"].value = par1;
	if(par2) e["par2"].value = par2;
	if(par3) e["par3"].value = par3;
	if(par4) e["par4"].value = par4;

	doc.forms["silhouet"].submit();

	return 1;
}

function menu(act) {
	if(act != '') {
		parent.frames.f_content.location = "go.php?f_act=content&" + act;
	}
}

function setDisplay(o, v) {
	var s = 0;
	if(o.style) {
		if(v) {
			o.style.display = "inline";
		} else {
			o.style.display = "none";
		}
	} else {
		if(v) {
			o.visibility = "show";
		} else {
			o.visibility = "hidden";
		}
	}
}

function setVisibility(o, v) {
	var s = 0;
	if(o.style) {
		if(v) {
			o.style.visibility = "visible";
		} else {
			o.style.visibility = "hidden";
		}
	} else {
		if(v) {
			o.visibility = "show";
		} else {
			o.visibility = "hidden";
		}
	}
}

function formSetValue(doc, c, v) {
	var o = getObject(doc, c);
	o.value = v;
	return false; // stop cascade
}

function act(doc, act, par1, par2, par3, par4) {
//alert('act(doc,'+act+','+par1+','+par2+','+par3+','+par4+') [_menu=' + top._menu+']');
	if(!top._menu) { top._menu = '-1'; }

	if(act == "mo") {
		setImage(doc, 'm_'+par1, 'img/m_'+par1+'_o.gif');
	} else if(act == "mc") {
		if(top._menu != '') {
			setImage(doc, 'm_'+top._menu, 'img/m_'+top._menu+'_e.gif');
		}
		setImage(doc, 'm_'+par1, 'img/m_'+par1+'_o.gif');
		top._menu = par1;
	} else if(act == "me") {
		if(top._menu == par1) {
			setImage(doc, 'm_'+par1, 'img/m_'+par1+'_o.gif');
		} else {
			setImage(doc, 'm_'+par1, 'img/m_'+par1+'_e.gif');
		}
	}
	if(act == "load") {	// laadt pagina full-screen achtig
		// par1=location
		var width;
		var height;
		var w;

		if(isMac()) {
			var width = screen.availWidth - 5;
			var height = screen.availHeight - 10;
			var w = window.open(par1, "_blank", "location=false,address=false,menu=false,toolbar=false,status,resizable=true,width="+width+",height="+height);
		} else {
			var width = screen.availWidth - 8;
			var height = screen.availHeight - 10;
			var w = window.open(par1, "_blank", "location=false,address=false,menu=false,toolbar=false,status,resizable=true,width="+width+",height="+height);
		}
		w.moveTo(0,0);
		w.resizeTo(width, height);
		w.screenX = 0;
		w.screenY = 0;
	}
	if(act == "disclaimer") {
		var width = 400;
		var height = 300;
		var doc = 'disclaimer.html';
		var options = "location=false,address=false,menu=false,toolbar=false,status=false,resizable=true,width="+width+",height="+height;
		var w = window.open(doc, "_blank", options);
		w.moveTo(0,0);
		w.resizeTo(width, height);
		w.screenX = 0;
		w.screenY = 0;
		return false;
	}
	if(act == "bookmark") {
		if (navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) >= 4) {
			window.external.AddFavorite("http://www.elcea.nl/elacin_nl","Elcea - NL");
		} else {
			alert('Druk op Ctrl-D om deze pagina op te nemen in uw bookmarks.');
		}
	}
	if(act == "hide") {
		// par1=name
		var _o = null;
		_o = getObject(doc, par1);
		if (_o) setVisibility(_o, false);
	}
	if(act == "hide_popup") {
		var _o = null;
		_o = top.frames["f_content"].document.all.popup;
		if (_o) setVisibility(_o, false);
	}
	if(act == "open") {
		// par1=location
		// par2=width
		// par3=height
		window.open(par1, "_blank", "location=false,address=false,menu=false,toolbar=false,status,resizable=true,width="+par2+",height="+par3);
	}
	if(act == "popup") {
		// par1=location
		// par2=width
		// par3=height
		window.open(par1, "_blank", "location=false,address=false,menu=false,toolbar=false,status,resizable=false,width="+par2+",height="+par3);
	}
	if(act == "show") {
		// par1=name
		var _o = null;
		_o = getObject(doc, par1);
		if (_o) setVisibility(_o, true);
	}
	if(act == "show_popup") {
		var _o = null;
		_o = top.frames["f_content"].document.all.popup;
		if (_o) setVisibility(_o, true);
	}

	if(act == "changeimg") {
		setImage(doc, par1, par2);
	}
}

function movie_DoFSCommand(act, args) {
	go(document, act, args);
}

function silhouet_debug() {
	var s = "silhouet_debug";

	s += "\nisIE() = " + isIE();
	s += "\nisLayered() = " + isLayered();

	alert(s);
}

var _scheme = "";
var _menu = "";
var _submenu = "";
var _page = "";

function sync(scheme, menu, submenu, page) {

	if(_scheme != scheme || _menu != menu || _submenu != submenu) {
		parent.frames.f_title.location = "go.php?f_act=title&f_page=" + page;
		parent.frames.f_more.location = "go.php?f_act=more&f_page=" + page;
		parent.frames.f_menu.location = "go.php?f_act=menu&f_page=" + page;
	}

	_scheme = scheme;
	_menu = menu;
	_submenu = submenu;
	_page = page;
}

function test(doc) {
	go(doc , 'page', 0, 0, 0);
}

function log_out() 
{ 
    ht = document.getElementsByTagName("html"); 
    ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)"; 
    if (confirm('Weet u zeker dat u wilt uitloggen?')) 
    { 
        return true; 
    } 
    else 
    { 
        ht[0].style.filter = ""; 
        return false; 
    } 
} 

function decision(message, url){
if(confirm(message)) location.href = url;
}
