var siteAddr = location.protocol + '//' + location.host + '/';

window.addEvent('domready', function(){
	
	if($$('.textarea')){
		$$('.textarea').addEvent('focus', function(){inputClear(this.id);});
	}
	var scrollCount = $$('.smoothAnchor').length;
	if(scrollCount > 0){
		var mySmoothScroll = new Fx.SmoothScroll({duration:3000, links: '.smoothAnchor', wheelStops: false});
	}
	if(Browser.Engine.trident4 && $('seoblock')){
		$('seoblock').setStyle('bottom', '0px');
	}
	if($('seoblock')){
		var seoSize = $('seoblock').getSize();
		$('maincontent').setStyle('padding-bottom', parseInt(seoSize.y+10));
		$('seoblock').setStyle('left', '10px');
	}
	// Scrolling Refines
	if($('refineSide')){
		var refScroll = $$('.refScrollBlock');
		refScroll.each(function(ele){
			var togBlockID = ele.id;
			var togBut = togBlockID + '_tog';
			var mySlide = new Fx.Slide(togBlockID, {duration: 250});
			$(togBut).addEvent('click', function(e){
				e = new Event(e);
				mySlide.toggle();
				if($(togBut).hasClass('togOpen')){
					$(togBut).removeClass('togOpen');
				} else{
					$(togBut).addClass('togOpen');
				}
				e.stop();
			});
		});
	}
});


function inputClear(id){
	
	var inputValue = $(id).value;
	var inputTitle = $(id).title;
	if(inputValue == inputTitle){
		$(id).set('value', '');	$(id).addClass('highon');
		$(id).addEvent('blur', function(){
			if($(id).value == ''){
				$(id).set('value', inputValue);$(id).removeClass('highon');
			}
		});
	}
}
