
	// open_window javascript
	w_openwindow = null;
	function open_window(nurl,windowname,width,height, leftPos, topPos, scrollbars, resizable, newwindow)
	{
		if (typeof leftPos == 'undefined' || leftPos < 0) leftPos = (self.screen.width-width-25)/2;
		if (typeof topPos == 'undefined' || topPos < 0) topPos = (self.screen.height-height-25)/2;	
		if (typeof newwindow == 'undefined') newwindow = 0;
		scrollbars = typeof scrollbars == 'undefined' ? 'yes' : 'no';
		resizable = typeof resizable == 'undefined' ? 'yes' : 'no';
		if (newwindow)
		 	window.open(nurl, windowname,'width='+width+',height='+height+',left='+leftPos+',top='+topPos+',directories=no,location=no,menubar=no,scrollbars='+scrollbars+',status=yes,toolbar=no,resizable='+resizable);
		else
			w_openwindow = window.open(nurl, windowname,'width='+width+',height='+height+',left='+leftPos+',top='+topPos+',directories=no,location=no,menubar=no,scrollbars='+scrollbars+',status=yes,toolbar=no,resizable='+resizable);
	}
	
	
	// -------------------------------------------------------------------------
	// Check Input
	// <input type='text' name='bla' size='20' onKeyPress="return numbersonly(this, event)">
	// -------------------------------------------------------------------------
	function numbersonly (myfield, e, dec) {
		var key;
		var keychar;
	
		if (window.event) {
		   key = window.event.keyCode;
		}
		else if (e) {
		   key = e.which;
		}
		else {
		   return true;
		}
		
		keychar = String.fromCharCode(key);
	
		if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27)) {
		   return true;
		}
		else if ((("0123456789.").indexOf(keychar) > -1)) {
			return true;
		}
		else if (dec && (keychar == ".")) {
			myfield.form.elements[dec].focus();
			return false;
		}
		else {
			return false;
		}
	}
	
	// -------------------------------------------------------------------------
	
	// -------------------------------------------------------------------------
	// Preload images
	// Preload all images that were passed
	// -------------------------------------------------------------------------
	function PreLoadImages(folderurl, width, height) {
		var url = new Array();
		var pic = new Array();
		imgwidth = width;
		imgheight = height;
		//alert(folderurl);
		url = folderurl;
		
		for (i = 0; i<url.length; i++){
			pic[i] = new Image(imgwidth, imgheight);
		 	pic[i].src = url[i]; 
		}
	}
