var web_site=null;
$(document).ready(function(){
	$('a[rel="external"],a[rel="external nofollow"]').click(function(){ this.target = "_blank";});
	$('#website').removeAttr('disabled','false');
	$('#btn').click(function(){
		$('#whitebar').html('<img src="/graphics/ajaxchecking.gif" alt="" />');
		$('#whitebar').load('checkit.php?ws='+escape($('#website').attr('value'))+'&id='+Math.random());
	});
	$('#websiteanalyse').submit(function(){
		$('#whitebar').html('<img src="/graphics/ajaxchecking.gif" alt="" />');
		$('#whitebar').load('checkit.php?ws='+escape($('#website').attr('value'))+'&id='+Math.random());
		return false;
	});
	$('#website').keypress(function(){
		if(event.keyCode==13){
			$('#whitebar').html('<img src="/graphics/ajaxchecking.gif" alt="" />');
			$('#whitebar').load('checkit.php?ws='+escape($('#website').attr('value'))+'&id='+Math.random());		
		}
	});
	$('#website').focus(function(){
		if($('#website').attr('value')=='Enter Website Adress'){$('#website').attr('value','');}
	});
	$('#website').blur(function(){
		if($('#website').attr('value')=='')	$('#website').attr('value','Enter Website Adress');
	});
	$('#homepage').click(function(){this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.wsanalyzer.com');});
	$('#favorite').click(function(){
		if (document.all){window.external.AddFavorite("http://www.wsanalyzer.com","wsAnalyzer.com › Website Analyzer, Website value/price calculator");}
		else if (window.sidebar) {window.sidebar.addPanel("wsAnalyzer.com › Website Analyzer, Website value/price calculator","http://www.wsanalyzer.com","");}
		else alert('Please press CTRL+D keys for adding to favorites!\n http://www.wsanalyzer.com');
	});
	$('#updt').click(function(){
		window.location.href='update.php?site=' + web_site;
	});
});
