//my custom scripts
$(document).ready(function(){
	//$("#special-message").slideDown("slow");
	//$("#close-me").click(function () {
		//$("#special-message").slideUp("slow");
	//});	
	$("img").lazyload({    
    	effect : "fadeIn" 
	});
	$("img.showtip[title]").tooltip({
		tip:'#demotip',
		effect: 'fade',  
       	fadeOutSpeed: 100, 
        predelay: 50,
		position: "top left",         
        offset: [65, 180]  		
		});
	$("#footer-navigation ul li a[title]").tooltip({
		tip:'#demotip',
		effect: 'fade',  
       	fadeOutSpeed: 100, 
        predelay: 5,
		position: "top left",         
        offset: [0, 130]  		
		});
		
		
		
	//show fade divs	
	$(".showfade_wrapper").hover(
		function(){
			//$(this).find('.showfade_text').animate({top:"-109px"}, 300);
			$(this).find('.showfade_text').animate({opacity:"1.0"}, 300);
		},
		function(){
			//$(this).find('.showfade_text').animate({top:"109px"}, 100);
			$(this).find('.showfade_text').animate({opacity:".0"}, 300);
		}
	);		
	
	  //organic tabs
	$("#explore-nav li a").click(function() {
				var curList = $("#explore-nav li a.current").attr("rel");
				var $newList = $(this);
				var curListHeight = $("#all-list-wrap").height();
				$("#all-list-wrap").height(curListHeight);				
				$("#explore-nav li a").removeClass("current");
				$newList.addClass("current");
				var listID = $newList.attr("rel");
				if (listID != curList) {
					$("#"+curList).fadeOut(300, function() {
						$("#"+listID).fadeIn();	
						var newHeight = $("#"+listID).height();
						$("#all-list-wrap").animate({
							height: newHeight
						});		
					});		
				} 			
				return false;
			});			
	
	
	
	
	
	
	
	});
  
	 
/* if IE run unitpngfix for sociable fade */
if(jQuery.browser.msie){
	var $shared_path = jQuery("meta[name=shared_path]").attr('content');
	var clear=$shared_path+"/clear.gif"; //path to clear.gif
	document.write('<script type="text/javascript" id="ct" defer="defer" src="javascript:void(0)"><\/script>');var ct=document.getElementById("ct");ct.onreadystatechange=function(){pngfix()};pngfix=function(){var els=document.getElementsByTagName('*'),ip=/\.png/i,al="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='",i=els.length,uels=new Array(),c=0;while(i-->0){if(els[i].className.match(/unitPng/)){uels[c]=els[i];c++;}}if(uels.length==0)pfx(els);else pfx(uels);function pfx(els){i=els.length;while(i-->0){var el=els[i],es=el.style,elc=el.currentStyle,elb=elc.backgroundImage;if(el.src&&el.src.match(ip)&&!es.filter){es.height=el.height;es.width=el.width;es.filter=al+el.src+"',sizingMethod='crop')";el.src=clear;}else{if(elb.match(ip)){var path=elb.split('"'),rep=(elc.backgroundRepeat=='no-repeat')?'crop':'scale',elkids=el.getElementsByTagName('*'),j=elkids.length;es.filter=al+path[1]+"',sizingMethod='"+rep+"')";es.height=el.clientHeight+'px';es.backgroundImage='none';if(j!=0){if(elc.position!="absolute")es.position='static';while(j-->0)if(!elkids[j].style.position)elkids[j].style.position="relative";}}}}};};

}

/* delay function */
jQuery.fn.delay = function(time,func) {
	this.each(function() {
		setTimeout(func,time);
	})
	return this;
};

/* hover fade functions */
function fade_hover() {
	jQuery('.fade_hover').hover(
		function() {
				jQuery(this).stop().animate({opacity:0.4},400);
			},
			function() {
				jQuery(this).stop().animate({opacity:1},400);
		});

}

function portfolio_img_hover() {
	jQuery(".load_img").hover(
		function() {
				jQuery(this).find('.portfolio_hover').stop().animate({opacity:0.4},400);
			},
			function() {
				jQuery(this).find('.portfolio_hover').stop().animate({opacity:1},400);
			});
}

function sociable_hover() {
	jQuery('.sociable_hover').hover(
		function() {
				jQuery(this).stop().animate({opacity:0.5},400);
			},
			function() {
				jQuery(this).stop().animate({opacity:1},400);
		});
}

function button_hover(){
	jQuery('.button_link,button[type=submit],button,input[type=submit],input[type=button],input[type=reset]').hover(
		function() {
				jQuery(this).stop().animate({opacity:0.8},400);
			},
			function() {
				jQuery(this).stop().animate({opacity:1},400);
		});
}

	 
	 
	 

