function fn_input_placeholders()
{
	var t_fields = $$('.innerLabel');
	t_fields.each(function(field)
	{
		if(field.value == '') field.value=field.title;
		field.observe("blur",function()
		{
			if(field.value == '') field.value=field.title;
			
		}).observe("focus",function()
		{
			if(field.value == field.title) field.value = '';
			
		}).up('form').observe("submit",function ()
		{
			if (field.value == field.title)
			{
				field.value = '';
			}
		})
	})
}

function fn_scrolling_anchors()
{
	$$('a[href^=#]:not([href=#])').each(function(element) {
    	element.observe('click', function(event) {
      		//$('background').scrollTop = -(this.hash.substr(1);
			//var targetElement = this.hash.substr(1);												
			//var anchorPos = Element.Methods.cumulativeScrollOffset($(targetElement));
			//new Effect.Move($('content'),{x: 0, y: -($(this.hash.substr(1)).offsetTop - 195), duration: 1, mode:'relative'});
      		Prototype.Browser.IE6 = Prototype.Browser.IE && parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5)) == 6;
			if (Prototype.Browser.IE6)
			{
				$('background').scrollTop = $(this.hash.substr(1)).offsetTop;
			}
			else
			{
				$('background').scrollTop = $(this.hash.substr(1)).offsetTop - 130;
			}
			Event.stop(event);
    	}.bindAsEventListener(element))
  	})
}

document.observe('dom:loaded',function()
{
	//var realScroll = window.location.hash.substr(1).offsetTop - 130;
	//scrollTo(0,0);
	//alert('test');
	if(window.location.hash)
	{
		setTimeout("window.scrollTo(0, 0)",1);
		setTimeout("$('background').scrollTop -= 130",400);
	}
	fn_input_placeholders();
	fn_scrolling_anchors();
});