browser = navigator.appName;
browserNum = parseInt(navigator.appVersion);

if ((browser == "Netscape") && (browserNum < 5)) {
	// Netscape 4.x
	layerRef = "document.layers['";
	endLayerRef = "']";
	styleRef = "";
} else if ((browser == "Netscape") && (browserNum >= 5)) {
	// Netscape 6
	layerRef = "document.getElementById('";
	styleRef = ".style";
	endLayerRef = "')";
} else {
	// Internet Explorer
	layerRef = "document.all['";
	endLayerRef = "']";
	styleRef = ".style";
}


// ++++++++++++++++ func lib +++++++++++++++



function clear(){
    if (document.login_form.username.value != "")
	document.login_form.userpass.focus();
    else
	document.login_form.username.focus();
}


function check_delete(eform){
    if (confirm("WARNING!\nAre you sure you want to delete this form?\nAll datas are going to be removed!!!"))
	eform.submit();
    else
	return false;
}

function check_delete2(eform,sms){
	
	//eval(layerRef + "switch_form1" + endLayerRef + styleRef + ".display = 'none'");
	if (confirm(sms))
	eform.submit();
    else
	return false;
}


function check_delete_answer(eform){
    if (confirm("WARNING!\nAre you sure you want to delete this?\n"))
	eform.submit();
    else
	return false;
}


