

var platform;
var browser;
var version;
var adjWidth;
var adjHeight;
var winSize,winOptions;
var isie=0;
var isnc=0;
var ismac=0;
var ispc=0;

version = parseInt(navigator.appVersion);

if(navigator.userAgent.indexOf('Win') == -1) {
       platform = 'Macintosh';
	ismac=1;
} else {
        platform = 'Windows';
	ispc=1;
}

if(navigator.appName.indexOf('Netscape') == -1) {
       browser = 'IE';
	//alert("isie");
	isie=1;
} else {
       browser = 'Netscape';
	//alert("isnc");
	isnc=1;
}
function oldhp() {
	if (ismac){
	//alert("ismac");
	openrlmac('swf/index.html','rl');
	}
	else 
	if(ispc){
	//alert("ispc");
	openrlwin('swf/index.html','rl');
	}
	else {}
}

function hpswf(lang){
	if(lang=='fr') maxopen('siteswf/indexfr.html','rl');
	else if(lang=='uk')  maxopen('siteswf/indexuk.html','rl');
	else maxopen('err404.html','rl');
}

function maxopen(theUrl,winName){
if (ismac){
	//alert("ismac");
	openrlmac(theUrl,winName);
	}
	else 
	if(ispc){
	//alert("ispc");
	openrlwin(theUrl,winName);
	}
	else {}
}

function openrlwin(winUrl,winName) {
	var winAttr = 'directories=0,location=0,menubar=0,resizable=1,scrollbars=0,status=0,toolbar=0,top=0,left=0,' ;
	if ((document.all)||(document.layers)) {
	if (document.all) winAttr += 'width=' + (screen.availWidth-12) + ',height=' + (screen.availHeight-28) ;
	else
	if (document.layers) winAttr += 'OuterWidth=' + screen.availWidth + ',OuterHeight=' + screen.availHeight ;
	TheSite = window.open(winUrl,winName,winAttr) ;
	}
	else 
	{
	winAttr+=",width=800,height=600";
	window.open(winUrl,winName,winAttr);
	}
}


function openrlmac(theUrl,winName) {
	var W=screen.availWidth;
	var H=screen.availHeight;
	//var theUrl='swf/index.html';
	//var winName='rl';

	if (isie) { H+=10; W+=2;}
	else if (isnc) {H-=30;W-=10}
	s = ",width="+W+",height="+H;

	//dbg
	//alert(s);
	if (isie) {
		rlwin = window.open( theUrl , winName, "fullscreen=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1"+s)
		rlwin.resizeTo( Math.ceil( W ), Math.ceil( H ) );
		rlwin.moveTo  ( 0, 0 );
	}
	else    
		{
		var rlwin = window.open(theUrl, winName, "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,left=0,top=0,screenX=0,screenY=0"+s, true)
}
	rlwin.focus();
}
