
/***********************************************/
// Lista tábla style definiálása!
/***********************************************/	
		$(document).ready(function(){
			var paratlan = "#D4ECF2";
			var paros = "#E9F7FB";
			var inaktiv = "#DBDBDB";
			var mouseover = "#b7eefc";
			
			$("TABLE.entity tr.body:even").css({"background-color":paratlan});
			$("TABLE.entity tr.body:odd").css({"background-color":paros});
			$("TABLE.entity tr.bodyInactive").css({"background-color":inaktiv});
			
			$("TABLE.entity tr.body").mouseover(function(){
			 	$(this).css({"background-color":mouseover});
			}).mouseout(function(){			
				$("TABLE.entity tr.body:even").css({"background-color":paratlan});
				$("TABLE.entity tr.body:odd").css({"background-color":paros});
				$("TABLE.entity tr.bodyInactive").css({"background-color":inaktiv});		
			});
			
		});
	
	
	
	
	
	
/***********************************************/
// Form error style definiálása!
/***********************************************/	
		
	$(document).ready(function() {	
	    $('p.error').each(function () {
		var errorCss = String('background:#fdc2b8 url('+domain+'/images/munkafelulet/icons/admin_error.jpg) no-repeat left top; color:#6B0404;'); 			
		var labelError = String('background:#a40001; color:#FFF;');
		var inputError = String('border:1px solid #a40001; background:#fbf2f2; color:#a40001;'); 	 				
		
			  $('.entity').find('.error').attr('style', errorCss);
			  var $curr = $(this);		
			  $curr = $curr.prev();
			  $curr.find('label').attr('style',labelError);
			  
			  
			  // Ha belekattintok az aktuális input elembe akkor törli a style -t!  					
			 /*
			  $curr.find('input.text').attr('style',inputError)
			  						  .click(function(e) { 
											$(this).removeAttr('style'); 
											$curr.find('label').removeAttr('style'); 
									  });
			  $curr.find('input.pass').attr('style',inputError)
			  						  .click(function(e) { 
											$(this).removeAttr('style'); 
											$curr.find('label').removeAttr('style'); 
									  });
									  
			  $curr.find('input.file_field').attr('style',inputError)
			  						  .click(function(e) { 
											$(this).removeAttr('style'); 
											$curr.find('label').removeAttr('style'); 
									  });
			  
			  
			  $curr.find('input.datum').attr('style',inputError)
			  						  .click(function(e) { 
											$(this).removeAttr('style'); 
											$curr.find('label').removeAttr('style'); 
									  });
			  $curr.find('input.time').attr('style',inputError)
			  						  .click(function(e) { 
											$(this).removeAttr('style'); 
											$curr.find('label').removeAttr('style'); 
									  });
			  $curr.find('select.select').attr('style',inputError)
			  						  .click(function(e) { 
											$(this).removeAttr('style'); 
											$curr.find('label').removeAttr('style'); 
									  });
			  $curr.find('textarea.textarea').attr('style',inputError)
			  						  .click(function(e) { 
											$(this).removeAttr('style'); 
											$curr.find('label').removeAttr('style'); 
									  });		
		*/							  	  
			
		});		
	});
		
		



/***************************************************/
//  Tooltip script - A tpl-ben az adott html elemre
//	egy alt="" attributumban kell megadni a  
//	tooltip szöveglt! 
/***************************************************/			
		
		this.tooltip = function(){	
			/* CONFIG */		
				xOffset = -10;
				yOffset = 15;		
				// these 2 variable determine popup's distance from the cursor
				// you might want to adjust to get the right result		
			/* END CONFIG */
			$(".tooltip").hover(function(e){		
				$("body").append("<div id='tooltip'>"+ this.name +"<\/div>");
				$("#tooltip")
					.css("top",(e.pageY - xOffset) + "px")
					.css("left",(e.pageX + yOffset) + "px")
					.fadeIn("fast");						
			},
			function(){
				$("#tooltip").remove();
			});	
			$(".tooltip").mousemove(function(e){
				$("#tooltip")
					.css("top",(e.pageY - xOffset) + "px")
					.css("left",(e.pageX + yOffset) + "px");
			});			
		};		
		// starting the script on page load
		$(document).ready(function(){	
			tooltip();
		});
		



/***************************************************/
// Tartalom nyomtatása!
/***************************************************/
function Clickheretoprint()
{ 
  var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
      disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; 
  var content_vlue = document.getElementById("print_content").innerHTML; 
  
  var docprint=window.open("","",disp_setting); 
   docprint.document.open(); 
   docprint.document.write('<html><head><title>Pepe Nero</title> <link rel="stylesheet" type="text/css"  media="all" href="http://debian.lan/pepenero/css/print.css">'); 
   docprint.document.write('</head><body onLoad="self.print()"><div id="print_content">');          
   docprint.document.write(content_vlue);          
   docprint.document.write('</div></body></html>'); 
   docprint.document.close(); 
   docprint.focus(); 
}




/***************************************************/
// Fejléc slideshow script!
/***************************************************/		
$(function() {
 $('.fadein IMG:first').appendTo('.fadein').show();
 setInterval(function() {
  $('.fadein IMG:first').hide().appendTo('.fadein').fadeIn(2000);
 }, 4000);
});




