// IE7 events calendar conflict with moo tools 

function mooTools()
{


}





//---------------------------------- jquery no $ conflict with other JS libraries

var j = jQuery.noConflict();

jQuery(document).ready(function(){

    if (j('body').length) {
    
        j('body').addClass('javascript-enabled').removeClass('javascript-disabled');
        
    }
	
	
	//---------------------------------- AIBC NEWS print functionality ---//
	



	
	if (j('h2.newsletter').length) {
	
		j('#content-main')
			.append('<a id="PrintNewsletter" href="#">Print Newsletter</a>');
	
		j('#PrintNewsletter')
			.click(function(){
			 	window.print();
				return false;
			});
	
	}
	
	//---------------------------------- Add this
	
	/*-- Events --*/
	
	/* cancel this as mootools is conflicting
    if ( j('.regpro_detailsheading').length ) {
	       	   			   
	        j('.regpro_detailsheading')
			    .append(
					    '<ul class="AddThis"><li class="Share">' +
			                '<div class="elemntAddThisToolbox addthis_default_style">' +
			                    //'<a class="addthis_button_facebook"></a>' +
			                    //'<a class="addthis_button_twitter"></a>' +
						        //'<a class="addthis_button_email"></a>' +
                                '<a class="addthis_button_compact">Share</a>' +
					        '</div>' +
					    '</li>' +
			            '<li class="FacebookLike">' + 			            
			                '<div class="elementFacebookLike addthis_default_style">' +
					            '<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>' +
					        '</div>' +
					        '<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>' +
					    '</li></ul>'
					    ); 
					        
					    j.getScript('http://s7.addthis.com/js/250/addthis_widget.js#domready=1'); 
					  
					    
	    }
	    
	    */
	
	/*-- Home page --*/
	
    if ( j('#home').length ) {
	       	       
	        j('.introduction-content')
			    .append(
					    '<ul class="AddThis"><li class="Share">' +
			                '<div class="elemntAddThisToolbox addthis_default_style">' +
			                    //'<a class="addthis_button_facebook"></a>' +
			                    //'<a class="addthis_button_twitter"></a>' +
						        //'<a class="addthis_button_email"></a>' +
                                '<a class="addthis_button_compact">Share</a>' +
					        '</div>' +
					    '</li>' +
			            '<li class="FacebookLike">' + 			            
			                '<div class="elementFacebookLike addthis_default_style">' +
					            '<a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>' +
					        '</div>' +
					        '<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>' +
					    '</li></ul>'
					    ); 
					        
					    j.getScript('http://s7.addthis.com/js/250/addthis_widget.js#domready=1'); 
	    }
	
	
	//---------------------------------- Add headings to CB forms on edit my profile and my membership
	
	j('#cbfr_46')
		.before('<tr><td colspan="2"><h3>Personal/Company Details</h3></td></tr>');
	
	j('#cbfr_72')
		.before('<tr><td colspan="2"><h3>Business Interests</h3></td></tr>');
	
    
	//---------------------------------- Table rows add odd
	
	j('#content-main tr:odd').addClass('odd');
	
	//---------------------------------- Focus for ie7
	
	j('	input[type="text"], input[type="password"], textarea')
		.focus(function(){
			j(this).addClass('focus');			
		})
		.blur(function(){
			j(this).removeClass('focus');			
		});


    //---------------------------------- remove corporate sponsors	and login
    
    if (j('#disable-corporate-sponsors').length) {
    
        j('#national-corporate-sponsors').hide();
        
    }
    
    if (j('table#checkoutbox').length) {
    
        j('#national-corporate-sponsors, #form-login').hide();
        
    }
    
    //---------------------------------- remove the 3rd option of gallery from CB edit my profile
    
    
    if (j('#avatar__choice option[value="gallery"]').length) {
    
        j('#avatar__choice option[value="gallery"]').remove();
        
    }
    
    //---------------------------------- Doing business in indonesia guide
    
    if (j('#doing-business-in-indonesia').length) {
         
        j('input[name="copyMe"]').parent('td').hide();
		
		
    }
    
    if ((j('#doing-business-in-indonesia').length) && (j('strong:contain("Your message has been sent")').length)) {
    
	
        if (!(j('input[name="copyMe"]').length)) {
        
            j('strong:contain("Your message has been sent")')
				.after('<h1><a target="_blank" id="doing-business-download" href="http://aibc.com.au/kiu833n/Doing-Business-In-Indonesia.pdf">Download PDF</a></h1>').hide();

            
        }
 
    }

    
    //---------------------------------- slide show
    
    if (j('#national-corporate-sponsors').length) {
    
        j('.slideshow-1').cycle({
            speed: '3000',
            fx: 'fade'
        });
        
        j('.slideshow-2').cycle({
            speed: '3000',
            fx: 'fade'
        });
        
        j('.slideshow-3').cycle({
            speed: '3000',
            fx: 'fade'
        });
    }
    
    //---------------------------------- Add h1 headings where needed
    
    if (j('#subscription_details').length) {
    
        j('#content-aside .item3').addClass('current');
        
        j('#subscription_details').prepend('<h1>My Membership</h1>');
        
    }
    
    
    if (j('.form-validate').length) {
    
        j('.form-validate').before('<h1>Forgot Your Password?</h1>');
        
    }
    
    if (j('#cbcheckedadminForm').length) {
        // possibly add an if statment for registration - in edit details
        j('#cbcheckedadminForm').before('<h1 id="my-membership">My Membership</h1>');
        
    }
    
    if (j('#cbcheckedadminForm').length & (j('h1').html() == 'Edit My Profile')) {
        // remove when it doubles up
        j('#my-membership').css('display', 'none');
        
    }
    
    
    if (j('strong').text() == 'Your message has been sent' || j('strong').text() == 'Your message was NOT sent. Please see below for the reason.') {
    
        j('strong:first-child').prepend('<h1>Contact Us</h1>');
        
    }
    
});


