$(document).ready(function() {

/*
// Show Standard Frame on load
	$('body').addClass('standard');
*/
	
// Switch frames 
	$('#FrameType').change( function() {
	
		var thisFrame = $('#FrameType :selected').val();

		if (thisFrame == 'Standard') {
	
			$('body').removeClass('black');
			$('body').removeClass('wood');
			$('body').addClass('standard');			
			}

		else if (thisFrame == 'Black Plastic') {
	
			$('body').removeClass('standard');
			$('body').removeClass('wood');
			$('body').addClass('black');		
			}

		else if (thisFrame == 'Wood') {
	
			$('body').removeClass('standard');
			$('body').removeClass('black');
			$('body').addClass('wood');
			}

	});











// Fade logo 

$(document).ready(function(){
$("h1 a").hover(
function() {
$(this).stop().animate({"opacity": "0"}, "slow");
},
function() {
$(this).stop().animate({"opacity": "1"}, "slow");
});

});







// fade theme section

    $(document).ready(function() {
        $('div.theme span').each(function() {
            $(this).hover(function() {
                $(this).stop().animate({ opacity: 1.0 }, 250);
            },
           function() {
               $(this).stop().animate({ opacity: 0.0 }, 250);
           });
        });
    });








// fade nav

    $(document).ready(function() {
        $('#van ul li').each(function() {
            $(this).hover(function() {
                $(this).stop().animate({ opacity: 1.0 }, 250);
            },
           function() {
               $(this).stop().animate({ opacity: 0.0 }, 250);
           });
        });
    });







// PP Drag for Total Price

/*
$(document).ready(function() {
    $("#total-price").ppdrag();
});

*/







// jquery.event.drag (because PP Drag prevents focus on text box)

/*
$(document).ready(function() {

	$('#total-price').bind('drag',function( event ){
		$( this ).css({
			top: event.offsetY,
			left: event.offsetX
			});
		});
});

*/





// Dragndrop

$('.dragDiv').Drags({
   handler: '.handler'
});














/*
 * 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 = 108;
		yOffset = -330;
		
		// 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();
});


















	});
