if (document.images) {
	n1on = new Image();    n1on.src = "images/nav-home-on.gif";
	n2on = new Image();    n2on.src = "images/nav-product-on.gif";
	n3on = new Image();    n3on.src = "images/nav-service-on.gif";
	n4on = new Image();    n4on.src = "images/nav-about-on.gif";
	n5on = new Image();    n5on.src = "images/nav-contact-on.gif";
	n6on = new Image();    n6on.src = "images/nav-existing-customers-on.gif";
	n7on = new Image();    n7on.src = "images/nav-newsletter-on.gif";
}

function imgOn(imgName) {
	if (document.images) {
		oSrc=document[imgName].src;
		document[imgName].src = eval(imgName + "on.src");
	}
}

function imgOff(imgName) {
	if(oSrc){
		document[imgName].src = oSrc;
	}
}

function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name){
	if (document.cookie.length > 0){
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1){ 
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}

function changeZoom(elID,elID2) {
	var el = document.getElementById(elID);
	
	if (el) {
		var z = getCookie('product-zoom');
		if (z != 'on') z = 'on'
		else z = 'off';
	
		setCookie('product-zoom',z,120);
	
		el.src = 'images/butt_product_zoom_'+z+'.gif';
	
		if (elID2) {
			el = document.getElementById(elID2);
		if (el)
			el.src = 'images/butt_product_zoom_'+z+'.gif';
		}
	}
}


function setZoom(elID,elID2) {
	var el = document.getElementById(elID);
	
	if (el) {
		var z = getCookie('product-zoom');
		if (z != 'on' && z != 'off') z = 'on';
	
		setCookie('product-zoom',z,120);
	
		el.src = 'images/butt_product_zoom_'+z+'.gif';
	
		if (elID2) {
			el = document.getElementById(elID2);
			if (el)
				el.src = 'images/butt_product_zoom_'+z+'.gif';
		}
	}
}

function change_page(p,url) {
	var f = document.forms.paging;
	if (f) {
		f.elements['data[page]'].value = p;
		if (url) {
			f.action = url;
		}
		f.submit();
		return;		
	}
	
	var f = document.forms.paging;
	f.elements['data[page]'].value = p;
	f.submit();
}
