//array with image src
var arrMenuTop=new Array(
"images/mnu_top_hom_off.gif","images/mnu_top_hom_on.gif","home","home.shtml","21","8",
"images/mnu_top_con_off.gif","images/mnu_top_con_on.gif","contact","contact.shtml","32","8",
"images/mnu_top_map_off.gif","images/mnu_top_map_on.gif","hartaSite","site_map.shtml","31","8");

var arrMenuLogoBottom=new Array(
"images/hom_logo_bottom.gif","home",
"images/hom_logo_bottom.gif","hartaSite",
"images/com_logo_bottom.gif","contact",
"images/com_logo_bottom.gif","com",
"images/ret_logo_bottom.gif","ret",
"images/foo_logo_bottom.gif","foo",
"images/dip_logo_bottom.gif","dip");

var arrMenuFooter=new Array(
"images/middle_bg_home.gif","home",
"images/middle_bg_home.gif","hartaSite",
"images/com_middle_bg.gif","contact",
"images/com_middle_bg.gif","com",
"images/ret_middle_bg.gif","ret",
"images/foo_middle_bg.gif","foo",
"images/dip_middle_bg.gif","dip");

var arrMenuHome=new Array(
"images/hom_mnu_com_off.gif","images/hom_mnu_com_on.gif","com","company.shtml","47","21",
"images/hom_mnu_ret_off.gif","images/hom_mnu_ret_on.gif","ret","retail_brands.shtml","65","21",
"images/hom_mnu_foo_off.gif","images/hom_mnu_foo_on.gif","foo","food_service.shtml","61","21",
"images/hom_mnu_dip_off.gif","images/hom_mnu_dip_on.gif","dip","dipping_shop.shtml","63","21",
"images/hom_mnu_pri_off.gif","images/hom_mnu_pri_on.gif","priv","private_lable.shtml","76","21");

var arrMenuCom=new Array(
"images/com_mnu_como_off.jpg","images/hom_mnu_com_on.gif","com","company.shtml","47","21",
"images/com_mnu_reto_off.jpg","images/hom_mnu_ret_on.gif","ret","retail_brands.shtml","65","21",
"images/com_mnu_fooo_off.jpg","images/hom_mnu_foo_on.gif","foo","food_service.shtml","61","21",
"images/com_mnu_dipo_off.jpg","images/hom_mnu_dip_on.gif","dip","dipping_shop.shtml","63","21",
"images/hom_mnu_prio_off.jpg","images/hom_mnu_pri_on.gif","priv","private_lable.shtml","76","21");

var arrMenuRet=new Array(
"images/ret_mnu_comg_off.gif","images/hom_mnu_com_on.gif","com","company.shtml","47","21",
"images/ret_mnu_retg_off.gif","images/hom_mnu_ret_on.gif","ret","retail_brands.shtml","65","21",
"images/ret_mnu_foog_off.gif","images/hom_mnu_foo_on.gif","foo","food_service.shtml","61","21",
"images/ret_mnu_dipg_off.gif","images/hom_mnu_dip_on.gif","dip","dipping_shop.shtml","63","21",
"images/ret_mnu_prig_off.gif","images/hom_mnu_pri_on.gif","priv","private_lable.shtml","76","21");

var arrMenuFoo=new Array(
"images/foo_mnu_comr_off.gif","images/hom_mnu_com_on.gif","com","company.shtml","47","21",
"images/foo_mnu_retr_off.gif","images/hom_mnu_ret_on.gif","ret","retail_brands.shtml","65","21",
"images/foo_mnu_foor_off.gif","images/hom_mnu_foo_on.gif","foo","food_service.shtml","61","21",
"images/foo_mnu_dipr_off.gif","images/hom_mnu_dip_on.gif","dip","dipping_shop.shtml","63","21",
"images/foo_mnu_prir_off.gif","images/hom_mnu_pri_on.gif","priv","private_lable.shtml","76","21");

