var prop = 20;



$(document).ready(function(){

my_resize();						   

						   

$(window).resize(function() {  						  

  my_resize();

});



function my_resize(){

  var br_h = $(window).height();

  var br_w = $(window).width();

  

  var new_h = Math.round(br_h*prop/100);

  $('#header_wrapper').css("height",new_h);  

  $('#footer').css("height",new_h); 

  $('#submenu').css("height",br_h-2*new_h);

  $('#C').css("height",br_h-80-2*new_h);



  

  $('#menu').css("margin-top",(new_h-$('#menu').height())+'px');
  $('#menu').css("margin-right",(br_w/2-0.5*$('#menu').width())+'px');
  $('#logo').css("margin-left",br_w/2-132+'px');

 // $('#footer #copyr').css("margin-left",((br_w-960)/2)+'px');

  //$('#footer #ftop').css("margin-left",((br_w-960)/2)+'px');

  

 // var o_w = $('#footer #overlay').width(); $('#footer #overlay').css("margin-left",(960-o_w+(br_w-960)/2)+'px');

}



var FS=false;

var OH=0;

$('#FS').click(

 function(){
	 if(FS==false){
		 FS=true;
		 $('span',this).html('-');
		 OH = $('#footer').height();
		 $('#footer').animate({height:30}, 1000, function() { });		 	
		 $('#header_wrapper').animate({top:(0-OH)}, 1000, function() { });		
		 $('#footer #copyr,#submenu,#C').hide();		 
	 }
	 else{
		 FS=false;
		 $('span',this).html('+');	
		 $('#footer').animate({height:OH}, 1000, function() { });		 	
         $('#header_wrapper').animate({top:0}, 1000, function() { });
		 $('#footer #copyr,#submenu').show();
		 if ($('#C').attr('mod')=='hide' ){}else $('#C').show();
		 }
  }			   
);

						   

						  

});







// Triggers



$(document).ready(function(){

  $("#loader").hide();						   

						   

	

	

	

	function loading(what){

		$("#loader").show();

		$("#overlay_right").hide();

/*		

  $("#hholder").load("test.html", function(response, status, xhr) {

    if (status == "error") alert("Error: " + xhr.status + " " + xhr.statusText); 

    else{ 	  

      	$("#loader").hide();

		$("#overlay_right").show();

		if($('#hholder').height()<400) $('#overlay_right .right').css('overflow','hidden'); else $('#overlay_right .right').css('overflow-y','scroll');      		

	  

	  $("#hholder img").css('cursor','pointer');

	  $("#hholder img").click(function() {			

			var what = $(this).attr('src');						  

		    $.fancybox({'href' : what,'transitionIn'	: 'none', 'transitionOut'	: 'none' ,'titleShow':'false','scrolling':'no','overlayOpacity':'0'});			

      });

   

	   }

  });

  */	

}

	


});








