/*=================================================

    Global.js
    Promo-News Global Javascript Functions

=================================================*/

/* Tool Tips
-------------------------------------------------*/
    
   /* $(document).ready(
        function()
        {
            $("div.colourBlock").ToolTipDemo("#FFF", "#444");
        }
        
    );*/
    
/* Animate Advanced Search
-------------------------------------------------*/

    $(document).ready(function(){
     
        $("fieldset#advancedSearch").hide();
     
        $("a#refineSearch").click(function(event){
       
        $("fieldset#advancedSearch").animate({
            
            height: 'toggle', opacity: 'toggle'
        
        }, "slow");
    
       return false;
     
        });
   
    });
    
/* Animate Signup Form
-------------------------------------------------*/

    $(document).ready(function(){
    
        $("div#frmSupplier").hide();
     
        $("input#supplier").focus(function(event){
        
        $("div#frmDistributor").hide();
       
        $("div#frmSupplier").animate({
            
            height: 'toggle', opacity: 'toggle'
        
        }, "slow");
    
       return false;
     
        });
   
    });
    
    $(document).ready(function(){
    
        $("div#frmDistributor").hide();
     
        $("input#distributor").focus(function(event){
        
        $("div#frmSupplier").hide();
       
        $("div#frmDistributor").animate({
            
            height: 'toggle', opacity: 'toggle'
        
        }, "slow");
    
       return false;
     
        });
   
    });
    
    
	function maintain_calender_position() {
		var divh = document.getElementById('getQuote').offsetHeight;
		
		var divh_y = 700 + divh;
		
		Calendar.setup({
							inputField     :    "followup_date",     // id of the input field
							ifFormat       :    "%Y-%m-%d",      // format of the input field
							button         :    "startbtn1",  // trigger for the calendar (button ID)
							align          :    "BR",           // alignment (defaults to "Bl")
							position       :    [510,divh_y],
							singleClick    :    true
							});
	}
	
/* Animate Get a Quote & Request Sample Forms
-------------------------------------------------*/

    $(document).ready(function(){
     
        $("div#getQuote").hide();
     
        $("a#getQuoteLink").click(function(event){
		
		$("div#getQuote").animate({
            
            height: 'toggle', opacity: 'toggle'
        
        }, "slow", '', function() {
    	var divh = document.getElementById('getQuote').offsetHeight;
		
		var divh_logo = document.getElementById('logo_promotivation').offsetHeight;
		
		var divh_y = 630 + divh + divh_logo;
		
		Calendar.setup({
							inputField     :    "followup_date",     // id of the input field
							ifFormat       :    "%Y-%m-%d",      // format of the input field
							button         :    "startbtn1",  // trigger for the calendar (button ID)
							align          :    "BR",           // alignment (defaults to "Bl")
							position       :    [510,divh_y],
							singleClick    :    true
							});
  });
    
		/*setTimeout("maintain_calender_position()",2000);*/
		
       return false;
     
        });
   
    });
    
    $(document).ready(function(){
     
        $("div#getSample").hide();
     
        $("a#getSampleLink").click(function(event){
       
        $("div#getSample").animate({
            
            height: 'toggle', opacity: 'toggle'
        
        }, "slow");
    
       return false;
     
        });
   
    });
	
	$(document).ready(function(){
     
        $("div#getTrade").hide();
     
        $("a#getTradeLink").click(function(event){
       
        $("div#getTrade").animate({
            
            height: 'toggle', opacity: 'toggle'
        
        }, "slow");
    
       return false;
     
        });
   
    });
	
	$(document).ready(function(){
     
        $("div#getsearchcat").hide();
     
        $("a#getsearchcatLink").click(function(event){
       
        $("div#getsearchcat").animate({
            
            height: 'toggle', opacity: 'toggle'
        
        }, "slow");
    
       return false;
     
        });
   
    });
    
    $(document).ready(function(){
     
        $("fieldset#sendEmail").hide();
     
        $("a#sendEmailLink").click(function(event){
       
        $("fieldset#sendEmail").animate({
            
            height: 'toggle', opacity: 'toggle'
        
        }, "slow");
    
       return false;
     
        });
   
    });
    
    