var arrMenuDip=new Array(
"images/dip_mnu_comb_off.gif","images/hom_mnu_com_on.gif","com","company.shtml","47","21",
"images/dip_mnu_retb_off.gif","images/hom_mnu_ret_on.gif","ret","retail_brands.shtml","65","21",
"images/dip_mnu_foob_off.gif","images/hom_mnu_foo_on.gif","foo","food_service.shtml","61","21",
"images/dip_mnu_dipb_off.gif","images/hom_mnu_dip_on.gif","dip","dipping_shop.shtml","63","21",
"images/dip_mnu_prib_off.gif","images/hom_mnu_pri_on.gif","priv","private_lable.shtml","76","21");

var imgNameOff = new Array("images/ro/btn_abonare_off.jpg");
var imgNameOn = new Array("images/ro/btn_abonare_on.jpg");

var imgObjOff = new Array(imgNameOff.length);
var imgObjOn = new Array(imgNameOn.length);
PreloadNew()

//preloading images:
function PreloadNew(){
	for (i = 0; i<imgNameOff.length; i++)
	{
		imgObjOff[i] = new Image();
		imgObjOff[i].src = imgNameOff[i];
		imgObjOn[i] = new Image();
		imgObjOn[i].src = imgNameOn[i];
	}
}
//mouseover fumction:
function swapIn(nume,i)
{
	var o = eval("document." + nume);
	o.src = imgObjOn[i].src;
}
//mouseout fumction:
function swapOut(nume,i)
{
	var o = eval("document." + nume);
	o.src = imgObjOff[i].src;
}
//-->

<!--

// browser detection:

var ua = navigator.userAgent;
var ns = (navigator.appName.toLowerCase().indexOf("netscape")!=-1)?1:0;
var ns4 = (document.layers)?1:0;
var ns6 = (document.getElementById && ns)?1:0;
var mac = (navigator.userAgent.toLowerCase().indexOf("mac")!=-1)?1:0;
var macie4 = (mac && !ns && parseInt(ua.substr(ua.indexOf("MSIE")+4,2)) <= 4)?1:0;
var macie = (mac && !ns)?1:0;

if (ns4)
	document.write('<LINK rel="stylesheet" href="ice_cream_ns.css" type="text/css">')
else
{
	document.write('<LINK rel="stylesheet" href="ice_cream.css" type="text/css">')
}

// CSS files, depending on browser:
//if (ns && !ns6) document.write('<LINK rel="stylesheet" type="text/css" href="' + path + 'pegas_ns.css">');
//else document.write('<LINK rel="stylesheet" type="text/css" href="' + path + 'pegas.css">');

function emailAdressIsValid(str){
	var emailAdressFormat = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,3}$/;
	if(str=="")
		{
			return 2
		}
		else if (!(emailAdressFormat.test(str)))
			{
				return 1;
			}
			else
			{				
				return false;
			}
}

function Trim(strToTrim) {
	while(strToTrim.charAt(0)==' '){strToTrim = strToTrim.substring(1,strToTrim.length);}
	while(strToTrim.charAt(strToTrim.length-1)==' '){strToTrim = strToTrim.substring(0,strToTrim.length-1);}
	return strToTrim;
}


// START rollover
function Preload(arrMenu,b){
	// START: preload image
	for (var i=0; i<arrMenu.length; i+=6){
		var j=(parseInt(i/6))
		eval(b + 'On[j] = new Image()');
		eval(b + 'On[j].src = "' + arrMenu[i+1] + '"');
		
		eval(b + 'Off[j] = new Image()');
		eval(b + 'Off[j].src = "' + arrMenu[i] + '"');
	}
	// END: preload image
}


