$(document).ready(function(){

function getmetaContents(mn){ 
  var m = document.getElementsByTagName('meta'); 
  for(var i in m){ 
   if(m[i].name == mn){ 
     return m[i].content; 
   } 
  } 
}

	$("#ssd").click(function(){
		var keywords = getmetaContents('keywords');
		if(keywords == "homepage"){
			window.open = "http://www.soundstagedirect.com";
			return false;
		}
		$("#search").val(keywords);
		$("#test").submit();
		return false;
	});

	$("#test").submit(function(){
		var keyword = $("#search").val();
		keyword = keyword.replace(/\s/g, "+");
		window.open('http://soundstagedirect.ecomm-search.com/search?menu1=&menu2=&keywords=' + keyword)
		// http://soundstagedirect.ecomm-search.com/search?menu1=&menu2=&keywords=zero+7
		return false;
	});

	/* Default text values for inputs */
	
	// displays hint text on any input element with the 'title' attribute set
	function wireUpDisplayTextboxes() {
	var el = $('input[Title], textarea[Title]');
	
	// show the display text
	el.each(function(i) {
		$(this).attr('value', $(this).attr('title')).addClass('inactive');
	});
	
	// hook up the blur & focus
	el.focus(function() {
		if ($(this).attr('value') == $(this).attr('title'))
			$(this).attr('value', '').removeClass('inactive');
	}).blur(function() {
		if ($(this).attr('value') == '')
			$(this).attr('value', $(this).attr('title')).addClass('inactive').css("backgroundColor","#fff");
	});
	}
	
	
	wireUpDisplayTextboxes();


});