/********************\
 )		subnav		(
\********************/
function toggleOn(id) {	
	//safe function to show an element with a specified id
	var x=document.getElementById(id + 'DD')
	if(x){
	    if (document.getElementById) { // DOM3 = IE5, NS6
		    x.style.display = 'block';
	    } else {
		    if (document.layers) { // Netscape 4
		    alertID(id);
			    document.id.display = 'block';
		    }
		    else { // IE 4
			    document.all.id.style.display = 'block';
		    }
	    }
	}
	navRO(id + 'Lnk', '#00498B');
	
}
function toggleOff(id) {
	var x=document.getElementById(id + 'DD')
	if(x){
	    //safe function to hide an element with a specified id
	    if (document.getElementById) { // DOM3 = IE5, NS6
		    x.style.display = 'none';
	    }
	    else {
		    if (document.layers) { // Netscape 4
			    document.id.display = 'none';
		    }
		    else { // IE 4
			    document.all.id.style.display = 'none';
		    }
	    }
	}
	navRO(id + 'Lnk', 'transparent');
}

//rollover state of the original button (ex: this is background-color change)
function navRO(id, color) {
    if(document.getElementById(id)){
	    document.getElementById(id).style.borderBottomColor = color;
	}
}


//---------------SITE SEARCH JAVASCRIPT========//

function siteSearch(){
    if(document.getElementById("searchfield")){
    
        var searchterm = document.getElementById("searchfield").value;
        window.location="/search/?search=" + searchterm;
        return false;
        
    
    }else{return false;}
}

///message board search 
function forumSearch(){
    if(document.getElementById("forumsearchfield")){
    
        var searchterm = document.getElementById("forumsearchfield").value;
        window.location="/messageboard/search/default.aspx?keywords=" + searchterm;
        return false;
        
    
    }else{return false;}
}

//submit contact using JQuery
function submitcontact(){
    var name = $("#quickcontactname").val();
    var email = $("#quickcontactemail").val();
    var phone = $("#quickcontactphone").val();
    var comments = $("#quickcontactcomments").val();
     $("#quickcontact").html("<img src='/images/bigrotation2.gif'/>");
    var posturl = '/quickcontact.ashx';
  var postData = { "name" : name, "email" : email , "phone" : phone, "comments" : comments}
  $.ajax({
		type: "GET",
		url: posturl,
		data: postData,
		cache: false,
		success: function(xml) {
		
		 $("#quickcontact").html("<h3>Thanks for <br/>subscribing!</h3>");
		 
		},
		complete: function() {
		
		}
	});
  
}




