
// remap jQuery to $
(function($){

$("div.detail-over").hide(); 		
$("div.Icon").hide();   
  


$("ul.box div.detail-off").click(function() {
       $(this).parent().find("div.detail-over").fadeToggle("fast");
});
      
      
$("ul.box div.detail-over").click(function() {
		$(this).parent().find("div.detail-over").fadeToggle("fast");
 });
 
 

$("li.twitter").hover(function() {
   $("div.TwitIcon").fadeToggle("slow");
});
$("li.flickr").hover(function() {
   $("div.FlickrIcon").fadeToggle("slow");
});
$("li.in").hover(function() {
   $("div.LinkedIcon").fadeToggle("slow");
});
$("li.tumblr").hover(function() {
   $("div.TumblrIcon").fadeToggle("slow");
});



$(".scroll").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();
		
		//get the full url - like mysitecom/index.htm#home
		var full_url = this.href;
		
		//split the url by # and get the anchor target name - home in mysitecom/index.htm#home
		var parts = full_url.split("#");
		var trgt = parts[1];
		
		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;
		
		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);
	});
 


})(this.jQuery);



// usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){
  log.history = log.history || [];   // store logs to an array for reference
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};



// catch all document.write() calls
(function(doc){
  var write = doc.write;
  doc.write = function(q){ 
    log('document.write(): ',arguments); 
    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
  };
})(document);



