var $j = jQuery.noConflict();
function openPopUp(id) {
	win = window.open("/?page_id="+id,"Vinila Von Bismark", 'titlebar=0,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,top=0,left=0,width=300,height=250');
	win.focus();
}

function roll(img_name, img_src)
   {
   document[img_name].src = img_src;
   }

function showComments() {
	$j('#commentFormPlacer').toggle('slow');
}

jQuery(document).ready(function () {
  $j('#commentFormPlacer').hide();

    $("#subscriptionForm").validate();

});



function subscribe() {
	$j.ajax({
     	type: "GET",
		dataType: "html",
        url: "/newsletter.php",
        data: "email="+$j('#inNewsletter').val(),
		error: function(msg,a,b,c,d) {
			alert("error:"+msg);
			alert(a + "\n" + b + "\n" + c + "\n" + d + "\n")
		},
        success: function(msg){
			alert(msg);
        	//$j('#newsletterForm').html(msg);
        }
    });	
}



function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
