//*****************************//
// 		  Pop Up Window		   //
//*****************************//
var its;
var browserName;
var browserNameLong;
var browserNew;
var preloadFlag = false;
var Macintosh = navigator.userAgent.indexOf('Mac')>0;
	
function its() {
	var n = navigator;
	var ua = ' ' + n.userAgent.toLowerCase();
	var pl = n.platform.toLowerCase();
	var an = n.appName.toLowerCase();
	
	this.version = n.appVersion;
	this.nn = ua.indexOf('mozilla') > 0;
	
	if(ua.indexOf('compatible') > 0) {
		this.nn = false;
	}
	
	this.opera = ua.indexOf('opera') > 0;
	this.ie = ua.indexOf('msie') > 0;
	this.major = parseInt( this.version );
	this.minor = parseFloat( this.version );
	
	this.mac = ua.indexOf('mac') > 0;
	this.win = ua.indexOf('win') > 0;
	
	if(this.ie) {
		if(ua.indexOf("msie 5") > 1) {
			var msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
			this.major = parseFloat(navigator.appVersion.substr(msieIndex,3));
		}
	}
	return this;
}

function browserNaming() {
 its = new its();

 if (!document.getElementById) {
  browserNew = false;
 }
 else {
  browserNew = true;
 }

 if (its.opera) {
  browserName = "Opera";
 }
 else if (its.ie) {
  browserName = "IE";
 }
 else {
  browserName = "NS";
 }

 browserNameLong = browserName + its.major;

}

function spawnWindow(URL,windowName,width,height,scroll) {
	if (Macintosh) {
		if (browserNameLong == "IE4") {
			newheight = parseInt(height + 17);
		}
		else if (browserNameLong == "IE4.5") {
			newheight = parseInt(height + 17);
		}
		else {
			newheight = height;
		}
	}
	else {
		newheight = height;
	}
	if (scroll == '') {
		scroll = 'no';
	}
	var Haut=(screen.height-height)/2;
	var Gauche=(screen.width-width)/2;
	name0 = window.open(URL,windowName,"top="+Haut+",left="+Gauche+",width="+width+",height="+newheight+",resizable=no" );
}

function spawnFixWindow(URL,windowName,width,height) {
	if (Macintosh) {
		if (browserNameLong == "IE4") {
			newheight = parseInt(height + 17);
		}
		else if (browserNameLong == "IE4.5") {
			newheight = parseInt(height + 17);
		}
		else {
			newheight = height;
		}
	}
	else {
		newheight = height;
	}
	if (scroll == '') {
		scroll = 'no';
	}
	name0 = window.open(URL,windowName,"top=0,left=0,screenX=0,screenY=0,toolbar=no,location=no,status=no,menubar=no,scrollbars="+scroll+",width="+width+",height="+newheight+",resizable=no" );
}

