	
	$(document).ready(function(){
		
		//coupon alert
		$("#coupon_in_cart").slideDown("slow");
		
		
		$("#searchtxt").click(function(){
			
			//alert($(this).val());
			
			if ( search_clicked == 0 ) {
			
				search_clicked = 1;
			
				$(this).val('');
			
				$(this).css('color','black');
			
			}
			
		});

		$("#termslink").click(function(){			
			openTerms();
		});

		/// SUBMIT ORDER BUTTON CLICK
		$('#searchform').bind('submit', function() {
			
			if ( $("#searchtxt").val() == 'Enter Search' || $("#searchtxt").val() == '' ) {
				alert('Please Enter Search Terms');
				return false;
			}
			
			return true;
			
		});
		
		$(".product_float_img").click(function() {
			location.href=$(this).attr('url');
		});

		$(".barnavitem").click(function() {
			if ( $(this).attr('url') != undefined ) {
				location.href=$(this).attr('url');
			}
		});
		
		$(".dropdownheader").click(function() {
			location.href=$(this).attr('url');
		});
		
		$(".dropdownheader").hover(
			function() { $(this).removeClass('menuhoveroff');$(this).addClass('menuhoveron'); },
			function() { $(this).removeClass('menuhoveron');$(this).addClass('menuhoveroff'); }
		);
		
	});
	
	function openTerms(pp) {
		var pplink;
		pplink = '';
		if ( pp == 1 ) {
			pplink="#pp";
		}
		window.open(base_url+'tos.php?template=_blank_styled'+pplink,'','scrollbars=yes,toolbar=no,menubar=no');
	}
	
	function privacyPolicy() {
		openTerms(1);
	}
	
	function openpopuptosTrial() {
		openTerms();
	}	
