
// Main Scripts
// ----------------------------------------------------------------------------- //

// Link Scrubber Script
$(document).ready(function() {
	$("a").bind("focus",function(){if(this.blur)this.blur();});}
);


// Scroll Script
$(function(){   
	$("#wrapper").localScroll({duration:1000});
});


// Fix Nav When Screen Scrolls
$(document).ready(function() {  
 // check where the shoppingcart-div is  
 var offset = $("header").offset();  

 $(window).scroll(function () {  
   var scrollTop = $(window).scrollTop(); // check the visible top of the browser  

   if (offset.top<scrollTop)
   		$("header").addClass("fixed"); 
   else
   		$("header").removeClass("fixed"); 
  });  
});


// Portfolio Block Clickable / Hover Captions
$(function() {
	
	$(".porfolio_item").hover(function(){
		$(this).find(".portfoliotext").stop().animate({ bottom: '0' }, 200);
	}, function(){
		$(this).find(".portfoliotext").stop().animate({ bottom: '-35px' }, 200);
	});
	
	$(".porfolio_item").click(function(){
    	window.location = $(this).find("a").attr("href");
		return false;
	});
	
});


// Main Menu Script
//$(document).ready(function() {
//
//    $("ul.main_nav li").hover(function(){
//    
//        $(this).addClass("hover");
//        $('ul:first',this).show();
//    
//    }, function(){
//    
//        $(this).removeClass("hover");
//        $('ul:first',this).hide();
//    
//    });
//
//});


// Opacity Hover
//$(function(){
//	
//	$("img.grey").hover(
//	function() {
//	$(this).stop().animate({"opacity": "0"}, "slow");
//	},
//	function() {
//	$(this).stop().animate({"opacity": "1"}, "slow");
//	});
// 
//});


// Toggle Click Box
//$(function() {
//	
//	$("#register_box").hide();
//	
//	$("a#registerarea").toggle(function(){
//			$("#register_box").fadeTo("fast", 1.0); return false;
//		}, function(){
//			$("#register_box").fadeTo("slow", 0.0); return false;
//	});
//
//});


// Gallery Cycle Code
//$(document).ready(function(){
//		$("#main_image").cycle({ 
//		fx:    'fade',
//		speed: 700,
//		timeout: 4000,
//		pause:  1 
//	});
//});


// Block Clickable
//$(function(){		   
//	$(".descriptionbox").click(function(){
//    	window.location = $(this).find("a").attr("href");
//		return false;
//	});
//});


// Gallery Script
//$(document.body).ready(function(){
//	$(".thumbnails a").click(function(){
//		var largePath = $(this).attr("href");
//		$("#largeImg").attr({ src: largePath }).hide().fadeIn(500);
//		return false;
//	});
//});


// Equal Column Height Script
//$(document).ready(function() {
//	$("#contents_container").equalHeights(); 
//});


// Panel Toggle
//$(document).ready(function() {
//	$("#dropdown_box").hide();
//	$(".dropdown").click(function () {
//		$(this).toggleClass("dropdown_button_active");
//		$("#dropdown_box").slideToggle(400);
//		return false;
//	});
//});


// Hover Image Fade In and Out
//$(document).ready(function(){
//	
//	$(".image_list li img").fadeTo("slow", 0.4);
//	
//	$(".image_list li img").hover(function(){
//		$(this).stop().fadeTo("slow", 1.0);
//		},function(){
//		$(this).stop().fadeTo("slow", 0.4);
//	});
//});


// Minus Margin Click Box
//$(document).ready(function(){
//	$("#home").click(function() {
//		$("#right_col_contents").animate({
//				marginLeft: "0px"
//		}, 500);
//	});
//});


// Minus Margin Hover Box
//$(document).ready(function(){
//	$("ul.sub_navigation li").hover(function() {
//		$(this).animate({
//				marginLeft: "5px"
//		}, 200);
//	}, function(){
//		$(this).animate({
//				marginLeft: "0"
//		}, 300);
//	});
//});


// No Right Click
//$(document).ready(function(){   
//	$("#header_logo").bind("contextmenu",function(e){
//		return false;
//	});
//	$("#contents_container").bind("contextmenu",function(e){
//		return false;
//	});
//	$(".news_image").bind("contextmenu",function(e){
//		return false;
//	});
//});	


// Fade Toggle Plugin
//jQuery.fn.fadeToggle = function(speed, easing, callback) {
//  return this.animate({opacity: 'toggle'}, speed, easing, callback);  
//};
//$(document).ready(function() {
//	$("#popup_hidden_area").hide();
//	$("a#hiddenbox").click(function () {
//		$("#popup_hidden_area").fadeToggle('slow');
//		return false;
//	});
//});


// Form Validate Script
//$(document).ready(function(){
//	$("#emailForm").validate();
//	$("#subscribeForm").validate();
//	$("#loginForm").validate();
//	$("#contactForm").validate();
//});


//if($('#media_carousel li').length > 1)
//{
//	
//}

//$(function(){
//	$(".img_reset", this).stop().fadeTo(300, 1);
//	}, function() {
//	$('.img_reset', this).stop().fadeTo(600, 0);
//	});
//});


//$(document).ready(function(){ 
//
//	$("#contactArea").css('height', '0px');
//	
//	$("a.contact").toggle( 
//		function () { 				
//			$("#contactArea").animate({height: "180px"}, {queue:false, duration: 1000, easing: 'easeOutBounce'}) 
//		}, 
//		function () { 
//			$("#contactArea").animate({height: "0px"}, {queue:false, duration: 800, easing: 'easeInOutQuart'})  
//		} 
//	);
//
//});


//jQuery.fn.sclear = function() {
//	$("a#s1, a#s2, a#s3, a#s4, a#s5, a#s6").removeClass("active"); 
//};


// Add Class to Link Type
//$(document).ready(function(){
//
//	$("a[@href$=pdf]").addClass("pdf");
//
//	$("a[@href$=zip]").addClass("zip");
//
//	$("a[@href$=psd]").addClass("psd");
//	
//	$("a:not([@href*=http://www.webdesignerwall.com])").not("[href^=#]")
//		.addClass("external")
//		.attr({ target: "_blank" });
//
//});