//var homeID = 0;
function GenerateMenuTop1(a){
	strContentTable=""
	var arrMenu=a;
		for(var i = 0; i <arrMenu.length; i+=6){
			var j=parseInt(i/6)
			if(menuID == arrMenu[i+2])
			{
				if(j==2)
				{
					strContentTable += "<TD align=right class='transp'><A href='" + arrMenu[i+3] + "'><IMG src='" + arrMenu[i+1] + "' border=0 name='mnu" + j + "' hspace=3 vspace=1></A></TD>";
				}
				else
				{
					strContentTable += "<TD align=right class='transp'><A href='" + arrMenu[i+3] + "'><IMG src='" + arrMenu[i+1] + "' border=0 name='mnu" + j + "' hspace=3 vspace=1></A><img src=images/mnu_top_sep.gif width=2 height=11 border=0 hspace=3></TD>";
				}
			}
				else
				{ 
					if(j==2)
					{
						strContentTable += "<TD align=right class='transp'><A href='" + arrMenu[i+3] + "' onmouseover=On('" + j + "','mnu','1') onmouseout=Off('" + j + "','mnu','1')><IMG src='" + arrMenu[i] + "' border=0 name='mnu" + j + "' hspace=3 vspace=1></A></TD>";
					}
					else
					{
						strContentTable += "<TD align=right class='transp'><A href='" + arrMenu[i+3] + "' onmouseover=On('" + j + "','mnu','1') onmouseout=Off('" + j + "','mnu','1')><IMG src='" + arrMenu[i] + "' border=0 name='mnu" + j + "' hspace=3 vspace=1></A><img src=images/mnu_top_sep.gif width=2 height=11 border=0 hspace=3></TD>";
					}
				}
						
		}
		strInitialTable = "<TABLE cellspacing=0 cellpadding=0 border=0><TR>" + strContentTable + "</TR></TABLE>";
		document.write(strInitialTable);
}
function GenerateMenuTop2(a){
	var arrMenu=a;
	strContentTable=""
		for(var i = 0; i <arrMenu.length; i+=6){
			var j=parseInt(i/6)						
			if(menuID == arrMenu[i+2])
			{
				strContentTable += "<TD align=right class='transp' width="+arrMenu[i+4]+"><A href='" + arrMenu[i+3] + "'><IMG src='" + arrMenu[i+1] + "' border=0 name='mnu1" + j + "'  width='"+arrMenu[i+4]+"'></A></TD>";
			}			
			else 
			{
				strContentTable += "<TD align=right class='transp' width="+arrMenu[i+4]+"><A href='" + arrMenu[i+3] + "' onmouseover=On('" + j + "','mnu1','2') onmouseout=Off('" + j + "','mnu1','2')><IMG src='" + arrMenu[i] + "' border=0 name='mnu1" + j + "' width='"+arrMenu[i+4]+"'></A></TD>";
			}
		}
		strInitialTable = "<TABLE cellspacing=0 cellpadding=0 border=0><TR>" + strContentTable + "</TR></TABLE>";
		document.write(strInitialTable);
}

//function on - call on onmouseover
function On(mnuNo,mnuNr,objNr) {
	if (document.images) {
		var imgName = mnuNr + mnuNo;
		if(ns6) eval("document.images[imgName].src = objMenu"+objNr+"On[mnuNo].src");
		if(ns) eval("document.images['" + imgName + "'].src = objMenu"+objNr+"On[" + mnuNo + "].src");
		else eval("document.images[imgName].src = objMenu"+objNr+"On[mnuNo].src");
	}
}

// function off - call on onmouseout
function Off(mnuNo,mnuNr,objNr) {
	if (document.images) {
		var imgName = mnuNr + mnuNo;
		if(ns6) eval("document.images[imgName].src = objMenu"+objNr+"Off[mnuNo].src");
		else if(ns) eval("document.images['" + imgName + "'].src = objMenu"+objNr+"Off[" + mnuNo + "].src");
			else eval("document.images[imgName].src = objMenu"+objNr+"Off[mnuNo].src");
	}
}
// STOP rollover


//-->

	
	
//getting the content height:
var contH="100%"
var contW
var headerH=324;//70+250+4
var footerH=49;
var pageBodyW=793;
function GetContentH(){
	if (ns4||ns6) 
		{
			contH=window.innerHeight-headerH-footerH;
			contW=((window.innerWidth-pageBodyW)/2);
		}
	else 
		{
			contH=document.body.clientHeight-headerH-footerH			
		 	contW=parseInt((document.body.clientWidth-pageBodyW)/2);
		}
}

