function popitnorm(id) {
MyWindow=window.open(id,'MyWindowbio','toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=600,height=400,left=150,top=100');
}

function doloading() {
document.getElementById('loading').style.display = 'block';
}

function deldoc(docid, doctitle){

answer = confirm ("Are you sure you wish to delete '" + doctitle + "'?");

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

function delusr(docid, doctitle){

answer = confirm ("Are you sure you wish to delete '" + doctitle + "'?");

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

var RecaptchaOptions = {
   theme : 'clean'
};

$.fn.rot13 = function() {
        this.each(function() {
         var rnd = Math.floor(Math.random() * 25);
         var rndn = Math.floor(Math.random() * 9);
            $(this).text($(this).text().replace(/[a-z0-9]/ig, function(chr) {
                var cc = chr.charCodeAt(0);
                 
                if (cc >= 65 && cc <= 90) cc = 65 + ((cc - 52) % rnd);
                else if (cc >= 97 && cc <= 122) cc = 97 + ((cc - 84) % rnd);
                else if (cc >= 48 && cc <= 57) cc = 48 + ((cc - 43) % rndn);
                return String.fromCharCode(cc);
            }));
        });
        return this;
    };
    
    
    $(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
            },
            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"  
            }
          }
        });	


    
    		$("#noticesub").click(function(){
			var email = $("#email").val();
		$.ajax({
   type: "POST",
   url: "noticeformprocess.php",
   data: "email=" + email,
   success: function(html){
     $("#regnotice").html(html);
        }
 });	
	return false;		
		});
		
      
       $(".disclaimer").click(function () {
                     
        $(".disc").toggle("fast");
        
        
	return false;
	});
      $("a#cvvhelp").fancybox({
              'frameWidth':  800,
              'frameHeight': 600


   });
   
   $("a#sponsor").fancybox({
		'zoomOpacity' : true,
              'frameWidth':  580,
              'frameHeight': 600,
	      'hideOnContentClick': false,
	      'overlayShow': true,
	      'overlayOpacity': 0.7
   });

      
      
       $("#revenue").change(function () {
         var duesmessage = "";
        var memtype = $("#Membership").val();
        var revtype = $("#revenue").val();
        
        if (revtype == "" || !revtype || revtype == "Choose..."){
         $("#duesresult").slideUp();
        }else{
        switch (memtype){
         
        case "Cleaning and Facility Management Association":
         if (revtype == "Large"){var duesmessage = "<p>Your annual dues for the membership group you belong to are as follows:</p><p>&nbsp;</p><p><strong>Cleaning &amp; Facility Management Association - " + revtype + ":</strong>&nbsp;&nbsp;$2,000.00</p>";}else{
            var duesmessage = "<p>Your annual dues for the membership group you belong to are as follows:</p><p>&nbsp;</p><p><strong>Cleaning &amp; Facility Management Association - " + revtype + ":</strong>&nbsp;&nbsp;$1,000.00</p>";
            
         }
         break;
      
        case "Cleaning Product Manufacturer":
          if (revtype == "Large"){var duesmessage = "<p>Your annual dues for the membership group you belong to are as follows:</p><p>&nbsp;</p><p><strong>Cleaning Product Manufacturer - " + revtype + ":</strong>&nbsp;&nbsp;$3,000.00</p>";}
           if (revtype == "Medium"){var duesmessage = "<p>Your annual dues for the membership group you belong to are as follows:</p><p>&nbsp;</p><p><strong>Cleaning Product Manufacturer - " + revtype + ":</strong>&nbsp;&nbsp;$1,500.00</p>";}
            if (revtype == "Small"){var duesmessage = "<p>Your annual dues for the membership group you belong to are as follows:</p><p>&nbsp;</p><p><strong>Cleaning Product Manufacturer - " + revtype + ":</strong>&nbsp;&nbsp;$500.00</p>";}
         break;
      
        case "Cleaning Product Distributor":
         if (revtype == "Large"){var duesmessage = "<p>Your annual dues for the membership group you belong to are as follows:</p><p>&nbsp;</p><p><strong>Cleaning Product Distributor - " + revtype + ":</strong>&nbsp;&nbsp;$500.00</p>";}
           if (revtype == "Medium"){var duesmessage = "<p>Your annual dues for the membership group you belong to are as follows:</p><p>&nbsp;</p><p><strong>Cleaning Product Distributor - " + revtype + ":</strong>&nbsp;&nbsp;$250.00</p>";}
            if (revtype == "Small"){var duesmessage = "<p>Your annual dues for the membership group you belong to are as follows:</p><p>&nbsp;</p><p><strong>Cleaning Product Distributor - " + revtype + ":</strong>&nbsp;&nbsp;$100.00</p>";}
         break;
        
      
        case "BSC-Building Owners and Manager":
                  if (revtype == "Large"){var duesmessage = "<p>Your annual dues for the membership group you belong to are as follows:</p><p>&nbsp;</p><p><strong>Building Service Contractor/Building Owner or Manager - " + revtype + ":</strong>&nbsp;&nbsp;$500.00</p>";}
           if (revtype == "Medium"){var duesmessage = "<p>Your annual dues for the membership group you belong to are as follows:</p><p>&nbsp;</p><p><strong>Building Service Contractor/Building Owner or Manager - " + revtype + ":</strong>&nbsp;&nbsp;$250.00</p>";}
            if (revtype == "Small"){var duesmessage = "<p>Your annual dues for the membership group you belong to are as follows:</p><p>&nbsp;</p><p><strong>Building Service Contractor/Building Owner or Manager - " + revtype + ":</strong>&nbsp;&nbsp;$100.00</p>";}
         break;

        }
        duesmessage = duesmessage + "<p style=\"font-size: 10px;\"><em>Any discounts, if applicable, will be calculated on the next step.</em></p>";
       
        $("#duesresult").slideUp(function (){$("#duesresult").html(duesmessage);});
          
          $("#duesresult").slideDown();
        }
        
        
	
	});
      
       
      
    });
    
    
    
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.shipname.value != "" && document.checkout.shipaddress.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.");

}
}

//<![CDATA[
/* Replacement calls. Please see documentation for more information. */

if(typeof sIFR == "function"){

// This is the preferred "named argument" syntax
sIFR.replaceElement(named({sSelector:"#ads h3", sFlashSrc:"bauhausheavybold.swf", sColor:"#292A2A", sLinkColor:"#1F4C79", sBgColor:"#E3E3E3", sWmode:"transparent"}));
sIFR.replaceElement(named({sSelector:"#navlist h3", sFlashSrc:"bauhausheavybold.swf", sColor:"#292A2A", sLinkColor:"#1F4C79", sBgColor:"#E3E3E3", sWmode:"transparent"}));
sIFR.replaceElement(named({sSelector:"#dyk h3", sFlashSrc:"bauhausheavybold.swf", sColor:"#ffffff", sLinkColor:"#1F4C79", sBgColor:"#E3E3E3", sWmode:"transparent"}));	

};

//]]>
