window.addEvent('domready',function(){
	SqueezeBox.initialize({});
	SqueezeBox.assign($$('a.SqueezeBox'), {
		parse: 'rel'
	});
	
	//add open in new window function to anchors of class "open-new-win"
	$$('a.open-new-win').addEvents({
		'click':function(){
			window.open(this.href);
			return false;
		},
		'keypress':function(){
			window.open(this.href);
			return false;
		}
	});
	
});



function ClearInput(target, defaultval){
	if(target.value == defaultval){
		target.value = "";
	}
	if(target.nodeName.test('textarea','i')){
		if(target.innerHTML == defaultval){
			target.innerHTML = '';
		}
	}
	
}

function ReplaceInputPrompt(target,defaultval){
	if(target.value == ""){
		target.value = defaultval;
	}
	if(target.nodeName.test('textarea','i')){
		if(target.innerHTML == ""){
			target.innerHTML = defaultval;
		}
	}
}

Element.implement(
{
    removeStyle: function(ele)
    {
        regex  = new RegExp('[~;\\s]' + ele + '.*?[;~]', "i"); 
        style = this.get('style')+';';
        this.set('style', style.replace(regex, ''));
    }

}); 



if(Browser.Engine.trident && Browser.Engine.version < 5){
	window.addEvent('domready',function(){
		if($('perma-links')){
			$$('#perma-links li').each(function(el){
				el.addEvents({
					'mouseenter':function(){
						el.addClass('sfhover');
					},
					'mouseleave':function(){
						el.removeClass('sfhover');
					}				
				});
			});
		}				
		$$('.typographic img')[0] ? Browser.fixPNG($$('.typographic img')[0]) : 0;				
		Browser.fixPNG($('logo'));				
	});
}