// START: fixing the page content on resize >>>
FixNSWindow();
function FixNSWindow() {
	if (ns6 || ns && (parseInt(navigator.appVersion) == 4)) {
		if (typeof document.NS == 'undefined') document.NS = new Object;
		if (typeof document.NS.NS_scaleFont == 'undefined') {
			document.NS.FixCssInNS = new Object;
			document.NS.FixCssInNS.initWindowWidth = window.innerWidth;
			document.NS.FixCssInNS.initWindowHeight = window.innerHeight;
		}
		window.onresize = FixCssInNS;
	}
}
function FixCssInNS() {
	if (document.NS.FixCssInNS.initWindowWidth != window.innerWidth || document.NS.FixCssInNS.initWindowHeight != window.innerHeight) document.location = document.location;
}
ReloadWindow();
function ReloadWindow(){if (!ns && (ua.toLowerCase()).indexOf("windows")<0) setTimeout("window.onresize=new Function('window.location.reload()')",200);}
// <<< END: fixing the page content on resize

function emailAdressIsValid(str){
	var emailAdressFormat = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z0-9.-]{2,3}$/;
	if(str=="")
		{
			return 2
		}
		else if (!(emailAdressFormat.test(str)))
			{
				return 1;
			}
			else
			{				
				return false;
			}
}
function Trim(strToTrim) {
	while(strToTrim.charAt(0)==' '){strToTrim = strToTrim.substring(1,strToTrim.length);}
	while(strToTrim.charAt(strToTrim.length-1)==' '){strToTrim = strToTrim.substring(0,strToTrim.length-1);}
	return strToTrim;
}

var newWin;
function WinOpen(url,title,w,h){
	w=parseInt(w)
	h=parseInt(h)
	if (!mac) if (new String(newWin)!="undefined" && newWin!=null) if (!newWin.closed) newWin.close();
	newWin=window.open(url,title,"width="+w+",height="+h+",top=0,left=0,location=no,directories=no,hotkeys=no,copyhistory=no,resizable=no,menubar=no,status=no,toolbar=no,scrollbars=no,z-lock=yes");
	//if (mac) win.resizeTo(w+25,h+50)
	newWin.focus()
}


var winImg;
function openPopup(a,b,c)
{
	b=parseInt(b)+15;
	c=parseInt(c)+20;
	
	if (new String(winImg)!="undefined" && winImg!=null) if (!winImg.closed) winImg.close();
	winImg=window.open(a, "OregonIceCream", "height=" + b +",width=" +c+",left=400,top=10,location=no,directories=no,hotkeys=no,copyhistory=no,resizable=yes,menubar=no,status=no,toolbar=no,scrollbars=yes,z-lock=yes");	
	winImg.focus()
//	winImg.resizeTo(b+10,c+30);
}

function openPopupnew(a,b,c)
{
	b=parseInt(b)
	c=parseInt(c)
	if (new String(winImg)!="undefined" && winImg!=null) if (!winImg.closed) winImg.close();
	winImg=window.open(a, "OregonIceCream", "height=" + b +",width=" +c+",left=400,top=50,scrollbars=yes");
	winImg.document.close()	
	winImg.focus()
}
function openImage(a,b,c)
{
	b=parseInt(b)
	c=parseInt(c)
	if (ns4) if (new String(winImg)!="undefined" && winImg!=null) if (!winImg.closed) winImg.close();
	winImg=window.open('', "QuantumWinImage", "height="+b+" ,width="+c+", top=10,left=400, scrollbars=no, resizable=no,status=no,location=no,toolbar=no,menubar=no");
	winImg.document.write('<HTML><HEAD><title>OregonIceCream</title></HEAD><BODY marginheight="0" marginwidth="0" leftmargin="0" topmargin="0"><IMG src="'+a+'" width='+c+'></BODY></HTML>')
	winImg.document.close()	
	winImg.focus()
}
//-->

