	
	/* Modified to support Opera */
	function bookmark(url, title){
	
		var agt = navigator.userAgent.toLowerCase(); 
		var app = navigator.appName.toLowerCase(); 
		var ieAgent = agt.indexOf('msie'); 
		var nsAgent = app.indexOf('netscape'); 
		var opAgent = app.indexOf('opera'); 
		
		if ( navigator.userAgent.indexOf("Safari") != -1 ) {
			alert ('Select Add Bookmarks from the Bookmarks menu, to store this link.');
		} else {
			if (window.sidebar) {// firefox
				window.sidebar.addPanel(title, url, "");
			} else if(window.opera && window.print) { // opera
				var elem = document.createElement('a');
				elem.setAttribute('href',url);
				elem.setAttribute('title',title);
				elem.setAttribute('rel','sidebar');
				elem.click();
			} else if(document.all) {// ie
				window.external.AddFavorite(url, title);
			}
		}
	}

	function purchase() {
		location.href = '/_include/purchase_logic.php';
	}

	function newsletter_signup() {
		if (ea_syntax(document.newsletter_signup.usrfrm_email.value) == false) {
			alert('The email address you entered seems to be invalid.  Please check it and try again.');
			document.newsletter_signup.usrfrm_email.select();}
		else {
			document.newsletter_signup.submit();
		} // end if
	}

	function ea_syntax(ea) {
		var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
		if (filter.test(ea)) {return true;} else {return false;}
	}
	
	
	function do_search(source) {
		if (source == 'nav_bar') { document.search_products.submit(); } else { document.search_products_main.submit();}
	}
	
	
	function change_filter(brand_name, style_name, price_range) {
		
		if (brand_name == 0) brand_name = 'all-brands';
		if (style_name == 0) style_name = 'all-styles';
		if (price_range == 0) price_range = 'any-price';
		
		document.filter.action = "/brands/"+brand_name+"/"+style_name+"/"+price_range;
		
		document.filter.submit();
	}