 function dg(_id)
  {
    return document.getElementById(_id);
  }

  function prodSelector()
  {
    _obj = dg("prodSelect");

    _obj.onchange = function()
    {
      _hrefField = dg("prodBaseHref")
      _href = _hrefField.value;

      _k = this.selectedIndex

      location.href = _href+this.options[_k].value+'.php';
    }
  }

       function navigateSubMenu(){
		

          if(_obj = document.getElementById('subsub'))
          {
            _lis = _obj.getElementsByTagName('li');

            for(var i = 0 ; i< _lis.length ; i++)
            {
              if( _lis[i].className.indexOf('m') > -1 )
              {
                _lis[i].firstChild.onclick = function() {
                
					if(this.parentNode.className == 'm6')
                    return true;

                  _parentLi = this.parentNode.parentNode.getElementsByTagName('li')

                  for(var k = 0 ; k< _parentLi.length ; k++)
                  {			
                    if(_parentLi[k].className.indexOf( openedSub+'' ) > -1 )
                    {
                     _parentLi[k].className = _parentLi[k].className.replace(new RegExp(" open\\b"), '');
                     _parentLi[k].firstChild.className = '';
                    }
                  }
                  this.className += ' on'
                  openedSub = this.parentNode.className;
                  this.parentNode.className += ' open';
                  return false;
                }

              }
            }
          }


        }

        function targetHrefNew()
        {
          /* uj ablakba nyitja meg azon linkeket melyek class-a 'new' */
          _hrefs = document.getElementsByTagName('a');
          for( var i = 0; i < _hrefs.length; i++ )
          {
            if( ( _hrefs[i].className.indexOf('new') > -1 )  )
              {
                 _hrefs[i].onclick = function()
                 {
				   window.open(this.getAttribute('href'), "_blank", "");
                   return false;
                 }
              }
          }
        }
        

function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

function setVisible(obj, bool){

// see if it's a document id, if it's not, then it must be an obj reference
	if(typeof obj == "string")
		obj = document.getElementById(obj);

// if user chose false, then lets see if the obj needs to be hidden,
//and if it does, then hide it.
	
	if(bool == false){
		if(obj.style.display != 'none');
			obj.style.display = 'none';
		}

// the user chose true, or omitted the second parameter.
//see if the object is visible. If it isn't, the show it.

	else { 
		if(obj.style.display != '');
		obj.style.display = '';
	}
}
        

function elkuld(mit) {
	var df = dg(mit);
	  df.submit();return true;
}

function kepek_csere(kiskep){


	if(kiskep == "1") 
		{
			document.kiskep1.style.border='2PX solid green';
			document.kiskep2.style.border='2PX solid #cacaca';
			document.kiskep3.style.border='2PX solid #cacaca';
			document.kiskep4.style.border='2PX solid #cacaca';
			document.kiskep5.style.border='2PX solid #cacaca';			
		}
		
		if(kiskep == "2") 
		{
			document.kiskep2.style.border='2PX solid green';
			document.kiskep1.style.border='2PX solid #cacaca';
			document.kiskep3.style.border='2PX solid #cacaca';
			document.kiskep4.style.border='2PX solid #cacaca';
			document.kiskep5.style.border='2PX solid #cacaca';			
		}
		if(kiskep == "3") 
		{
			document.kiskep3.style.border='2PX solid green';
			document.kiskep2.style.border='2PX solid #cacaca';
			document.kiskep1.style.border='2PX solid #cacaca';
			document.kiskep4.style.border='2PX solid #cacaca';
			document.kiskep5.style.border='2PX solid #cacaca';			
		}
		if(kiskep == "4") 
		{
			document.kiskep4.style.border='2PX solid green';
			document.kiskep2.style.border='2PX solid #cacaca';
			document.kiskep3.style.border='2PX solid #cacaca';
			document.kiskep1.style.border='2PX solid #cacaca';
			document.kiskep5.style.border='2PX solid #cacaca';			
		}
		if(kiskep == "5") 
		{
			document.kiskep5.style.border='2PX solid green';
			document.kiskep2.style.border='2PX solid #cacaca';
			document.kiskep3.style.border='2PX solid #cacaca';
			document.kiskep4.style.border='2PX solid #cacaca';
			document.kiskep1.style.border='2PX solid #cacaca';			
		}
}


function resize()
{

	_li=document.getElementById('subsub').getElementsByTagName('li');
  	y_content=document.getElementById('content').offsetHeight;
    y_submenu=document.getElementById('magas').offsetHeight;
	if (document.getElementById('magassag_valasztek')==null) 
		{
				if (y_content-100<y_submenu) document.getElementById('content').style.height=(y_submenu+200)+"px";				
		} else
		{		
				
				 for(var i = 0 ; i< _lis.length ; i++) 
				 	if (_li[i].className.indexOf('open')>-1)
						{if (y_content-100<y_submenu) document.getElementById('content').style.height=(y_submenu+200)+"px";}
					else
					    {
						 y_submenu=(18*document.getElementById('subsub').getElementsByTagName('li').length);
						 if (y_content-100<y_submenu) document.getElementById('content').style.height=(y_submenu+200)+"px";}
		}
}


function nincs_spec_betu(_szoveg)
{ 
	return _szoveg.replace("Õ","ö").replace("õ","o").replace("Û","ü").replace("û","ü");
}  


