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(){

$("#searchjump").click(function(){

$('#search').animate({ backgroundColor: "#FCFCD8" },1).delay(1000).animate({ backgroundColor: "#ffffff" }, 1500);

})


$(".regpay").click(function(){
if ($("#online").attr('checked')){
$("#cardbill").show();
}else{
$("#cardbill").hide();
}

if ($("#porder").attr('checked')){
$("#pbill").show();
}else{
$("#pbill").hide();
}

});

$(".bulklink a").bigTarget();
$(".linklist a").bigTarget();
$(".renewlink a").bigTarget({
    
    clickZone : 'div:eq(0)' // jQuery parent selector
  });

$(".usmmenu a").bigTarget({
    
    clickZone : 'div:eq(0)' // jQuery parent selector
  });
$(".news a").bigTarget({
    
    clickZone : 'div:eq(0)' // jQuery parent selector
  });
  
     $(".hover-starp").rating({
	  required: true,
callback: function(value, link){
if (value != ""){
var pid = $(this).attr("name").replace("post","");
}else{
var pid = $(this).attr("title");
var value = 0;
}
var debugvalue = pid + ", " + value;

$.ajax({
   type: "POST",
   url: "postrate.php",
   data: "id=" + pid +"&rate=" + value

 });
}
});


     $(".hover-star").rating({
	  required: true,
callback: function(value, link){
if (value != ""){
var cid = $(this).attr("name").replace("comment","");
}else{
var cid = $(this).attr("title");
var value = 0;
}
var debugvalue = cid + ", " + value;

$.ajax({
   type: "POST",
   url: "commentrate.php",
   data: "id=" + cid +"&rate=" + value

 });
}
});

	$(".medialink a").fancybox({
              'frameWidth':  900,
              'frameHeight': 700
   });
   
   

	$(".medialink640 a").fancybox({
              'frameWidth':  640,
              'frameHeight': 460
   });


	$(".medialinkf a").fancybox({
              'frameWidth':  900,
              'frameHeight': 700
   });

$("a#cvvhelp").fancybox({
              'frameWidth':  800,
              'frameHeight': 600


   });

$("a.memsurvlink").fancybox({
              'frameWidth':  700,
              'frameHeight': 500


   });
	$('#newmems').cycle({
    fx:    'fade',
    pause:  1,
    delay:  1000
});



$("#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
            },
            reg55: {
            required:true
            },
             address: {
             required: true
             },
             City: {
             required: true
             },
             State: {
             required: true
             },
             zip: {
             required: true
             }            
         }, 
        	messages: { 
                   Email: { 
                required: "Please enter a valid email address", 
                minlength: "Please enter a valid email address"  
            }
          }
        });	
       
$(".mcplink").fancybox({
              'frameWidth':  850,
              'frameHeight': 550
   });


$("#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;

