// Assorted JavaScript functions
	function getElement(ref) {
		
		var IE4 = (document.all && !document.getElementById) ? true : false;
		
		var NS4 = (document.layers) ? true : false;

		var IE5 = (document.all && document.getElementById) ? true : false;
		var N6 = (document.getElementById && !document.all) ? true : false;
			
		if(IE5 || N6) {
			return document.getElementById(ref);
		}//end if
		if(NS4) {
			return document.layers(ref);
		}//end if
		if(IE4) {
			return document.all(ref);
		}//end if
	}//end function

	
	function confirm_action(text) {
		return confirm(text);
	}//end function

	
	function navTo(location) {
		window.location.href = location;
	}//end function
	
	
	function chgBgColor(sID, sColor) {
		var oElement = getElement(sID);
		
		oElement.style.backgroundColor = sColor;
	}//end function;
	
	
	function chgClass(sID, sClassName) {
		var oElement = getElement(sID);
		
		oElement.className = sClassName;
	}//end function
	
	
	function cuponPopup(action_id) {
		var URL = "/browser/actions/cupon.php?aid=" + action_id;
		
		window.open(URL, 'cupon', 'menubar=yes, toolbar=no, status=no, width=400, height=300');
	}//end function
	

	function expandingWindow(image) {
		var windowprops='width=1,height=1,scrollbars=0,status=no,resizable=0,location=no'
		var heightspeed = 3;
		var widthspeed = 3;
		var leftdist = 10;
		var topdist = 10;
		var lunghezza = 300;
		var altezza = 600;
		if(lunghezza == 0){
			lunghezza = window.screen.availWidth;
		}
		if(altezza == 0){
			altezza = window.screen.availHeight;
		}
	
		html = '<HTML>\n<HEAD>\n<TITLE>Slika</TITLE>\n</HEAD>\n<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>\n<CENTER><IMG SRC=\"'+image+'\" BORDER=0 NAME=imageTest onLoad=\"window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)\"></CENTER>\n</BODY>\n</HTML>';
		
		if (window.resizeTo&&navigator.userAgent.indexOf("Opera")==-1) {
			var winwidth = lunghezza;
			var winheight = altezza;
			var sizer = window.open("","","left=" + leftdist + ",top=" + topdist +","+ windowprops);
			for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed)
			sizer.resizeTo("1", sizeheight);
			for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed)
				sizer.resizeTo(sizewidth, sizeheight);
			sizer.document.write(html);
		}
	
	}

