﻿$(document).ready(function() {
	// otevírání odkazů v novém okně
	$("a[rel='external']").click(function(){ this.target = "_blank"; });

	$("a[rel=galerie]").fancybox({
		'titlePosition' 	: 'over'
	});
	

$("div.fotogalerieContent div.gallery").hover(function() {
	$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
	$(this).find('img').stop().animate({
			marginTop: '-58px', /* The next 4 lines will vertically align this image */ 
			marginLeft: '-85px',
			top: '50%',
			left: '50%',
			width: '320px', /* Set new width */
			height: '213px', /* Set new height */
			padding: '5px'
		}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */

	} , function() {
	$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
	$(this).find('img').stop().animate({
			marginTop: '0', /* Set alignment back to default */
			marginLeft: '0',
			top: '0',
			left: '0',
			width: '135px', /* Set width back to default */
			height: '90px', /* Set height back to default */
			padding: '10px'
		}, 400);
});


$("div.fotogalerieContent div.gallery-height").hover(function() {
	$(this).css({'z-index' : '10'}); /*Add a higher z-index value so this image stays on top*/ 
	$(this).find('img').stop().animate({
			marginTop: '-78px', /* The next 4 lines will vertically align this image */ 
			marginLeft: '-53px',
			top: '50%',
			left: '50%',
			width: '213px', /* Set new width */
			height: '320px', /* Set new height */
			padding: '5px'
		}, 200); /* this value of "200" is the speed of how fast/slow this hover animates */

	} , function() {
	$(this).css({'z-index' : '0'}); /* Set z-index back to 0 */
	$(this).find('img').stop().animate({
			marginTop: '0', /* Set alignment back to default */
			marginLeft: '0',
			top: '0',
			left: '0',
			width: '80px', /* Set width back to default */
			height: '120px', /* Set height back to default */
			padding: '10px'
		}, 400);
});


});




function loadScript(url, callback){
 
    var script = document.createElement("script")
    script.type = "text/javascript";
 
    if (script.readyState){  //IE
        script.onreadystatechange = function(){
            if (script.readyState == "loaded" ||
                    script.readyState == "complete"){
                script.onreadystatechange = null;
                callback();
            }
        };
    } else {  //Others
        script.onload = function(){
            callback();
        };
    }
 
    script.src = url;
    document.getElementsByTagName("head")[0].appendChild(script);
}

