// JAVASCRIPT FUNCTIONS

// GLOBAL PAGE MOVEMENT
$(document).ready(function(){
						   
	// AUTOMATED SCROLLING	
	$('a[href*=#]').click(function() {
	if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	&& location.hostname == this.hostname) {
	  var $target = $(this.hash);
	  $target = $target.length && $target
	  || $('[name=' + this.hash.slice(1) +']');
	  if ($target.length) {
		var targetOffset = $target.offset().top;
		$('html,body')
		.animate({scrollTop: targetOffset}, 900);
	   return false;
	  }
	}
	});
	
	//TOGGLES ETC SECTION
	$("#etc").hide();
	$("#etc_btn").toggle(
		function (){$("#etc").slideDown("slow");},
		function hideEtc(){$("#etc").slideUp("slow");}
	);
	
	//LIGHTBOX
	$(function(){
		$.superbox();
	});
	$.superbox.settings = {
		overlayOpacity: .9 // Background opaqueness
	};
	
});


// GET TWEETS
getTwitters('etc_tweet', { 
  id: 'delugestudios', 
  count: 1, 
  enableLinks: true, 
  ignoreReplies: true, 
  clearContents: true,
  template: '%text%<br /><span class="date">%time%</span>'
});

// SCRIPT FOR IE6 ROLLOVERS
function startList() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById('form');
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="INPUT") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
window.onload=startList;


// GET YEAR
function date(get) {
	var mydate=new Date();
	var year=mydate.getFullYear();
	if(get=="year"){document.write(year);}
}


