$(document).ready(function() {

//set effect from select menu value
	$("#header a").hover(function() {
$(this).css("backgroundPosition","0 -87px");
}, function () {
        $(this).css("backgroundPosition","0 0");

    });

	//set effect from select menu value
	$("#sections div").hover(function() {
        $(this).find(".dropdown").animate({opacity: "show", top: "75"}, "slow");
        $(this).find("h3 a").css("backgroundPosition","0 -70px");
        $(this).find("img").fadeIn("fast")

	}, function () {
        $(this).find(".dropdown").animate({opacity: "hide", top: "-75"}, "slow");
        $(this).find("h3 a").css("backgroundPosition","0 0");
        $(this).find("img").fadeOut("fast")

    });
	
    $("#sections div ul.dropdown, #sections img").hide();
    
});

/*
 * 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 = 60;
		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();
});

/*
$(document).ready(function(){

	$("a[href$='pdf']").addClass("pdf");

	$("a[href$='zip']").addClass("zip");

	$("a[href$='psd']").addClass("psd");
	
	$("a:not([href*='http://i-am-the-one.com'])").not("[href^='#']")
		.addClass("external")
		.attr({ target: "_blank" });

});
*/

$(document).ready(function() {

/*
    $("a[rel="external"]").click( function() {
        window.open( $(this).attr('href'),this, 'width=640,height=430' );
        return false;
    });
*/
		
    $("a#survey").fancybox({
		'frameWidth':726,
		'frameHeight':430,
	});
	
	$("a#avatars").fancybox({
		'frameWidth':380,
		'frameHeight':350,
	});
	
	$("a#wallpapers").fancybox({
		'frameWidth':726,
		'frameHeight':430,
	});
	
	$("a#icons").fancybox({
		'frameWidth':400,
		'frameHeight':430,
	});
	
	$("a#mailer").fancybox({
		'frameWidth':550,
		'frameHeight':280,
	});
	
	$("a#flyers").fancybox({
		'frameWidth':570,
		'frameHeight':500,
	});
	
	$("a#signs").fancybox({
		'frameWidth':450,
		'frameHeight':450,
	});

});