// Menu elemek



belepes = new Array();
var belepett=0;
var days=new Array("vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat");
 var felhaszn = new Array();

var usernev=""; // az igazi nev
var teljesnev="";
var cjelszo="";
var TodaysDate="";


function addtofav(oldal,cim){
    	if (document.all) window.external.AddFavorite(oldal,cim);
    	}




function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=70
} 
function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=20
else if (window.highlighting)
clearInterval(highlighting)
}

//
function honev(ho) {  
 var hmonth = new Array();

           hmonth[1]="január"
           hmonth[2]="február"
           hmonth[3]= "március"
           hmonth[4]="április"
           hmonth[5]=  "május"
           hmonth[6]=   "június"
           hmonth[7]=  "július"
           hmonth[8]=   "augusztus"
           hmonth[9]=   "szeptember"
           hmonth[10]=   "október"
           hmonth[11]=  "november" 
           hmonth[12]=  "december"
 return hmonth[ho]  
  }  
   




function cartitems()
{


menu1="Nyitólap";
menu2="Termékek";
menu3="Kosár tartalma";
menu4="Rendelés elküldés";
menu5="Felhasználó";
menu6="Vendég";



if (GetCookie("nyelv")==1 )
{
menu1="Nyitólap";
menu2="Termékek";
menu3="Kosár tartalma";
menu4="Rendelés elküldés";
menu5="Felhasználó: ";
menu6="Vendég";


}

if (GetCookie("nyelv")==2 )
{
menu1="Home page";
menu2="Products";
menu3="View cart";
menu4="Send the order";
menu5="User: ";
menu6="Visitor";

}

if (GetCookie("nyelv")==3 )
{
menu1="Home page";
menu2="Prodotti";
menu3="Carrello";
menu4="Invia l'ordine";
menu5="Utente: ";
menu6="Visitatore";


}










 belepo=GetCookie("aktivuser");
 if (belepo != null && belepo !=0){
    belepett=1;
    felhaszn=belepo.split(';');
    usernev=felhaszn[0];
   
  }




items='<div id="felsohasab"></div>'; //'<div id="balfelsohasab"></div><div id="jobbfelsohasab"></div>';
document.write(items);





/*date=new Date();
day=date.getDate();
year=date.getYear();
month = honev(date.getMonth()+1);
//year+=(( year<97) ? 2000 : 1900)  ;

TodaysDate = year + ". " + month + ". " + day ;


items=
'<div id="text1"  style="position:absolute; overflow:hidden; left:755px; top:5px; width:250px; height:21px;  text-align:left; z-index:2"><div >' + 
'<div><font class="ws10" face="Tahoma" color="#FFFFFF"> ' +  TodaysDate  +  ".,"  +' </font></div>' +
'</div></div>';

//document.write(items);
*/


if (belepett == 1){
usernev=xreplace( felhaszn[0],"+"," ");

items=
'<div id="text1" style="position:absolute; overflow:hidden; left:815px; top:40px; width:300px; height:21px; text-align:left; z-index:2"><div >' + 
'<div><font class="ws14" face="Tahoma" color="#FFFFFF">' +  menu5 +"<b>"+ usernev+"</b>"  + '</font></div>' +
'</div></div>'

document.write(items);
}
else{
items=
'<div id="text1" style="position:absolute; overflow:hidden; left:847px; top:19px; width:300px; height:21px; text-align:left; z-index:2"><div >' + 
'<div><font class="ws10" face="Tahoma" color="#FFFFFF">'+  menu6 + '</font></div>' +
'</div></div>'
document.write(items);
}


items=
'<table  style="position:absolute; overflow:hidden; top: 25; left:190px;z-index:1; width:600px " align=top  height=40 border=0 cellspacing=2 cellpadding=0  >'+
'<tr bordercolor="#000000" bgcolor="#B80D2F" align="center" valign=center  >'+
'<td class="but21" onmouseover="this.className=\'but22\';" onmouseout="this.className=\'but21\';" onclick=location="index.php" width=25%  ><b>'+menu1+'</b></td>'+
'<td class="but21"  onmouseover="this.className=\'but22\';" onmouseout="this.className=\'but21\';" onclick=location="cart.php" width=25% ><b>'+menu2 + '</b></td>';
 

if (belepett==1) {
items+='<td class="but21" onmouseover="this.className=\'but22\';" onmouseout="this.className=\'but21\';" onclick=location="view.php" width=25% ><b>'+menu3+'</b></td>'+
'<td class="but21" onmouseover="this.className=\'but22\';" onmouseout="this.className=\'but21\';" onclick=location="send.php" ><b>'+menu4+'</b></td>'+
'</tr></table>';}
else{
items+='<td class="nemEl"  style="  color:#333333;   text-align: center;    font: 14px Tahoma  , Arial, Helvetica, sans-serif;"   width=25%><b>'+menu3+'</b></td>'+
'<td  class="nemEl" style="   color:#333333;   text-align: center;    font: 14px Tahoma  , Arial, Helvetica, sans-serif;"  ><b>'+menu4+'</b></td>'+
'</tr></table>';



}


document.write(items);




}


// Display Amount due

function cent(geld,skeiding)

{

geld+='';

dat = new Array();

dat=geld.split(".");

if (dat[1]==undefined) dat[1]="00";

else

{

dat[1]=dat[1].substring(0,2)
if (dat[1].length==1) dat[1]+="0";

}

return (dat[0]+skeiding+dat[1]);
}






function xreplace(checkMe,toberep,repwith){
    	temp = checkMe;
    	a = 0;


        	for(i = 0; i < checkMe.length; i++){
        		a = temp.indexOf(toberep);
        temp = temp.substring(0 , a) + repwith + temp.substring((a + toberep.length));


            if (a == -1){
            	break;
        }
        	}
        	return temp;
    }