function loadScripts(){
	createNewWindowLinks();
	browserFixes();
	defaultText();
}

function includeAnalytics(){
	if (theHost.indexOf(liveDomain) > -1){
		$("head").append('<script type="text/javascript" src="/_scripts/analytics.php"></script>');
	}
}

function createNewWindowLinks(){
	$(".newwindow").attr("target","_blank");
}

function browserFixes(){
	if (ie6){
		$('input[type=text],input[type=password],input[type=radio],input[type=checkbox],input[type=button],input[type=submit]'). 
        each(function() { $(this).addClass('ie6_' + this.type); });
	}
}

function validateEmailAddress(str)
{
	apos = str.indexOf("@");
	dotpos = str.lastIndexOf(".");
	if (apos < 1 || dotpos - apos < 2){
		return false;
	}
	else{
		return true;
	}
}

function defaultText(){

	$(document).ready(function()
	{
	    $(".defaultText").focus(function(srcc)
	    {
	        if ($(this).val() == $(this)[0].title)
	        {
	            $(this).removeClass("defaultTextActive");
	            $(this).val("");
	        }
	    });
	    
	    $(".defaultText").blur(function()
	    {
	        if ($(this).val() == "")
	        {
	            $(this).addClass("defaultTextActive");
	            $(this).val($(this)[0].title);
	        }
	    });
	    
	    $(".defaultText").blur();  
		
		$("form").submit(function() {
			$(".defaultText").each(function() {
				if($(this).val() == this.title) {
					$(this).val("");
				}
			});
		});  
	});

}

function centreIt(theElement){
	$(window).resize(function(){
		if ($(window).width() < $(theElement).outerWidth())
			theLeft = 0;
		else
			theLeft = ($(window).width() - $(theElement).outerWidth())/2;
		if ($(window).height() < $(theElement).outerHeight())
			theTop = 0;
		else
			theTop = ($(window).height() - $(theElement).outerHeight())/2;
		$(theElement).css({
			position:'absolute',
			left: theLeft,
			top: theTop
		});
	});
	$(window).resize();
}

function goToByScroll(id1){
	$('html,body').animate({scrollTop: $("#"+id1).offset().top},'slow');
}
