var OS = 'Win';
var version = "n";
var isNS = (navigator.appName == "Netscape");
var isMAC = (navigator.platform.indexOf('Mac') != -1);

browserVer=navigator.appVersion;
App = navigator.appName;
var Version=browserVer.substring(0,1);
var posOS = navigator.appVersion.indexOf('Mac');
var posOS2 = navigator.appVersion.indexOf('Win');
if (posOS >= 0) OS = 'Mac';
if ((posOS < 0) && (posOS2 >= 0)) OS = 'Win';
if (App == "Netscape" && Version >= 3) version = "n3";

var isDOM      = (typeof(document.getElementsByTagName) != 'undefined' && typeof(document.createElement) != 'undefined') ? 1 : 0;
var isIE4      = (typeof(document.all) != 'undefined' && parseInt(navigator.appVersion) >= 4) ? 1 : 0;
var isNS4      = (typeof(document.layers) != 'undefined') ? 1 : 0;
var capable    = (isDOM || isIE4 || isNS4) ? 1 : 0;
if (capable) {
	if (typeof(window.opera) != 'undefined') {
		capable = 0;
	} else if (typeof(navigator.userAgent) != 'undefined') {
		var browserName = ' ' + navigator.userAgent.toLowerCase();
		if (browserName.indexOf('konqueror') > 0) {
			capable = 0;
		}
	}
}

function openwin(name,myname,mywidth,myheight,mytool,mydir,mystatus,myscroll,myresize,mymenu) {
	mytop=Math.floor((screen.height/2) - (myheight/2));
	myleft=Math.floor((screen.width/2) - (mywidth/2));
	if (version != "n3" && OS != 'Mac') debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
	if (OS == 'Mac') debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
	if (version == "n3") {
		debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
		debute.focus();
	}
}

function openwintopleft(name,myname,mywidth,myheight,mytool,mydir,mystatus,myscroll,myresize,mymenu) {
	mytop=10;
	myleft=10;
	if (version != "n3" && OS != 'Mac') debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
	if (OS == 'Mac') debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
	if (version == "n3") {
		debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
		debute.focus();
	}
}

function openwin_popup(myurl,mywidth,myheight) {
	openwin(myurl,"newpopup",mywidth,myheight,0,0,0,0,0,0);
}

function openwin_docked(myurl) {
	debute = window.open(myurl,"newwin","location=1,toolbar=1,directories=1,status=1,scrollbars=1,resizable=1,menubar=1");
}

function openwin_fixedsize(myurl,mywidth,myheight) {
	debute = window.open(myurl,"newwin","width="+mywidth+",height="+myheight+",location=1,toolbar=1,directories=1,status=1,scrollbars=1,resizable=1,menubar=1");
}

function openwin_fullscreen(name,myname) {
	debute = window.open(name,myname,"fullscreen=1,toolbar=1,directories=1");
}

function zoom(myurl,mywidth,myheight) {
	openwin(myurl,"zoom",mywidth,myheight,0,0,0,0,0,0);
}

function presse(idreview) {
	openwin('/html/review.php?idreview='+idreview,"review",760,550,0,0,0,1,0,0);
}

function SetFlashHeight(divname, height) {
	if (!capable) return;
	if (isDOM) {
		var whichEl = document.getElementById(divname);
		whichEl.style.height  = height;
	} else if (isIE4) {
		var whichEl = document.all(divname);
		whichEl.style.height  = height;
	} else if (isNS4) {
		var whichEl = document.layers[divname];
		whichEl.style.height  = height;
	}	
}

