	
	window.addEvent("domready",function(){
		
		
		var arrTop3Separators = $$("#top .separator ");
		if(arrTop3Separators.length > 1) 
		{
			if($type(arrTop3Separators[arrTop3Separators.length - 1]) !== false)
				arrTop3Separators[arrTop3Separators.length - 1].dispose();
		}
		
		
		var arrLeftMenuItems = $$('.mt_left_menu_item');
		arrLeftMenuItems.each(function(element,index){
			element.addEvent("mouseenter",function(){
				
				$clear(objTransport.mixLeftMenuDelay);
				
				if($type($('left_menu_item_content')) != false) {
					$('left_menu_item_content').dispose();
				}
				
				var newEl = new Element("div",{
					"id":"left_menu_item_content",
					'events': {
					        'mouseleave': function(){
								//alert("in");
								this.dispose();
					        },
							 'mouseenter': function(){
								$clear(objTransport.mixLeftMenuDelay);
					            //showLeftSubmenu(this,element,false);
					        }
					    }

				});
				
				showLeftSubmenu(newEl, element,2000);
			})
		})
		
		
		
		//menu główne:
		//new UvumiDropdown('dropdown-menu');
		
		//zmiana wielkości liter
		aaaFontStyle = getCookie('user_css');
		new Asset.css(objTransport.strApppath +"css/"+aaaFontStyle);
		changeAAAimage(aaaFontStyle);
	
		var date 			= new Date();
		var cookie_expire 	= new Date(date.getFullYear(), date.getMonth(),date.getDate()+10,date.getHours(), date.getMinutes(),date.getSeconds()); 
	
		if($type($('font_normal')) !== false) {
			$('font_normal').addEvent("click",function(){
				new Asset.css(objTransport.strApppath +"css/font_normal.css");
				document.cookie = "user_css=font_normal.css; expires="+cookie_expire+"; path=/";
				changeAAAimage('font_normal.css');
			})	
		}
		
		if($type($('font_bigger')) !== false) {
			$('font_bigger').addEvent("click",function(){
				new Asset.css(objTransport.strApppath +"css/font_bigger.css");
				document.cookie = "user_css=font_bigger.css; expires="+cookie_expire+"; path=/";
				changeAAAimage('font_bigger.css');
			})	
		}
		
		if($type($('font_the_biggest')) !== false) {
			$('font_the_biggest').addEvent("click",function(){
				new Asset.css(objTransport.strApppath +"css/font_the_biggest.css");
				document.cookie = "user_css=font_the_biggest.css; expires="+cookie_expire+"; path=/";
				changeAAAimage('font_the_biggest.css');
			})	
		}
	})
	
	
	function showLeftSubmenu(newEl,parentElement,time)
	{
			
		var innerUl = $$("#" + parentElement.id + " ul");
		newEl.innerHTML = "<ul class='left_menu_item_inner'>" + innerUl[0].innerHTML + "</ul>";
		
		//newEl.inject($("content_right"),"top");
		
		newEl.inject($("page_container"),"top");
		
		var posLeft = $('content_left').getCoordinates().left + $('content_left').getCoordinates().width ; 
		var posTop 	= $('content_left').getCoordinates().top;
		
		newEl.setStyle("top",posTop+"px");
		newEl.setStyle("left",posLeft+"px");
		//newEl.setStyle("top","10px");
		//newEl.setStyle("left","10px");
		newEl.setStyle("z-index","100");
		
		if(time !== false)		
			objTransport.mixLeftMenuDelay = hideLeftSubmenu.delay(time);
	}
	
	
	function hideLeftSubmenu()
	{		
		if($type($('left_menu_item_content')) !== false) {
			$('left_menu_item_content').dispose();
		}
	}
	
	function show_loader(id)
	{
		if($type($(id)) !=false)
			$(id).innerHTML = "<img src='http://static.medforum.pl/ptp/images/loader.gif' alt='loading...' />";	
	}
	
	function check_confirm()
	{
		var c = confirm("Czy na pewno wykonać operację?");
		if(c==false)	
			return false;
		else 
			return true;
	}
	
	
	function print_content()
	{
		
		//var contents = $$(".resize_text");
	
		//if(contents.length == 1)
		//{
			popup = window.open('','popup','menubar=no,toolbar=no,scrollbars=yes,resizable=yes,fullscreen=no,width=600,height=470'); 
			popup.focus();
			popup.document.open(); 
			popup.document.write("<html><head>");
			popup.document.write("<style type='text/css'> .hidden {visibility: hidden} </style>");
			popup.document.write("<link rel='Stylesheet' type='text/css' href='"+ objTransport.strApppath +"css/style.css' />");
			popup.document.write("</head><body oncload='window.self.print();'>"); 
			//popup.document.write('<p><a href="javascript:voud(0);" onclick="window.self.print();return false">Drukuj</a></p>');
			//popup.document.write(contents[0].innerHTML); 
			popup.document.write('<p style="padding:10px" ><img src="' + objTransport.strFileStorage +'images/logo_print.jpg" alt="" /></p><br />');
			
			//if($type($('header_hidden')) != false)
			popup.document.write("<h3 style='padding:10px;'>" + $('print_header').innerHTML + "</h3>");
			
			popup.document.write("<div class='resize_text' style='padding:10px;'>" + $('print_content').innerHTML+"</div><br /><br />");
		
			popup.document.write("<p style='padding:10px;'>Polskie Towarzystwo Psychiatryczne</p>");
			popup.document.write("<p style='padding:10px;'>www.psychiatria.org.pl</p>");

			popup.document.write("</body></html>"); 
			popup.print();
			popup.document.close(); 
		//}
	}
	
	/*
	function print_content()
	{
		
		var content = $("print_content");
		var title = $("print_header");
		//var apppath = '/application/edumed/';
		//var imgpath = 'http://static.medforum.pl/edukacjamedyczna/';
	
		
			popup = window.open('','popup','menubar=no,toolbar=no,scrollbars=yes,resizable=yes,fullscreen=no,width=600,height=470'); 
			popup.focus();
			popup.document.open(); 
			popup.document.write("<html><head>");
			popup.document.write("<style type='text/css'> .hidden {visibility: hidden} </style>");
			popup.document.write("<link rel='Stylesheet' type='text/css' href='"+objTransport.strApppath+"css/style.css' />");
			popup.document.write("</head><body oncload='window.print()'>"); 
			//popup.document.write('<p><a href="javascript:voud(0);" onclick="window.self.print();return false">Drukuj</a></p>');
			//popup.document.write(contents[0].innerHTML); 
			popup.document.write('<img src="' + objTransport.strFileStorage +'images/logo.jpg" alt="" /><br /><br />');
			popup.document.write('<h1>' + title.innerHTML + '</h1><br /><br />');
			
			if($type($('header_hidden')) != false)
				popup.document.write('<h3>'+$('header_hidden').innerHTML+'</h3>');
			
			popup.document.write(content.innerHTML+"<br /><br />");
		
			popup.document.write("<p>Polskie Towarzystwo Psychiatryczne</p>");
			popup.document.write("<p>www.psychiatria.org.pl </p>");

			popup.document.write("</body></html>"); 
			//popup.print();
			popup.document.close(); 
		
	}
	*/
	
	function getCookie(nazwa)
	{
	    var ciastka = document.cookie.split(";");

	    var tab = new Array();
	    
	    for(var i=0; i< ciastka.length; i++)
	    {
	         var temp = ciastka[i].split("=");
	         tab[i] = new Array(temp[0],temp[1]); //pierwszy element to nazwa, drugi wartość

	    }
	        
		var result = 'f';
			
	    for(var i =0; i< tab.length; i++)
	    {
	         tab[i][0] =   tab[i][0].replace(" ",""); //usunięcie spacji

	         if(tab[i][0] == nazwa)
	             result = tab[i][1];

	    }
		
		return result;

	}
	
	function changeAAAimage(imgName)
	{
		if($type($('f_normal')) !== false &&  $type($('f_bigger')) !== false && $type($('f_the_biggest')) !== false) 
		{ 
			$('f_normal').src = objTransport.strFileStorage +"images/font_normal.png";
			$('f_bigger').src = objTransport.strFileStorage +"images/font_bigger.png";
			$('f_the_biggest').src = objTransport.strFileStorage +"images/font_the_biggest.png";
			
			if(imgName == 'font_normal.css') $('f_normal').src = objTransport.strFileStorage +"images/font_normal_c.png";
			else if(imgName == 'font_bigger.css') $('f_bigger').src = objTransport.strFileStorage +"images/font_bigger_c.png";
			else if(imgName == 'font_the_biggest.css') $('f_the_biggest').src = objTransport.strFileStorage +"images/font_the_biggest_c.png";
		}
	}

		
