// JAVASCRIPT FUNCTIONS

// AUTOMATED SCROLLING
$(document).ready(function(){
  $('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;
	  }
	}
  });
});

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

// POP-UP WINDOW LAUNCHER
function openPopWin(winURL, winWidth, winHeight, winScroll) {
	day = new Date();
	id = day.getTime();
	var winOptions = 'menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=' + winScroll + ',resizable=no,width=' + winWidth + ',height=' + winHeight;
	prop = eval("page" + id + " = window.open(winURL, '" + id + "', winOptions);");
}

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

