
function isIE(){
	var IE=v=false,n;try{n=navigator.appVersion;IE=(n.indexOf('MSIE')!=-1)}catch(e){}
	if(IE)v=n.substr(n.indexOf('MSIE')+5,1);return parseInt(v);
}


function top_menu() {
	var a_width = 0;
	$('li.headlink').hover(
			function() { 
				/*var width = $(this).width()-20;
				$(this).find("a").each(function() {
					var this_width = parseInt($(this).css("width"))
					if(this_width > a_width) a_width = this_width;
				});*/
				$('ul', this).show();
				$(this).addClass("hover");
				/*if(width > a_width) $('ul', this).find("a").width(width);
				else $('ul', this).find("a").width(a_width);*/
				},
			function() { $('ul', this).hide(); $(this).removeClass("hover"); //a_width = 0;
			});
}

function top_menu_ie() {
	if(isIE()==7){
	$('li.headlink').each(function(){
		var a_width = $(this).find("ul").width()-20;
		$(this).find("ul li a").width(a_width);
	});
	}	
}

function content_box(selector) {
	var box_height = 0;
	selector.find(".content_box").each(function(){
		if($(this).height() > box_height) box_height = $(this).height();	
	});
	selector.find(".content_box").height(box_height);
}

function menu_box(selector) {
	//var menu_box_height = selector.find("ul").height()+8;
	//selector.find("ul").css("margin-top",-menu_box_height);
	selector.hover(
			function() { $('ul', this).slideDown("fast");},
			function() { $('ul', this).stop(true, true).slideUp("fast");});
}

function BroszuraOnline(t){
window.open("files/swf/broszury_online/"+t+"/index.html","mywindow","location=0,status=0,scrollbars=0,width=950,height=670");
} 


$(document).ready(function(){
	top_menu();
	top_menu_ie();
	//content_box($("#content_row_1"));
	//content_box($("#content_row_2"));
	menu_box($("#ftm"));
	menu_box($("#m"));
	menu_box($("#asp"));
});