$(document).ready(function(){
    $('a.highslide').each(function() {
	    this.onclick = function() {
	      return hs.expand(this,config1);
	    };
	});
    $('a.highslidehtml').each(function() {
    	 this.onclick = function() {
	        return hs.htmlExpand(this, { 
	    		objectType: 'iframe', width: '800' } );
	    };
	});
    /**************************************************/
    if ($("#gmapy").length > 0){
		var myOptions = {
		    zoom: 17,
		    center: new google.maps.LatLng(50.053364, 14.51770),
		    mapTypeId: google.maps.MapTypeId.ROADMAP,
		    scrollwheel: false
		};
		map = new google.maps.Map(document.getElementById("gmapy"),myOptions);	  
		
    	var image = new google.maps.MarkerImage('/public/images/logo-mapa.gif',
    			 new google.maps.Size(100,55),new google.maps.Point(0,0), new google.maps.Point(50,0));
    	 
    	var myLatLng = new google.maps.LatLng(50.053364, 14.51770);
    	 	
    	var marker = new google.maps.Marker({
    	    position: myLatLng,
    	    map: map,
    	    icon: image,
    	    title: "Park hostivař",
    	    zIndex: 100
    	});
    }
    /**************************************************/
    $('#obchody-loga').cycle({ 
        fx:    'fade', 
        delay:  3000,
        timeout: 5000
     });

		
    $('#right-banners div.bouncedown').cycle({ 
        fx:     'scrollDown', 
        easing: 'bounceout', 
        delay:  5000,
        timeout: 5000
    });
    
    $('#right-banners div.shuffle').cycle({ 
        fx:   'shuffle', 
        shuffle: { 
            top:  230, 
            left: -20 
        }, 
        easing: 'backinout', 
        delay: -5500,
        timeout: 4000
    });
    $('#right-banners div.fade').cycle({ 
        fx:    'fade', 
        delay:  3000,
        timeout: 5000
     });
    $('#right-banners div.fade-slow').cycle({ 
        fx:    'fade', 
        delay:  5000,
        timeout: 5000
     });
    if ($(".obchody-col").length > 1) {
	    var twidth = 0; 
	    $(".obchody-col:last table").each(function(){
	    	if (twidth < $(this).width()) twidth = $(this).width();
	    });
	    $(".obchody-col:last table").css("margin-left",(290 - twidth)+"px" );	    
    }
    
	externalLinks();
});
function externalLinks() { 
    if (!document.getElementsByTagName) return; 
   var anchors = document.getElementsByTagName("a"); 
       for (var i=0; i<anchors.length; i++) { 
          var anchor = anchors[i];
          if (anchor.getAttribute("href") && anchor.getAttribute("rel") != "internal") {
            anchor.target = "_blank"; 
          }
       } 
} 

