/* 
	thx to Valerio Proietti 
	and the amazing moo.fx  
	http://moofx.mad4milk.net/
*/
var ScrollLinks = {
	currentHash: false,
	start: function(){
		this.scroll = new fx.Scroll({duration: 1500, transition: fx.sineOut,
onComplete: function(){this.end();}.bind(this)});
		this.allinks = $c(document.getElementsByTagName('a'));
		this.allinks.each(function(lnk){
			if ((lnk.href && lnk.href.indexOf('#') != -1) && ( (lnk.pathname == location.pathname) 
				|| ('/'+lnk.pathname == location.pathname) ) && (lnk.search == location.search)) {
				lnk.onclick = function(){
					ScrollLinks.scroll.clearTimer();
					this.initialHref = this.href;
					this.initialHash = this.hash;
					this.href = "javascript:void(0)";
					setTimeout(function(){this.href = this.initialHref;}.bind(this), 200);
					ScrollLinks.go(this);
				}
			}
		});
	},

	go: function(link){
		this.currentHash = link.initialHash.slice(1);
		if (this.currentHash) {
			this.allinks.each(function(lnk){
				if (lnk.id == ScrollLinks.currentHash){
				//	if (window.opera) lnk =  [lnk].find('parentNode');
					ScrollLinks.scroll.scrollTo(lnk);
					return;
				}
			});
		}
	},

	end: function(){
		if (!/Konqueror|Safari|KHTML/.test(navigator.userAgent))
window.location.hash = "#"+this.currentHash;
		this.currentHash = false;
	}
}      

function go(site) {
	var box = document.getElementById(site);
	destination = box.options[box.selectedIndex].value;
	if (destination)location.href = destination;
}

$(document).ready(function() {
  $('#win-show').change(function() {
    window.location = "/showcase" + this.value;
  });
 
 $('#password-clear').show();
  $('#password').hide();
  
  $('#password-clear').focus(function() {
    $('#password-clear').hide();
    $('#password').show();
    $('#password').focus();
  });
  $('#password').blur(function() {
    if($('#password').val() == '') {
      $('#password-clear').show();
      $('#password').hide();
    }
  });
 
   $('#email').each(function() {
      var default_value = this.value;
      $(this).focus(function() {
          if(this.value == default_value) {
              this.value = '';
          }
      });
      $(this).blur(function() {
          if(this.value == '') {
              this.value = default_value;
          }
      });
  });
});
