if (typeof (RVNG) == "undefined") {
    RVNG = {
    	init:function(){
    		jQuery('a').hover(function(){
    			window.status = '';
    		});
    	
			var default_values = {};
			jQuery('input:text').each(function(i) {
				var index = jQuery(this).attr('name');
				var value = jQuery(this).val();
				default_values[index] = value;
			});
			jQuery('input:text').focus(function() {
				if(jQuery(this).val() === default_values[jQuery(this).attr('name')]) {
				  jQuery(this).val('');
				};
			});
			jQuery('input:text').blur(function() {
				if(jQuery(this).val() < 1) {
				  jQuery(this).val(default_values[jQuery(this).attr('name')]);

				};
			});
			$("#email").keyup(function(){
				var email = $("#email").val();		
				if(email != 0){
					if(RVNG.isValidEmailAddress(email)){
						$("#email").css({"background-color": "#EFF"});
					} else {
						$("#email").css({"background-color": "#FEF"});
					}
				} else {
					RVNG.isEmail = false;
					$("#email").css({"background-color":"#FFF"});			
				}		
			});

/*
			$('a#email_signup_submit').click(function(){
				var email = $("#email").val();		
				if(email != 0){
					if(RVNG.isValidEmailAddress(email)){
						$('#emailconfirm').attr('value', email);
					//	console.log($('#emailconfirm').attr('value'));
						$('#subscribeform').submit();
					} else {
						alert ('Please enter a vaild email address');
					}
				} else {
					alert('Please enter a vaild email address');
				}
			});
			
*/
			$('#email_signup_toggle').click(function(){
				$('#signup_form').slideToggle();
				return false;
			});

			$('#discography-right ol li').click(function(){
				$('img#detail').attr('src', 'http://igetrvng.com/uploads/'+$(this).attr('id'));
			});

			$('#shop-right ol li').click(function(){
				$('img#detail').attr('src', 'http://igetrvng.com/uploads/'+$(this).attr('id'));
			});
			$('ul.buystuff li').click(function(){
				var type =$(this).attr('id');
				//console.log(type);
				$('#buy_item_'+type).submit();
			});	
			
		},
    	
    	isValidEmailAddress:function (emailAddress) {
			var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
			return pattern.test(emailAddress);
		}
   };
};


function right(e) {
if (navigator.appName == 'Netscape' && 
(e.which == 3 || e.which == 2))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 2 || event.button == 3)) {
//alert("Sorry, you do not have permission to right click.");
return false;
}
return true;
}

document.onmousedown=right;
document.onmouseup=right;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=right;
window.onmouseup=right;
