// fancy box settings
$(document).ready(function() {
	$("a.iframe").fancybox({
		'hideOnContentClick': false,
		'hideOnOverlayClick': false,
		'frameWidth' : 640,
		'frameHeight': 480
	});
	
	$("a.group").fancybox({
		'autoScale'		    : false,
		'width'			    : '100%',
		'height'		    : '100%',				  
		'hideOnContentClick': false
	});
	
	$("a#mapcontent").fancybox({ 
		'frameWidth' : 640, 
		'frameHeight': 480,
		'hideOnContentClick': false
	});
	
	$("a.fullimage").fancybox({
		'autoScale'		    : false,					  
		'width' : 825, 
		'height': 618
	});
	
	$("a.subscribe").fancybox({
		'hideOnContentClick': false,
		'hideOnOverlayClick': false,					  
		'autoScale'	        : false,					  
		'width'             : 720, 
		'height'            : 540,
		'hideOnContentClick': false
	});
});

// scrollable containers
$(function() {				
	// initialize isScrollable 
	$("div.isScrollable").isScrollable({
		size: 5,
		items: '#doors,#ctops',
		hoverClass: 'hover',
		clickable: false
	}).navigator();	
});


/*
 * Url preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 
this.screenshotPreview = function(){	
	/* CONFIG */
		
		xOffset = 140;
		yOffset = 10;
		
	/* END CONFIG */
	$("a.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<div id='screenshot'><img src='"+ this.rel +"' alt='url preview' width='170' />"+ c +"</div>");								 
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
    });	
	$("a.screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};
// starting the script on page load
jQuery(document).ready(function($) {
	// $() will work as an alias for jQuery() inside of this function
	$(screenshotPreview());
});


