
// INPUT SWITCH CONTENT ON FOCUS
Element.implement({
	inputHint : function(val){
		switch(this.get('tag')){
			case 'form':
				this.getElements('input[type="text"],textarea').inputHint(val);
				return this;
			case 'input':
			case 'textarea':
				this.store('default',(val||this.get('value')));
				this.addEvents({
					'focus':function(){
						if(this.get('value') == this.retrieve('default')){
							this.set('value', '');
						}
					},
					'blur':function(){
						if(this.get('value').clean() == ''){
							this.set('value', this.retrieve('default'));
						}
					}
				}).fireEvent('blur');
			default: return this;
		}
	}
});


window.addEvent('domready', function() {
	
	//EXTERNAL LINKS			
	$(document.body).getElements('a[rel=external]').set('target', '_blank');	
	
	// BACKGROUND IMAGE CACHE
	try {
		document.execCommand("BackgroundImageCache", false, true);
	} catch(err) {}
	
	// SMOOTH SCROLL PAGE
 	new SmoothScroll({ duration:700 }, window);
	
	// TOOL TIPS														 
	var tooltip = new Tips($$('.tooltip'));
	
	// INPUT SWITCH CONTENT ON FOCUS
	$('site_search').inputHint();
		
});

