
function openScreenShot(val)
{
    open('/popup.php?img=' + val, 'screenshot',
         'width=934,height=576,scrollbars=no,resizable=no')
}

function pageload(hash) {
	//hash=hash.replace('*','?');
if(hash) {
$.ajax({type: "GET",url: hash,success: function(msg){$("#content").html(msg);$("#content").fadeIn("fast");updLinks();}});
if(hash=='/demo'){
$("#_demo").addClass('is_demo');
$("#lcol a.sel").removeClass('sel');
$("#lcol ul li.op").removeClass('op');
}
else $("#_demo").removeClass('is_demo');

} 
}

function openFilmPopup(film)
{
    filmn = film.replace('.flv', '');
	open('/film.php?film=' + film, 'film' + filmn, 'width=800, height=600, resizable=1');
}

function openNewsPopup(id)
{
    open('/shownews/index?id='+id,'wiadom',
             'width=533,height=400,scrollbars=yes,resizable=yes')
}
function sh(){
$(">a",this).addClass("ho");

$(this).children("ul").fadeTo(100,1).show(400,function(){$(this).parents("li").bind("mouseenter",sh);});
$(this).unbind("mouseenter",sh);
}
function hi(){

$(">a",this).removeClass("ho");
if(!$(this).hasClass("op"))
$(this).children("ul").fadeTo(100,1).hide(400); 


}
function toogleMenu(){


		  $("#demo_down").show();
		if($(this).parents("li.op").length==0){
			$("#lcol ul li.op ul").hide(300);
			$("#lcol ul li.op").removeClass('op');
		}
		document.title="Navigator : "+$(this).text() 
		   
		$(this).parents('li').addClass('op');
		$("#lcol a.sel").removeClass('sel');
		$(this).addClass('sel');
		$("#content").fadeOut("fast");
		//if($(this).attr('href').indexOf('11')>0)return true;
		
		
		
		return false;
	
}
function hideMenu(){
$("#lcol ul li.op ul").hide(300);
$("#lcol ul li.op").removeClass('op');
$("#lcol a.sel").removeClass('sel');
}


function updLinks(){

$("#content a[href!=''][rel='history']").attr("href",function(){return $(this).attr('href').replace('http://'+location.host,'').replace(/^.*#/, '')+"#"+$(this).attr('href').replace('http://'+location.host,'').replace(/^.*#/, '')});
$("#content a[href!=''][rel='history']").click(function(){
		$("#content").fadeOut("fast");
		$.history.load($(this).attr('href').replace('http://'+location.host,'').replace(/^.*#/, ''));
		if($(this).parents(".menu").length==0){
			if($(".menu a[href='"+$(this).attr("href").replace('http://'+location.host,'')+"']").length){
			 
			toogleMenu.call($(".menu a[href='"+$(this).attr("href").replace('http://'+location.host,'')+"']")[0]);
			
			}else{
				hideMenu();
			}
		}
		return false;
	});

}

/*  $(document).ready(function(){
	
	
	$("a[href!=''][rel='history']").attr("href",function(){return $(this).attr('href').replace('http://'+location.host,'').replace(/^.*#/, '')+"#"+$(this).attr('href').replace('http://'+location.host,'').replace(/^.*#/, '')});

	$("#lcol ul li").bind("mouseenter",sh);
	$("#lcol ul li").bind("mouseleave",hi);
	  
	$.history.init(pageload);
	
	$("#lcol ul:first a[href!='']").click(toogleMenu);
	$("a[href!=''][rel='history']").click(function(){
		$("#content").fadeOut("fast");
		$.history.load($(this).attr('href').replace('http://'+location.host,'').replace(/^.*#/, ''));
		if($(this).parents(".menu").length==0){
			if($(".menu a[href='"+$(this).attr("href").replace('http://'+location.host,'')+"']").length){
			toogleMenu.call($(".menu a[href='"+$(this).attr("href")+"']")[0]);
			}else{
			hideMenu();
			}
		}
		
		
		return false;
	});
	
  }); */

