
var ComboBoxes=Array();
var DesignedComboBox = Array();

function ComboDropDown(comboStr)
{
    combo = document.getElementById("Combo_"+comboStr);

    if (combo.style.visibility=="visible")
        combo.style.visibility="hidden";
    else
        combo.style.visibility="visible";
	//combo.style.zIndex = 2000;
}
function ComboSetHidden(comboStr)
{
    combo = document.getElementById("Combo_"+comboStr);
    combo.style.visibility="hidden";
}

function ComboMouseOver(comboStr)
{
	if (ComboBoxes["Combo_"+comboStr]!=0)
	{
		window.clearTimeout(ComboBoxes["Combo_"+comboStr]);
	}
}

function ComboMouseOut(comboStr)
{
    ComboBoxes["Combo_"+comboStr]=window.setTimeout("ComboSetHidden('"+comboStr+"')",1000);
}

function ComboItemOver(id)
{
	id.className = "COMBO_Item_Over"; 
}
function ComboItemOut(id)
{
	id.className = "COMBO_Item_Normal"; 
}
function ComboItemClick(comboStr,url,text)
{
	var keyField = document.getElementById("Combo_"+comboStr+"_Key");
	var displayField = document.getElementById(comboStr);
	HEADER_reset('gyors');
	HEADER_reset('cegnev');
	keyField.value=url;
	displayField.value=text;
	ComboSetHidden(comboStr);
}

function ComboOpenIFrame(pagid, pid)
{
	var aWin = document.getElementById("div_osszes_"+pid); 
	if (aWin)
	{
		aWin.style.display = "block";	
	} else 
	{
		aWin = document.createElement("DIV");
		aWin.id = "div_osszes_"+pid;
		var aIFrame = document.createElement("IFRAME");
		var aPage = document.getElementById("itpage");
		if (!aPage) aPage = document.body;
		aIFrame.src = 'gosszes_'+pid+'.php?language='+lang;
		aIFrame.style.width="100%";
		aIFrame.style.height="100%";
		aIFrame.frameBorder="no";
		aIFrame.scrolling = "no";
		aWin.style.position = "absolute";
		aWin.style.zIndex = 99999;
		aWin.style.width = "666px";
		aWin.style.height = "376px";
		aWin.style.top = "129px";
		aWin.style.marginLeft = (aPage.clientWidth / 2) - 333 + "px";
		aWin.appendChild(aIFrame);
		aPage.appendChild(aWin);
		aIFrame.contentWindow.sefDivId = aWin.id;
	}
}

function ComboOpenPopup(pagid, pid)
{
	if (pid == "cegnev")
	{
		if (pagid=='')
			window.open( 'osszes_'+pid+'.php' , pid , 'width=680,height=650,scrollbars=yes' );
		else
			window.open( 'osszes_'+pid+'.php?pagid='+pagid , pid , 'width=678,height=768,scrollbars=yes' );
	} else
	{
		if (pagid=='')
			window.open( 'osszes_'+pid+'.php' , pid , 'width=660,height=650,scrollbars=no' );
		else
			window.open( 'osszes_'+pid+'.php?pagid='+pagid , pid , 'width=678,height=768,scrollbars=yes' );
	}
}



function CreateDesignedComboBox(id)
{
	var Combo = Array();
	Combo['timer']=0;
	Combo['items']=Array();
	Combo['ikon']="";
	DesignedComboBox[id]=Combo;
}
function AddDesignedComboBoxItem(id, key, value)
{
	var Item=Array();
	Item['key']=key;
	Item['value']=value;
	DesignedComboBox[id]['items'].add(Item);
}
function ComboPopupSelect(field, value)
{
	window.parent.HEADER_reset('gyors');
	window.parent.HEADER_reset('cegnev');
	window.parent.document.getElementById(field).value = value;

	if (window.parent.document.getElementById('GyorsFilter'))
	{
		window.parent.document.getElementById('GyorsFilter').checked = false;
    	window.parent.document.forms.osszetett.action="talalati.html";
	}
	
	if (ComboIFrameClose()) window.parent.document.forms['osszetett'].submit(); 
}

function ComboIFrameClose()
{
	var result = false; 
	if (selfDiv = window.parent.document.getElementById("div_osszes_tevkor")) 
	{
		selfDiv.style.display = "none";
		result = true;
	}
	if (selfDiv = window.parent.document.getElementById("div_osszes_cegnev"))
	{
		selfDiv.style.display = "none";
		result = true;
	}
	if (selfDiv = window.parent.document.getElementById("div_osszes_marka"))
	{
		selfDiv.style.display = "none";
		result = true;
	}
	if (selfDiv = window.parent.document.getElementById("div_osszes_termek"))
	{
		selfDiv.style.display = "none";
		result = true;
	}
	if (selfDiv = window.parent.document.getElementById("div_osszes_varos"))
	{
		selfDiv.style.display = "none";
		result = true;
	}
	return result;
}