// JavaScript Document
// toggle between print and web thumbs
function thmbBrowse() { 
	new Effect.Move('webThmbs', {
	  x: 0, y: 46, mode: 'relative',
//	  transition: Effect.Transitions.sinoidal
	});
	new Effect.Move('printThmbs', {
	  x: 0, y: 46, mode: 'relative',
//	  transition: Effect.Transitions.sinoidal
	});
}
function thmbBrowseWeb() { 
	new Effect.Move('webThmbs', {
	  x: 0, y: -46, mode: 'relative',
//	  transition: Effect.Transitions.sinoidal
	});
	new Effect.Move('printThmbs', {
	  x: 0, y: -46, mode: 'relative',
//	  transition: Effect.Transitions.sinoidal
	});
}
// Thanks to Urban Faubion for the following script
document.observe('dom:loaded', function(){
      var links = $$('#selector li');
      links.each( function(element, index){
              element.observe( 'click', function(event){
                      // this is to prevent the same link from being selected multiple times
                      if(this.hasClassName('current')) return;
                      // first link is the web projects link
                      (this == links.first())? thmbBrowse(): thmbBrowseWeb();
                      links.invoke('toggleClassName', 'current');
                      event.stop();
              }.bindAsEventListener(element));
      });
      // you could just give the default selected link a class in the HTML markup instead
      // of using this last line
      links.first().addClassName('current');

});



// toggle between links
//function removeLink() {
//	var links = document.getElementById("selector").getElementsByTagName("li"));
//	links.removeChild();
//	var link = li.getElementsByTagName("a");
//	li.removeChild("link");
//}	

//	var web = document.getElementById("current");
//	web.createElement("a");
//	web.setAttribute("onclick","thmbBrowsePrint()");

// smooth scrolling of page
 // <![CDATA[
	var ua = navigator.userAgent;
	if((ua.indexOf('Mac') > -1) && (ua.indexOf('MSIE') > -1)){
		if(confirm('This browser is very broken.')) location.href='http://getfirefox.com';
				}
				else{
					var smoove = function(evt){
					Event.stop(evt);
					this.onclick = function() {return false;};
					var t = this.uri[1];
					if($(t)) new Effect.ScrollTo(t, {offset: -24});
				}
				Event.observe(window,'load',function(){
				$$('a').each(function(el){
				if(el.href && el.href.indexOf('#') > -1){
				el.uri = el.href.split("#");
				el.observe('click', smoove.bind(el));
				}
			});
		});
	}
 // ]]>
