//var $j = jQuery.noConflict();
this.screenshotPreview = function(){	
	/* CONFIG */
		
		xOffset = 50;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$(".screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot' class='testthumb'><img src='"+ this.rel +"' alt='url preview'/>"+ c +"</p>");								 
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
    });	
	$(".screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};

$(document).ready(function() {
	screenshotPreview(); 				   
	$("a.fbopen").fancybox({ 
	'hideOnContentClick': false
	});  
	
	$("a.clientlogin").fancybox({ 
	'hideOnContentClick': false,
	frameWidth:250,
	frameHeight:200
	});  	
	
	if($.cookie('TEXT_SIZE')) {
		$('#wrap').addClass($.cookie('TEXT_SIZE'));
	}
	$('.resizer a').click(function() {
		var textSize = $(this).attr('class');
		$('#wrap').removeClass('normal large').addClass(textSize);
		$.cookie('TEXT_SIZE',textSize, { path: '/', expires: 10000 });
		return false;
	});
	
	var options = {
  		newsList: "#news",
		tickerRate: 20,
 		startDelay: 1,
		loopDelay: 5000,
 		placeHolder1: " _"
	}
	$('').newsTicker(options);
	
	$("div#slideshow").carousel({
		effect: "fade",
		autoSlide: true,
		loop: true,
		autoSlideInterval: 10000,
		pagination: true
	});
	//Hide (Collapse) the toggle containers on load
		$('.toggle-container').hide();
		$('.firstopen').show();
		//Slide up and down & toogle the Class on click
		$('.trigger').click(function(){
		$(this).toggleClass('active').next('.toggle-container').slideToggle('slow');
		});
		
		$('#promo').innerfade({ speed: 'slow', timeout: 7000, type: 'sequence', containerheight: '194px' });
		
		
});
