//SET YOUR DEFAULT PAGE BELOW.

var globalNav = "<div id='topNavWrap'>"+
                        "<ul>"+
                            "<li><a href='/about-us/default.html'>about us</a></li>"+
							"<li><a href='/coupons/'>coupons</a></li>"+							
                            "<li><a href='/downloads.html'>downloads</a></li>"+
							"<li><a href='http://swingpure.com', target='_blank'>school of golf</a></li>"+
                        "</ul>"+
                        "<div id='search'>"+
                            "<form action='/search.aspx' method='get' name='searchForm' id='searchForm' >"+
                                "<fieldset>"+
                               "<input type='text' id='q' name='q' onfocus=\"inputFocus(this);\" onblur=\"inputBlur(this);\" value=\"search wildcat\" />"+
                                "<a href='javascript:submitForm();' id='srchBtn'><img src='/images/layout/searchBtn.png' name='srchBtn' width='32' height='21' border='0'/></a>"+
                                "</fieldset>"+
                            "</form>"+
                        "</div>"+
                    "</div>";
//write the navigation
document.write(globalNav);

//form handling
var oldColor;
var errorColor = "#b10a0a";
var errorText = "enter search terms";

function inputFocus(obj){
	if(obj.value=='search wildcat')obj.value='';
	if(obj.value == errorText){
		obj.style.color = oldColor;
		obj.value = '';
	}
};

function inputBlur(obj){
	if(obj.value=='')obj.value='search wildcat';
};

function submitForm(){
	var q = document.getElementById("q");
	if(q.value != '' && q.value != 'search wildcat'){
		document.searchForm.submit();
	}else{
		q.value = errorText;
		oldColor = q.style.color;
		q.style.color=errorColor;
		this.setTimeout('removeError()',3000);
	}
};

function removeError(){
	var q = document.getElementById("q");
	q.style.color = oldColor;
	if(q.value == errorText){
	   q.value = "search wildcat";
	}
};

