
//////////////////////////////////
//								//
//   STANDARD CODE LIBRARY		//
//   © Chameleon Net Ltd. 2005	//
//								//
//////////////////////////////////




// Normal pop-up windows

var winThis = null;

var windowReference = null;

function NewWindow(mypage,myname,w,h,scroll){ 

	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	var settings  ='height='+h+',';
		settings +='width='+w+',';
		settings +='top='+wint+',';
		settings +='left='+winl+',';
		settings +='scrollbars='+scroll+',';
		settings +='resizable=yes';
	
	winThis = window.open(mypage,myname,settings);
	
	if(parseInt(navigator.appVersion) >= 4){
		winThis.window.focus();
	}

}


// Modal pop-up windows

function openModalWindow(target,name,height,width,position,resizable){
			
		b_rs = "yes";
		if (resizable==true) b_rs = "yes";
		else if (resizable==false) b_rs = "no";

		if (position == "center"){

			var newTop = (screen.height - height)/2;
			var newLeft = (screen.width - width)/2;

		} else {
			
			if(isIE){ // for IE 5+

				var selfTop = window.screenTop ;
				var selfLeft = window.screenLeft;
				var newTop = selfTop + 5;
				var newLeft = selfLeft + 15;	

			} else if(isMoz){ // For Mozilla, Firefox & Netscape 5+

				var selfTop = this.window.screenY;
				var selfLeft = this.window.screenX;
				var newTop = selfTop + 33;
				var newLeft = selfLeft + 20;	

			} 

		}



	if(isMoz || isIE){ // For Mozilla, Firefox & Netscape 5+
	
		windowReference = window.open(target, name,"width=" + width + ",height=" + height + ",top=" + newTop + ", left=" + newLeft + ", scrollbars=yes,statusbar=no,modal=yes,location=no,menubar=no,resizable=" + b_rs + ",toolbar=no,dependent=yes,dialog=yes,minimizable=no,modal=yes,alwaysRaised=yes");
	
	} else { // other browsers	
	
		alert('Oh dear! Your browser seems to be incompatible with this action.')
	
		}

}
