$(function() {
    $("ul.menu li").hover(function() {
        $("ul:first",this).css("visibility", "visible");
    }, function() {
        $("ul:first",this).css("visibility", "hidden");
    });
    $('div.c-showhide').hide();
    $('a.c-toggle').click(function() {
        $('div.c-showhide').slideToggle(400);
        $(this).text($(this).text() == 'Open' ? 'Close' : 'Open');
        return false;
    });
    $('div.r-showhide').hide();
    $('a.r-toggle').click(function() {
        $('div.r-showhide').slideToggle(400);
        $(this).text($(this).text() == 'Open' ? 'Close' : 'Open');
        return false;
    });
});

function tellafriend() {
    var myURL = "http://hmatters.com/pacifictheatre/sendmail/?urltosend="+window.location.href;
    var myName = "popup";
    var myWidth = 800;
    var myHeight = 600;
	var myLeft = screen.width/2-(myWidth/2);
	var myTop = screen.height/2-(myHeight/2);
	window.open(myURL, myName, "width="+myWidth+",height="+myHeight+",left="+myLeft+",top="+myTop+",scrollbars=yes,resizable=yes");
}

function checkcomment(form) {
	var formAuthor = form.author.value;
	var formEmail = form.email.value;
	var formComment = form.comment.value;
	if(formAuthor == "") {
		alert("Please Enter Your Name");
		form.author.focus();
		return false;
	} else if((formEmail.length<6) || (formEmail.indexOf(",")>=0) || (formEmail.indexOf(";")>=0) || (formEmail.indexOf(":")>=0) || (formEmail.indexOf("/")>=0) || (formEmail.indexOf(" ")>=0) || (formEmail.indexOf("@")<=0) || (formEmail.indexOf("@") != formEmail.lastIndexOf("@")) || (formEmail.lastIndexOf(".")<formEmail.indexOf("@")) || ((formEmail.lastIndexOf(".")+3)>formEmail.length)) {
		alert("Please Enter A Valid Email Address");
		form.email.focus();
		return false;
	} else if(formComment == "") {
		alert("Please Enter A Comment");
		form.comment.focus();
		return false;
	} else {
		form.submit();
		return true;
	}
}

function passwordsubmit(form) {
    form.submit();
    return true;
}
