function formwindow(page)
{
MyWindow=window.open(page,'MyWindowETF','toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=600,height=500,left=250,top=2');
}

function dupaddress(){
var addcheck=document.checkout.billsame.checked;
if (addcheck){
document.checkout.billname.value = document.checkout.shipname.value;
document.checkout.billaddress.value = document.checkout.shipaddress.value;
document.checkout.billaddress2.value = document.checkout.shipaddress2.value;
document.checkout.billcity.value = document.checkout.shipcity.value;
document.checkout.billstate.value = document.checkout.shipstate.value;
document.checkout.billzip.value = document.checkout.shipzip.value;
document.checkout.billcountry.value = document.checkout.shipcountry.value;
}else{
document.checkout.billname.value = '';
document.checkout.billaddress.value = '';
document.checkout.billaddress2.value = '';
document.checkout.billcity.value = '';
document.checkout.billstate.value = '';
document.checkout.billzip.value = '';
document.checkout.billcountry.value = '';
}
}

function checkform() {
if (document.checkout.email.value != "" && document.checkout.billname.value != "" && document.checkout.billaddress.value != "" && document.checkout.phone.value != ""){allgood = 1;}else{allgood = 0;}

						if (allgood == 1){
document.checkout.submit();
}else{
alert ("Email Address, Name, Address, Phone, and Payment Information are required.  Please make sure all the requested information is provided, then try again.");

}
}

function checkeform() {
if (document.echeckout.email.value != "" && document.echeckout.billname.value != "" && document.echeckout.billaddress.value != "" && document.echeckout.phone.value != ""){allgood = 1;}else{allgood = 0;}

						if (allgood == 1){
document.echeckout.submit();
}else{
alert ("Email Address, Name, Address, Phone, and Payment Information are required.  Please make sure all the requested information is provided, then try again.");

}
}



$(document).ready(function(){

$("#regapp").validate({
	rules: { 
            First_Name: {
            required:true
            },
            Last_Name: {
            required:true
            },
            Email: { 
                required: true, 
                email: true  
            },  
            Company: {
            required:true
            },
            Job_Title: {
            required:true
            },
            Phone: {
            required:true
            }
         }, 
        	messages: { 
                   Email: { 
                required: "Please enter a valid email address", 
                minlength: "Please enter a valid email address"  
            }
          }
        });	
       



$("#thetotal").ready(function(){
if ($("#thetotal").html() == "$0.00"){
$("#billing").hide();
}else{
$("#billing").show();
}
});

$("#regapp input").click(function(){
if ($("input").parent().sum() == "0"){
$("#billing").hide();
}else{
$("#billing").show();
}
});


$(".milink").click(function(){

$(this).parent("p").parent("td").parent("tr").next(".proddesc").slideToggle();

return false;
});

$(".dmilink").click(function(){

$(".dproddesc").slideToggle();

return false;
});
 /*
$(function () {
    var tabContainers = $('#tabcontent div');

    $('div#tabs a').click(function () {
        tabContainers.hide().filter(this.hash).show();

        $('div#tabs li').removeClass('selected');
        $(this).parent().addClass('selected');

        return false;
    }).filter('.selected a').click();
    
    

});
*/
});



function memformsubmit() {
    document.memapp.submit();
}

function nonmemformsubmit() {
    document.nonmemform.submit();
}


$("#tag").ready(function(){
var orgSearchDesc = $("#tag").val();
	$("#tag").focus(function(){
            $("#tag").val("");
        });
        $("#tag").blur(function(){
            var currentSearchValue = $("#tag").val();
            if (currentSearchValue == ""){
            $("#tag").val(orgSearchDesc);
            }
        });


});

$("#fpassword").ready(function(){
$("#fpassword").blur(function(){
if (($("#fpassword").val() != $("#fpasswordc").val()) && $("#fpasswordc").val() != ""){
    $(".passwarn").html("New password has been typed in two different ways, please try again.");
    $(".passwarn").show();
    var formerrors = true;
}else{
     $(".passwarn").html("");
     var formerrors = false;
}
 });

$("#fpasswordc").blur(function(){
if ($("#fpassword").val() != $("#fpasswordc").val()){
    $(".passwarn").html("New password has been typed in two different ways, please try again.");
    $(".passwarn").show();
    var formerrors = true;
}else{
     $(".passwarn").html("");
     var formerrors = false;
}
 });
});

$("form").submit(function() {
    if (formerrors == false){
	return true;
    }
	$("#formwarn").html("Please correct the errors above to save your info.");
	$("#formwarn").show();
	return false;
	

});
$("#showscore").ready(function() {

$("#showscore").click(function(){
     $("#scorecont").slideToggle("fast");
return false;
});
});

function delpost(docid){

answer = confirm ("Are you sure you wish to delete this post? The post and all comments/replies will be permanently removed.");

if (answer==true){
window.location.href="delpost.php?&id=" + docid;
}else{
alert ("Post Deletion Canceled...");
}
}

function delcomment(docid){

answer = confirm ("Are you sure you wish to delete this comment?");

if (answer==true){
window.location.href="delcomment.php?&id=" + docid;
}else{
alert ("Comment Deletion Canceled...");
}
}

$("#mailsharewhat").ready(function(){

$("#mailsharewhat").click(function(){
     $("#ESinfo").slideToggle("fast");
     return false;
   });
});
var totalsofar = 0.00;
