function ablak(file,scroll,width,height,name) {
    nagyablak =window.open('',name,'top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+scroll+',resizable=0,width='+width+',height='+height);
    nagyablak.document.open();
    nagyablak.document.write("<html><head><title>Popup</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='1' alt='"+name+"' class=\"pic\"></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 images_window(url){
	if (url != '') {
		window.open(url,'','scrollbars=0,width=730,height=640,top=0,left=0');
	}
}

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

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

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

function order_window($url) {
	window.open($url,'','top=0,left=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=770,height=550');
}

function check_email_form(eform){
    var hiba = "";
    
    if (eform.to_email.value == "") hiba = hiba + "Kérjük adja meg a címzett E-mail címét!\n";
    if (eform.from_name.value == "") hiba = hiba + "Kérjük adja meg az Ön nevét!\n";
    
    if (hiba != ""){
		alert(hiba);
		return false;
    }
        
    if (eform.to_name.value == "") hiba = hiba + "A címzett neve\n";
    if (eform.from_email.value == "") hiba = hiba + "Az Ön e-mail címe\n";
    if (eform.message.value == "") hiba = hiba + "Üzenet szövege\n";
    if (hiba != ""){
		if (confirm("A következő mezők nem lettek kitöltve:\n\n"+ hiba + "\nBiztos, hogy elküldi?")){
		    eform.submit();
		    return true;
		}else{
		    return false;
		}    
    }else{
		eform.submit();
		return true;
    }
}

function check_contact_form(eform){
    var hiba = "";
    
    if (eform.c_name.value == "") hiba = hiba + "Kérjük adja meg az Ön nevét!\n";
    if (eform.c_company.value == "") hiba = hiba + "Kérjük adja meg az Ön cégének nevét!\n";
    if (eform.c_email.value == "") hiba = hiba + "Kérjük adja meg az Ön e-mail címét!\n";
    if (eform.c_message.value == "") hiba = hiba + "Kérjük adja meg az üzenet szövegét!\n";
    if (eform.sec_code.value == "") hiba = hiba + "Kérjük adja meg a biztonsági kódot!\n";
    if (hiba != ""){
		alert(hiba);
		return false;
    }else{
		eform.submit();
		return true;    	
	}
}

function switchHelp(object) {
	if (document.getElementById) {
		if (!document.getElementById(object).style.display){
			document.getElementById(object).style.display = 'block';
			document.getElementById(object).style.visibility = 'visible';			
		}else if (document.getElementById(object).style.display == 'none'){
			document.getElementById(object).style.display = 'block';
			document.getElementById(object).style.visibility = 'visible';
		}else{
			document.getElementById(object).style.display = 'none';
			document.getElementById(object).style.visibility = 'hidden';			
		}
	}else if (document.layers && document.layers[object]) {
		if (!document.layers[object].display){
			document.layers[object].display = 'block';
			document.layers[object].visibility = 'visible';				 
		}else if (document.layers[object].display == 'none'){
			document.layers[object].display = 'block';
			document.layers[object].visibility = 'visible';		
		}else{
			document.layers[object].display = 'none';
			document.layers[object].visibility = 'hidden';				
		}
	}else if (document.all) {
		if(!document.all[object].style.display){
			document.all[object].style.display = 'block';
			document.all[object].style.visibility = 'visible';				
		}else if (document.all[object].style.display == 'none'){
			document.all[object].style.display = 'block';
			document.all[object].style.visibility = 'visible';			
		}else{
			document.all[object].style.display = 'none';
			document.all[object].style.visibility = 'hidden';
		}
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}else{
		return false;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function MM_findObj(n, d) { //v4.01
	var p,i,x;  
	if(!d) d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) 
		if ((obj=MM_findObj(args[i]))!=null) { 
			v=args[i+2];
			if (obj.style) {
				obj=obj.style; 
				v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
				obj.visibility=v; 				
			}
		}
}

function contact_show(id){
	MM_showHideLayers('div_contact_'+id,'','show','div_contact_close_'+id,'','show');
}

function contact_map_show(){
	MM_showHideLayers('div_contact_map','','show','div_contact_map_close_','','show');
}

function reportError(request){
	alert('Bocsi, ez nem jött össze.');
}

function showResponse(originalRequest){
	alert(originalRequest.responseText);
}

function flip_actual(aclass,aobj){
	// hide every element with class 'aclass' 
	var flips = getElementsByClass(aclass);
	for(i=0; i<flips.length; i++)
		flips[i].style.border = '1px solid #432208';
	// change every element with class 'aclass'		
 
	document.getElementById(aobj).style.border='1px solid #432208';
	// show element with given style
}

function getElementsByClass( searchClass, domNode, tagName) {
	if (domNode == null) domNode = document;
	if (tagName == null) tagName = '*';
	var el = new Array();
	var tags = domNode.getElementsByTagName(tagName);
	var tcl = " "+searchClass+" ";
	for(i=0,j=0; i<tags.length; i++) {
		var test = " " + tags[i].className + " ";
		if (test.indexOf(tcl) != -1)
			el[j++] = tags[i];
	}
	return el;
}