function ablak(file,scroll,width,height,altname) {
    nagyablak =window.open('',altname,'top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+scroll+',resizable=1,width='+width+',height='+height);
    nagyablak.document.open();
    nagyablak.document.write("<html><head><title>NagyÄÂ­tÄÄs</title><LINK rel=\"stylesheet\" href=\"themes/style_common.css\" type=\"text/css\"></head><body bgcolor=#ffffff leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>");
    nagyablak.document.write("<div align=center><a href='javascript:window.close()'><img src='"+file+"' border='0' border-color=\"#000000\" alt='"+altname+"' class=\"img\"></a></div>");
    nagyablak.document.write("</body></html>");
    nagyablak.document.close();
} 


function pic_window(url,scroll,width,height){
	if (url != '') {
		window.open(url,'','scrollbars='+scroll+',width='+width+',height='+height+',top=0,left=0');
	}
}

function user_window(url,scroll,width,height){
	if (url != '') {
		window.open(url,'','scrollbars='+scroll+',width='+width+',height='+height+',top=0,left=0');
	}
}


function print_window(url){
	if (url != '') {
		window.open(url,'','scrollbars=1,width=640,height=550,top=0,left=0');
	}
}

function email_window(url){
	if (url != '') {
		window.open(url,'','scrollbars=0,width=480,height=370,top=0,left=0');
	}
}

function check_email_form(eform){
    var hiba = "";
    
    if (eform.to_email.value == "") hiba = hiba + "Please fill in the receipent's e-mail address!\n";
    if (eform.from_name.value == "") hiba = hiba + "Please fill in your name\n";
    
    if (hiba != ""){
	alert(hiba);
	return false;
    }
        
    if (eform.to_name.value == "") hiba = hiba + "Receipent's name\n";
    if (eform.from_email.value == "") hiba = hiba + "Your e-mail address\n";
    if (eform.message.value == "") hiba = hiba + "Message\n";
    if (hiba != ""){
	if (confirm("The following fields were empty:\n\n"+ hiba + "\nAre you sure you want to send this?"))
	    eform.submit();
	else{
	    return false;
	}    
    }
    else{
	eform.submit();
    }
}

function check_contact_form(eform){
    var hiba = "";
    
    if (eform.name.value == "")	hiba = hiba + "Please fill in your name!\n";
    if (eform.phone.value == "") hiba = hiba + "Please fill in you phone number!\n";
    if (eform.email.value == "") hiba = hiba + "Please fill in you e-mail address!\n";
    if (eform.comment.value == "") hiba = hiba + "Please fill the remarks!\n";

    if (hiba != ""){
	alert(hiba);
	return false;
    }
    else{
	eform.submit();
    }
    	
}

function StyleActivate(value){
    if (value == '') {return;}
    var i, lnk;
    for(i=0;(lnk=document.getElementsByTagName("link")[i]);i++){
	if (lnk.getAttribute('rel').indexOf('style') != -1 && lnk.getAttribute('title')){
	    lnk.disabled = true;
	    if (lnk.getAttribute('title') == value){
		lnk.disabled = false;
	    }
	}
    }
    return;
}


// MyMenu Script

function SymError()
{
  return true;
}

window.onerror = SymError;



// Mymenu

activateMenu = function(nav) {
    /* currentStyle restricts the Javascript to IE only */
	if (document.all && document.getElementById(nav).currentStyle) {  
		var navroot = document.getElementById(nav);
        /* Get all the list items within the menu */
        var lis=navroot.getElementsByTagName("LI");  
		for (i=0; i<lis.length; i++) {
            /* If the LI has another menu level */
            if(lis[i].lastChild.tagName=="UL"){
                /* assign the function to the LI */
             	lis[i].onmouseover=function() {		
                   /* display the inner menu */
                   this.lastChild.style.display="block";
      			}
				lis[i].onmouseout=function() {                       
                    this.lastChild.style.display="none";
				}
            }
		}
	}
}

window.onload= function(){
   
    activateMenu('nav'); //you only need one of these for each menu
    activateMenu('vertnav');  
}


// Subscribe e-mail
function unSubscribe(csekbox) {
	if (csekbox.checked) {

		document.nform.action = "/newsletters/unsubscribe.html";
		document.subscribe.name = "unsubscribe";
	} else {

		document.nform.action = "/newsletters/subscribe.html";
		document.subscribe.name = "subscribe";		
	}

}
		function move(fbox, tbox) {
		var arrFbox = new Array();
		var arrTbox = new Array();
		var arrLookup = new Array();
		var i;
		for (i = 0; i < tbox.options.length; i++) {
		arrLookup[tbox.options[i].text] = tbox.options[i].value;
		arrTbox[i] = tbox.options[i].text;
		}
		var fLength = 0;
		var tLength = arrTbox.length;
		for(i = 0; i < fbox.options.length; i++) {
		arrLookup[fbox.options[i].text] = fbox.options[i].value;
		if (fbox.options[i].selected && fbox.options[i].value != "") {
		arrTbox[tLength] = fbox.options[i].text;
		tLength++;
		}
		else {
		arrFbox[fLength] = fbox.options[i].text;
		fLength++;
		   }
		}
		arrFbox.sort();
		arrTbox.sort();
		fbox.length = 0;
		tbox.length = 0;
		var c;
		for(c = 0; c < arrFbox.length; c++) {
		var no = new Option();
		no.value = arrLookup[arrFbox[c]];
		no.text = arrFbox[c];
		fbox[c] = no;
		}
		for(c = 0; c < arrTbox.length; c++) {
		var no = new Option();
		no.value = arrLookup[arrTbox[c]];
		no.text = arrTbox[c];
		tbox[c] = no;
		   }
		}

function SelectAllList(CONTROL){
for(var i = 0;i < CONTROL.length;i++){
CONTROL.options[i].selected = true;
}
}

function SetCookie (name, value, expires, path, domain, secure) {
	var expires = new Date();
	expires.setTime( expires.getTime() + (24 * 60 * 60 * 1000) * 180 ); // 6 months from now

	document.cookie = name + "=" + escape (value) +
    	((expires) ? "; expires=" + expires.toGMTString() : "") +
    	((path) ? "; path=" + path : "") +
    	((domain) ? "; domain=" + domain : "") +
    	((secure) ? "; secure" : "");
}


// DIV-VISIBILITY 
// CSS div-layer-t kapcsol ki illetve ben layerName = a div ami latszodni fog, layerName2 = ez pedig ami eltunik
// js file elejen levo browser meghatarozo mindenkeppen kell hozza!!!


oldLayer = "none";

function showMenu(layerName, layerName2, Mode, Pro) {
	
	if (Mode == null) Mode='block';
	
		// product attribute_add moduljanak tipek valuek-hoz.
		if (Pro != null && Pro == 1) {
			if (oldLayer != "none")	{
				eval(layerRef + oldLayer + endLayerRef + styleRef + ".display = 'none'");
				eval(layerRef + oldLayer2 + endLayerRef + styleRef + ".display = 'inline'");
			}
			if (oldLayer == layerName && oldLayer == oldLayer2)	{
				oldLayer = "none";
			}	else 	{
				oldLayer = layerName;
				oldLayer2 = layerName2;
			}
		}


	// ez fog latszodni
	eval(layerRef + layerName + endLayerRef + styleRef + ".display = Mode");
	
	// masodik hivatkozott layer
	if (layerName2 != null) {
		eval(layerRef + layerName2 + endLayerRef + styleRef + ".display = 'none'");
	}
}

// DIV-VISIBILITY :end

function setinv(id,type) {


var url = '/setinvdate.php';

	
	var date = document.getElementById(type+'_'+id).value;
	var uid = document.getElementById('uid').value
	if (document.getElementById('invdate_'+id).value == "") var invd = false; else var invd = true;
	if (document.getElementById('invdue_'+id).value == "") var invu = false; else var invu = true;
	var param = "?type="+type+"&date="+date+"&id="+id+"&u_id="+uid+"&invd="+invd+"&invu="+invu;

		var uri = url+param;
	new Ajax.Request(uri, {
  	method: 'get',
	onSuccess: function(transport) {
    
    if (transport.responseText.match(/OK/))
      document.getElementById('d'+type+'_'+id).innerHTML = "OK! "+date
    else
      document.getElementById('d'+type+'_'+id).innerHTML = "HIBA";
  }
});

	
}




<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Created by: Lee Hinder, lee.hinder@ntlworld.com -->

<!-- Begin
//set todays date
Now = new Date();
NowDay = Now.getDate();
NowMonth = Now.getMonth();
NowYear = Now.getYear();

if (NowYear < 2000) NowYear += 1900; //for Netscape

//function for returning how many days there are in a month including leap years
function DaysInMonth(WhichMonth, WhichYear)
{
  var DaysInMonth = 31;
  if (WhichMonth == "Apr" || WhichMonth == "Jun" || WhichMonth == "Sep" || WhichMonth == "Nov") DaysInMonth = 30;
  if (WhichMonth == "Feb" && (WhichYear/4) != Math.floor(WhichYear/4))	DaysInMonth = 28;
  if (WhichMonth == "Feb" && (WhichYear/4) == Math.floor(WhichYear/4))	DaysInMonth = 29;
  return DaysInMonth;
}

//function to change the available days in a months
function ChangeOptionDays(Which)
{
  DaysObject = eval("document.form." + Which + "Day");
  MonthObject = eval("document.form." + Which + "Month");
  YearObject = eval("document.form." + Which + "Year");
  Month = MonthObject[MonthObject.selectedIndex].text;
 
 
 
 MonthObject = eval("document.form." + Which + "Month");
 var monthval = MonthObject[MonthObject.selectedIndex].value;
  
  
  
  //qweqwewqe

  
  
  Year = YearObject[YearObject.selectedIndex].text;
  DaysForThisSelection = DaysInMonth(Month, Year);
  CurrentDaysInSelection = DaysObject.length;

  if (CurrentDaysInSelection > DaysForThisSelection)
  {
    for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
    {
      DaysObject.options[DaysObject.options.length - 1] = null
    }
  }
  if (DaysForThisSelection > CurrentDaysInSelection)
  {
    for (i=0; i<(DaysForThisSelection-CurrentDaysInSelection); i++)
    {
      NewOption = new Option(DaysObject.options.length + 1);
      DaysObject.add(NewOption);
    }
  }
    if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex == 0;

writeinto();
}

//function to set options to today
function SetToToday(Which)
{
  DaysObject = eval("document.form." + Which + "Day");
  MonthObject = eval("document.form." + Which + "Month");
  YearObject = eval("document.form." + Which + "Year");

  YearObject[0].selected = true;
  MonthObject[NowMonth].selected = true;
  ChangeOptionDays(Which);

  DaysObject[NowDay-1].selected = true;
}

//function to write option years plus x
function WriteYearOptions(YearsAhead)
{
  line = "";
  for (i=0; i<YearsAhead; i++)
  {
    line += "<OPTION>";
    line += NowYear + i;
  }
  return line;
}
function WriteDayOptions(DaysAhead)
{
  line = "";
  for (i=0; i<=DaysAhead+1; i++)
  {
    line += "<OPTION>";
    line += i;
  }
  return line;
}

//  End -->

function samemonth() {
	  
	  
	   MonthObject = document.getElementById('month');
 var monthval = MonthObject[MonthObject.selectedIndex].value;
	  var chmonth0 = document.getElementById('month0');
	 chmonth0[monthval-1].selected = true;


}
function writeinto() {
	var month0 = document.getElementById('month0');
	 Month_val0 = month0[month0.selectedIndex].text;
	var month = document.getElementById('month');
	 Month_val = month[month.selectedIndex].value;

		var monthto = new Array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");
		var monthfrom = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec");


  for (var i=0; i<monthfrom.length; i++) {
     
	 if (Month_val0 == monthfrom[i]) {
	 Month_val0 = Month_val0.replace(monthfrom[i], monthto[i]);
	 }
	 if (Month_val == monthfrom[i]) {
	 Month_val = Month_val.replace(monthfrom[i], monthto[i]);
	 }

}

	var year = document.getElementById('year');
	year_val = year[year.selectedIndex].text;
	var day = document.getElementById('day');
	day_val = day[day.selectedIndex].text;

	var year0 = document.getElementById('year0');
	year_val0 = year0[year0.selectedIndex].text;
	var day0 = document.getElementById('day0');
	day_val0 = day0[day0.selectedIndex].text;

document.getElementById('book_sdate').value = year_val+"-"+Month_val+"-"+day_val;
document.getElementById('book_fdate').value = year_val0+"-"+Month_val0+"-"+day_val0;


}


function changemonth() {
	
	var chmonth = document.getElementById('month');
	 chval = chmonth[chmonth.selectedIndex].value;
	chtext = chmonth[chmonth.selectedIndex].text;
	var chmonth0 = document.getElementById('month0');
	 chmonth0[chval].selected = true;
}



function checkallmonth() {
	
for (i = 1; i <= 31; i++){
	document.getElementById('eng_'+i).checked = true;
}
	
}

function uncheckallmonth() {
	
for (i = 1; i <= 31; i++){
	document.getElementById('eng_'+i).checked = false;
}
	
}


function toggleweek(lastday) {
	var days = lastday.split("|");
var d1 = parseInt(days[1]);
var d0 = parseInt(days[0]);

for (i = d1; i >= d0; i--)

{
	
			document.getElementById('eng_'+i).checked = true;
		


}
}


function print_booking(url){
	if (url != '') {
		window.open(url,'','scrollbars=1,width=800,height=600,top=0,left=0');
	}
}




function createmonthyear(years) {

	var today= new Date();
	var day= today.getDate();
	var month= today.getMonth()+1;
	var year= today.getFullYear();

		var monthto = new Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12");
		var monthfrom = new Array("Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Szept", "Okt", "Nov", "Dec");


  line = "";
  var counter = 0;
  for (i=0; i<13*years; i++)
  {
	
    var cmonth = month+counter;
	line += "<OPTION name='"+cmonth+"' value='"+year+"-"+cmonth+"'>";
    line += year +" "+ monthfrom[cmonth-1];
	if (cmonth == 12) {
		year = year+1;
		cmonth = 0;
		month = 1;
		counter = -1;
	}
	line += "</OPTION>";
	counter = counter + 1;
  }
  return line;
}







