	
	/* 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 = 'http://www.jamestudor.co.uk/_include/shop/purchase_logic.php?op=np';
		//location.href = 'http://www.jamestudor.co.uk/shop/customer.php';
		location.href = '/shop/delivery.php';
	}

	function newsletter_signup() {
		if (ea_syntax(document.newsletter_signup.usrfrm_newsletter.value) == false) {
			alert('The email address you entered seems to be invalid.  Please check it and try again.');
			document.newsletter_signup.usrfrm_newsletter.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;}
	}
	

