   var $j = jQuery.noConflict();
	$j( document ).ready(
  	function()
  	{
    	$j( '.contest' ).not( '#first-news' ).find( '.text' ).hide();
    } );
    function showMore( id )
	{
  		if( $j( id ).parent().parent().children( '.text' ).css( 'display' ) == 'none' )
  		{
    	$j( id ).parent().parent().children( '.text' ).slideDown( 500 );
  		}
  		else
  		{
    		$j( id ).parent().parent().children( '.text' ).slideUp( 500 );
  		}
	}




   
   (function($){
    var origContent = "";
	
    function loadContent(hash) {
        if(hash != "" && hash != "c") {
            if(origContent == "") {
                origContent = $('#normal_text').html();
            }
            $('#dataDiv').load("http://cieszynskakraina.pl/system/map_includes/"+hash +".php",
                               function(){ prettyPrint(); });
			$j('#normal_text').hide("fast");
			$('#dataDiv').show("fast");
			$('#close_button').show("fast");
        } else if(origContent != "") {
			$('#close_button').hide("fast");
			$j('#normal_text').show("fast");
			$('#dataDiv').hide("fast");
            //$('#dataDiv').html(origContent);
        }
		//
		$j('#close_button').click(function() {
			$j(this).hide();
			$j('#normal_text').show("fast");
			$('#dataDiv').hide("fast");});
			
    }

    $(document).ready(function() {
            $.history.init(loadContent);
            $('area').not('.external-link').click(function(e) {
                    var url = $(this).attr('href');
                    url = url.replace(/^.*#/, '');
                    $.history.load(url);
                    return false;
                });
        });
})(jQuery);

	
		
    $j(document).ready(function() {
		        // YOX VIEW
		        $j(".thumbs").yoxview({
				lang: "pl",
				autoHideInfo: false});
		 $j('#mycarousel').jcarousel({
        	vertical: true,
			animation: "slow",
        	scroll: 3,
			 wrap: 'circular',
        	auto: 5
    });
				
     // hides the menu as soon as the DOM is ready
      $j('#close_button').hide();
	  $j('.menu_1').css("background", "url(http://cieszynskakraina.pl/template/menu_button_1_act.png) no-repeat");
	  //$j('#1').hide();
	  $j('#2').hide();
	     
     // toggles the menu on clicking the noted link  
      
	  $j('#menu_button_1').click(function() {
		  $j('.menu_2').css("background", "url(http://cieszynskakraina.pl/template/menu_button_2_pas.png) no-repeat");
		$j('#menu_button_2').css("color", "#343434");  
		$j('.menu_1').css("background", "url(http://cieszynskakraina.pl/template/menu_button_1_act.png) no-repeat");
		$j(this).css("color", "#8f5444");
		$j('#2').hide('300');
		
        $j('#1').toggle(300,callbackfn1);
		
		function callbackfn1(){

     		var $link = $j("#menu_button_1");
			$j(this).is(":visible") ? $j('.menu_1').css("background", "url(http://cieszynskakraina.pl/template/menu_button_1_act.png) no-repeat") ||
									 $j('#menu_button_1').css("color", "#343434")
			 							: $j('.menu_1').css("background", "url(http://cieszynskakraina.pl/template/menu_button_1_pas.png) no-repeat")
										 & $j('#menu_button_1').css("color", "#343434");  ;}
     //$(this).is(":visible") ? $link.text("Less Options «") : $link.text("More Options »");}

			
 	return false;
      });
	  $j('#menu_button_2').click(function() {
		$j('.menu_1').css("background", "url(http://cieszynskakraina.pl/template/menu_button_1_pas.png) no-repeat");
		$j('#menu_button_1').css("color", "#343434");    
		$j('.menu_2').css("background", "url(http://cieszynskakraina.pl/template/menu_button_2_act.png) no-repeat");
		$j(this).css("color", "#8f5444");
        $j('#1').hide('300');
		$j('#2').toggle(300,callbackfn2);
		
		function callbackfn2(){

     		var $link = $j("#menu_button_2");
			$j(this).is(":visible") ? $j('.menu_2').css("background", "url(http://cieszynskakraina.pl/template/menu_button_2_act.png) no-repeat") ||
									 $j('#menu_button_2').css("color", "#343434")
			 							: $j('.menu_2').css("background", "url(http://cieszynskakraina.pl/template/menu_button_2_pas.png) no-repeat")
										 & $j('#menu_button_2').css("color", "#343434");  ;}
        return false;
      });
    });


