/* Global JavaScript */
/* Author: Alexander Schakel 2010 */

var baseURL = 'http://www.brunotti.com/eyewear/';

Cufon.replace('.nav-item',{	hover: true, textShadow: '1px 2px rgba(0, 0, 0, 0.3)'});
Cufon.replace('.nav-item-hover',{	hover: true, textShadow: '1px 2px rgba(0, 0, 0, 0.3)'});
Cufon.replace('.feature-title', {hover: true});
Cufon.replace('.nav-collection-item', {hover: true});

$(document).ready(function() {
						   
	$('.collection').mouseover(function() {
		$('#hover-collection').show();
		//$('#spotlight').hide();
	});
	
	$('#hover-collection').mouseover(function() {
		$('#hover-collection').show();
		//$('#spotlight').hide();
	});
	
	$('.collection').mouseout(function() {
		$('#hover-collection').hide();
		//$('#spotlight').show();
	});
	
	$('#hover-collection').mouseout(function() {
		$('#hover-collection').hide();
		//$('#spotlight').show();
	});
	
						   
	$('.technical').mouseover(function() {
		$('#hover-technical').show();
		//$('#spotlight').hide();
	});
	
	$('#hover-technical').mouseover(function() {
		$('#hover-technical').show();
		//$('#spotlight').hide();
	});
	
	$('.technical').mouseout(function() {
		$('#hover-technical').hide();
	//	$('#spotlight').show();
	});
	
	$('#hover-technical').mouseout(function() {
		$('#hover-technical').hide();
		//$('#spotlight').show();
	});
	
	$('#hover-sunglasses').mouseover(function() {
		$('#hover-technical').show();
		//$('#spotlight').hide();
	});
	
	$('.hover3').mouseover(function() {
		$('#hover-sunglasses').show();
		//$('#spotlight').hide();
	});

	$('#hover-technical').mouseout(function() {
		$('#hover-sunglasses').hide();
		//$('#spotlight').show();
	});
	

});

function loadBoard(id) {

	switch(id) {
		
		default:
		case 2:
		window.location = 'http://www.brunotti.com/eyewear2010/?p=collection&collection=sportfashion';
		break;
		
		case 1:
		window.location = 'http://www.brunotti.com/eyewear2010/?p=collection&collection=cosmopolitan';
		break;
		
		case 3:
		window.location = 'http://www.brunotti.com/eyewear2010/?p=collection&collection=sportspecial';
		break;
		
		case 4:
		window.location = 'http://www.brunotti.com/eyewear2010/?p=collection&collection=sportspecial';
		break;
		
	}
}

/*
 * 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 = 10;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot'><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();
    });	
	$("a.screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


// starting the script on page load
$(document).ready(function(){
	screenshotPreview();
	
	$(".lightbox").colorbox({iframe:true, width:"600", height:"600"});
});


