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 getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
    try {
      xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
        xmlhttp = false;
      }
    }
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
    try {
      xmlhttp = new XMLHttpRequest();
    } catch (e) {
      xmlhttp = false;
    }
  }
  return xmlhttp;
}





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){

	if (confirm(sms)) 
		eform.value='';	
    else
		return eform.submit();	

}


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 open_window(url,width,height){
	if (url != '') {
		window.open(url,'','scrollbars=1,width='+width+',height='+height+',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


