/////////////////////////////////////////////////////////////////////
/// browser vars ////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
function lib_bwcheck(){
	this.ver	= navigator.appVersion;
	this.agent	= navigator.userAgent;
	this.dom	= document.getElementById ? 1:0;
	this.opera5	= this.agent.search(/opera 5/i)>-1;

	this.ie4	= (document.all && !this.dom && !this.opera5) ? 1:0;
	this.ie5	= (this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5) ? 1:0; 
	this.ie6	= (this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5) ? 1:0;
	this.ie		= this.ie4 || this.ie5 || this.ie6;

	this.mac	= this.agent.search(/mac/i)>-1;

	this.fire	= this.agent.search(/firefox/i)>-1;
	this.ns6	= (this.dom && parseInt(this.ver) >= 5) ? 1:0;
	this.ns4	= (document.layers && !this.dom) ? 1:0;
	this.ns		= this.ns4 || this.ns6;

	this.bw		= (this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5);
	return this;
}
bw	= new lib_bwcheck();

/////////////////////////////////////////////////////////////////////
/// print swf ///////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
function swf(u, h, w , co , bg) { //url, height, width, cache-off, backgroundcolor
	if (co) u += '&' + new Date().getTime()

	dw('\
		<object id="flObj" name="flObj" type="application/x-shockwave-flash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + w + '" height="' + h + '">\
		<param name=movie value="' + u + '"><param name="bgcolor" value="' + bg + '"><PARAM NAME=scale VALUE=noscale><param name=quality value=high><PARAM NAME=menu VALUE=false><PARAM NAME=swliveconnect VALUE=true><PARAM NAME=align VALUE=bottom><PARAM NAME=salign VALUE=T>\
		<embed swLiveConnect="true" NAME="flObj" bgcolor="' + bg + '" ALIGN=bottom sALIGN=T src="' + u + '" menu=false scale=noscale quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + w + '" height="' + h + '"></embed>\
		</object>\
	');
}

function dw(a) {document.write(a)}

function swf2(u, h, w) { //url, height, width
	dw('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="' + w + '" HEIGHT="' + h + '" WALIGN="left">');
	dw('<PARAM NAME=movie VALUE="' + u + '"> <PARAM NAME=quality VALUE=high> <PARAM NAME=scale VALUE=noscale> <PARAM NAME=salign VALUE=LT> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="' + u + '" quality=high scale=noscale salign=LT bgcolor=#FFFFFF  WIDTH="' + w + '" HEIGHT="' + h + '" WALIGN="left"');
	dw('TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
	dw('</OBJECT>');
}

function chCache() {
	status = "cache " + (cache = cache=='on' ? 'off':'on')
	SetCookie('cache' , cache , 5000);
}

function openPage() {
	top.location.href = "/www/pids=" + argument.join('|') + "/"
}


function popUp(u , h , w) {
	window.open(u , "" , "height=" + h + ",width=" + w + ",left=0,top=0,scrollbars=auto");
}

function changeOrder(ta , o , n) {
	var t	= ',' + ta.join(',') + ',';
	t	= t.replace( new RegExp("," + ta[o] + "," , "") , ',');

	if (o>n)	t = t.replace( new RegExp("," + ta[n] + "," , "") , ',' + ta[o] + ',' + ta[n] + ',');
	else		t = t.replace( new RegExp("," + ta[n] + "," , "") , ',' + ta[n] + ',' + ta[o] + ',');

	return t.replace(/^,|,$/g , '').split(',');
}

// ttt = realConfirm('Eh...?' , '139,260,330,415' , 1 , 400 , 120);
// question , buttonlabels , cancelbutton , dialogwidth , dialogheight
function realConfirm(q , b , c , w , h) {
	var retVal		 = "";
	var args		 = new Array();

	h			+= 20; //ipv statusbalk
	args['question']	 = q;
	args['buttons']		 = b;
	args['cancel']		 = c;
	retVal			 = window.showModalDialog("/confirm.htm", args, "dialogWidth: " + w + "px; dialogHeight: " + h + "px; dialogTop: px; dialogLeft: px; edge: Sunken; center: Yes; help: No; resizable: no; status: Yes; scroll: auto; unadorned: no");

	if (retVal == null || retVal == undefined || retVal == 0)	return null
	else								return retVal
}

function getPage(lang , loc1 , loc2) {
	loc1	= loc1.replace(/^\W+|\W$/g , '').replace(/\W/g , '-').replace(/--/g , '-').toLowerCase();

	if (loc2) {
		loc2			= loc2.replace(/^\W+|\W$/g , '').replace(/\W/g , '-').replace(/--/g , '-').toLowerCase();
		document.location.href	= "/" + lang + "/" + loc1 + "/" + loc2 + ".htm";
	}
	else	document.location.href	= "/" + lang + "/" + loc1 + ".htm"
}

/////////////////////////////////////////////////////////////////////
/// einde script ////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////