// JavaScript Document


<!-- function for OnClick overlays -->
$(function() { 
	
         
    // positions for each overlay 
  

    // if function argument is given to overlay it is assumed onBeforeLoad event listener 
    $("a[rel]").overlay(function() { 
        // grab wrapper element inside content 
        var wrap = this.getContent().find("div.wrap"); 
        // load only for the first time it is opened 
       {             
            wrap.load(this.getTrigger().attr("href")); 
        }
    });    
});   
<!-- end OnClick function -->     




<!-- function for onLoad overlays -->
<!-- First one is for register thank you -->

// install overlay with default settings 
$(function() { 
    $("#thankyou").overlay();      
}); 
 
 
// define function that opens the overlay 
function openThankOverlay() { 
     
    // get access to the overlay API 
    var api = $("#thankyou").overlay(); 
 
    // call it's open() method         
    api.load();             
}





<!-- Second one is for book a visit thank you -->

// install overlay with default settings 
$(function() { 
    $("#thankyouvisit").overlay();      
}); 
 
 
// define function that opens the overlay 
function openThankVisitOverlay() { 
     
    // get access to the overlay API 
    var api = $("#thankyouvisit").overlay(); 
 
    // call it's open() method         
    api.load();             
}


<!-- Second one is for book a visit thank you -->

// install overlay with default settings 
$(function() { 
    $("#thankyouvisit").overlay();      
}); 
 
 
// define function that opens the overlay 
function openThankVisitOverlay() { 
     
    // get access to the overlay API 
    var api = $("#thankyouvisit").overlay(); 
 
    // call it's open() method         
    api.load();             
}

<!-- end onLoad function -->
 
 
$(function() { 
    $("#join").overlay();      
}); 
 
   
function openSignUp(refering) { 

    // get access to the overlay API 
    var api = $("#join").overlay(); 
	
	 var wrap = api.getContent().find("div.wrap"); 
	 if (wrap.is(":empty")) { 
            wrap.load(refering); 
        } 
 
    // call it's open() method         
    api.load();             
}

 
 
$(function() { 
    $("#topics").overlay();      
}); 
 
   
function openKeyProduct(refering) { 

    // get access to the overlay API 
    var api = $("#topics").overlay(); 
	
	 var wrap = api.getContent().find("div.wrap"); 
	 if (wrap.is(":empty")) { 
            wrap.load(refering); 
        } 
 
    // call it's open() method         
    api.load();             
}


