	
	function opwin(page, name, w, h, s) {
		
		var ie = (document.all) ? true:false;	
		var net = (document.layers) ? true:false;
		
		var scrwdth = screen.width; // Available screen width
		var scrhgth = screen.height; // Available screen height
		var winxpos = 25; // Window X position
		var winypos = 25; // Window Y position
		var winxnme = "left="; // Window X argument name (Netscape or IE)
		var winynme = "top=";  // Window Y argument name (Netscape or IE)
		
		// If Internet Explorer 4
		if(ie) {
		
			winxnme = "left=";
			winynme = "top=";
		
		// If Netscape 4
		} else if(net) {
		
				winxnme = "screenx=";
				winynme = "screeny=";
		}
			
		// Set X and Y position of Window
		winxpos = (scrwdth - w)/2;
		winypos = (scrhgth - h)/2;
				
		// Open window
		window.open(page,name,'width='+w+',height='+h+',location=no,resizeable=no,scrollbars='+s+',toolbar=no,'+winynme+winypos+','+winxnme+winxpos);
		
		// '+winynme+winypos+','+winxnme+winxpos+',
	}
	
	function checkRange(url, frame) {
	
		// Check if range selected
		var i = document.cookie.indexOf('STATE=');
		if (i == -1) {
		
		 // No Current Range
		 opwin('/Scripts/xworks.exe?XwsSrvID=V,STATETEST:' + url + ':' + frame, 'range_popup', 550, 290, 'no');
		} else {
		
			// Range already selected
			if (parent.frames[frame]){
		 
				parent.frames[frame].location = url;
			}
		}
		
		return null;
	}
	
	function centerwin() {
		
		if (document.all) {
		
			var w = document.body.clientWidth;
			var h = document.body.clientHeight;
		} else if (document.layers) {
		
			var w = window.innerWidth;
			var h = window.innerHeight;
		}
		
		window.moveTo((screen.width - w) / 2, (screen.height - h) / 2);
	}


	// www.nowhere.com.au open window JavaScript function 

	var win = null;
	
	function NewWindow(mypage,myname,w,h,scroll,pos) {
	
		if (pos == "random") {
			
			LeftPosition = (screen.width) ? Math.floor(Math.random() * (screen.width - w)) : 100;
			TopPosition = (screen.height) ? Math.floor(Math.random() * ((screen.height - h) - 75)) : 100;
		}
		
		if (pos == "center") {
		
			LeftPosition = (screen.width) ? (screen.width - w) / 2 : 100;
			TopPosition = (screen.height) ? (screen.height - h) / 2 : 100;
		} else if ((pos != "center" && pos != "random") || pos == null) {
		
			LeftPosition = 0;
			TopPosition = 20
		}
		
		settings = 'width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
		win = window.open(mypage,myname,settings);
	}
	