// JavaScript Document
// browser detection:
function querySt(ji) {
	hu = window.location.search.substring(1);
	gy = hu.split("&");
	for (i=0;i<gy.length;i++) {
		ft = gy[i].split("=");
		if (ft[0] == ji) {
			return ft[1];
		}
	}
}



var d, dom, ie, ie4, ie5x, moz, mac, win, lin, old, ie5mac, ie5xwin, op;

d = document;
n = navigator;
na = n.appVersion;
nua = n.userAgent;
win = ( na.indexOf( 'Win' ) != -1 );
mac = ( na.indexOf( 'Mac' ) != -1 );
lin = ( nua.indexOf( 'Linux' ) != -1 );

if (!d.layers){
	dom = ( d.getElementById );
	op = ( nua.indexOf( 'Opera' ) != -1 );
	konq = ( nua.indexOf( 'Konqueror' ) != -1 );
	saf = ( nua.indexOf( 'Safari' ) != -1 );
	moz = ( nua.indexOf( 'Gecko' ) != -1 && !saf && !konq);
	ie = ( d.all && !op );
	ie4 = ( ie && !dom );
	ie5x = ( d.all && dom );
	ie5mac = ( mac && ie5x );
	ie5xwin = ( win && ie5x );
}

var height_correction = 0;

if (ie) {
	height_correction = 140;
}
else if (moz){
	height_correction = 120;
}
else if (op){
	height_correction = 60;
}
else if (saf){
	height_correction = 60;
}
else {
	height_correction = 60;
}

var sPath = window.location.href;
sPath = sPath.replace("#","")
var pos_AvHght = sPath.indexOf("AvHght")
var pos_AvWdth = sPath.indexOf("AvWdth")

if(pos_AvHght > 0){
	var avail_height = querySt("AvHght");
}else{
	var avail_height = screen.availHeight;
}

if(pos_AvWdth > 0){
	var avail_width = querySt("AvWdth");
}else{
	var avail_width = screen.availWidth;
}

//var avail_height = 1024;
//var avail_width = 1280;


var top_space = 0;
var left_space = 10;

avail_height_cor = avail_height - height_correction;

rest_space = avail_height - height_correction;
rest_space = rest_space - 600;
if(rest_space > 0){
	top_space = rest_space/2;
}

rest_space_horz = avail_width - 20;
rest_space_horz = rest_space_horz - 990;
if(rest_space_horz > 30){
	left_space = rest_space_horz/2;
}
else {
	left_space = 10;
}


