$(document).ready(function(){
   	$(".leftmenu li").each(function (i) {
    	i = i+1;
		if( $(this).text().length < 20 )
			$(this).css("line-height", "30px")
	});

});

/* SEARCH */

function clearSearch(myObj) {
	if(myObj.value == 'Keresés az oldalon') {
		myObj.value = ''; 
		myObj.style.color = '#000000';
		myObj.style.fontWeight = 'normal';
	}
}

function setSearch(myObj) {
	if(myObj.value == '') {
		myObj.value = 'Keresés az oldalon';
		myObj.style.color = '#7F3038';
		myObj.style.fontWeight = 'bold';
	}
}


function loadjscssfile(filename, filetype){
 if (filetype=="js"){ //if filename is a external JavaScript file
  var fileref=document.createElement('script')
  fileref.setAttribute("type","text/javascript")
  fileref.setAttribute("src", filename)
 }
 else if (filetype=="css"){ //if filename is an external CSS file
  var fileref=document.createElement("link")
  fileref.setAttribute("rel", "stylesheet")
  fileref.setAttribute("type", "text/css")
  fileref.setAttribute("href", filename)
 }
 if (typeof fileref!="undefined")
  document.getElementsByTagName("head")[0].appendChild(fileref)
}

/* DETAILS */
function wino(e) {
	window.open($(e).find('a:first').attr('href'),'_blank')
}

function rmwino(e) {
	$(e).parents('tr').attr('onclick','""');
}

/* CLEAR FORM */
$.fn.clearForm = function() {
  return this.each(function() {
 var type = this.type, tag = this.tagName.toLowerCase();
 if (tag == 'form')
   return $(':input',this).clearForm();
 if (type == 'text' || type == 'password' || tag == 'textarea')
   this.value = '';
 else if (type == 'checkbox' || type == 'radio')
   this.checked = false;
 else if (tag == 'select')
   this.selectedIndex = -1;
  });
};