// TICT Custom Script
// (c) 20011 Tiger Media http://www.tigermedia.com.au
// All Rights Reserved.

// Image Slideshow Industry

    function slideSwitchIndustry() {
	    var jQueryactive = jQuery('#ss-industry IMG.active');

	    if ( jQueryactive.length == 0 ) jQueryactive = jQuery('#ss-industry IMG:last');

	    // use this to pull the images in the order they appear in the markup
	    var jQuerynext =  jQueryactive.next().length ? jQueryactive.next()
	        : jQuery('#ss-industry IMG:first');
	    // uncomment the 3 lines below to pull the images in random order
		var jQuerysibs  = jQueryactive.siblings();
	    var rndNum = Math.floor(Math.random() * jQuerysibs.length );
	    var jQuerynext  = jQuery( jQuerysibs[ rndNum ] );

	    jQueryactive.addClass('last-active');

	    jQuerynext.css({opacity: 0.0})
	        .addClass('active')
	        .animate({opacity: 1.0}, 1000, function() {
	            jQueryactive.removeClass('active last-active');
	        });
	}
	
$(document).ready(function() {
	jQuery(function() {
	    setInterval( "slideSwitchIndustry()", 5000 );
	});
});

// Image Slideshow Tourism

    function slideSwitchTourism() {
	    var jQueryactivetour = jQuery('#ss-tourism IMG.active');

	    if ( jQueryactivetour.length == 0 ) jQueryactivetour = jQuery('#ss-tourism IMG:last');

	    // use this to pull the images in the order they appear in the markup
	    var jQuerynexttour =  jQueryactivetour.next().length ? jQueryactivetour.next()
	        : jQuery('#ss-tourism IMG:first');
	    // uncomment the 3 lines below to pull the images in random order
		var jQuerysibstour  = jQueryactivetour.siblings();
	    var rndNumtour = Math.floor(Math.random() * jQuerysibstour.length );
	    var jQuerynexttour  = jQuery( jQuerysibstour[ rndNumtour ] );

	    jQueryactivetour.addClass('last-active');

	    jQuerynexttour.css({opacity: 0.0})
	        .addClass('active')
	        .animate({opacity: 1.0}, 1000, function() {
	            jQueryactivetour.removeClass('active last-active');
	        });
	}
	
$(document).ready(function() {
	jQuery(function() {
	    setInterval( "slideSwitchTourism()", 5000 );
	});
});


// Input Box Placeholders

j$ = jQuery.noConflict();

j$(document).ready(function($){
     $("#CAT_Search").focus(function(){
          if (this.value == this.defaultValue)
          {
               this.value = "";
          }
     }).blur(function(){
          if ( ! this.value.length) 
          {
               this.value = this.defaultValue;
          }
     });
     $("#Name").focus(function(){
          if (this.value == this.defaultValue)
          {
               this.value = "";
          }
     }).blur(function(){
          if ( ! this.value.length) 
          {
               this.value = this.defaultValue;
          }
     });
     $("#Email").focus(function(){
          if (this.value == this.defaultValue)
          {
               this.value = "";
          }
     }).blur(function(){
          if ( ! this.value.length) 
          {
               this.value = this.defaultValue;
          }
     });
	$(".conform").focus(function(){
          if (this.value == this.defaultValue)
          {
               this.value = "";
          }
     }).blur(function(){
          if ( ! this.value.length) 
          {
               this.value = this.defaultValue;
          }
     });

});

// Badges Hide Show 

function atapbadge() {
    var check_atap = jQuery(".list-badges-atap");

        check_atap.each(function (index, value) {
                if (jQuery(this).html() == "1") {
                        jQuery(this).css("display","inline-block");
                }
        });
}
jQuery(document).ready(function () {
        atapbadge();
});


function itotbadge() {
    var check_itot = jQuery(".list-badges-itot");

        check_itot.each(function (index, value) {
                if (jQuery(this).html() == "1") {
                        jQuery(this).css("display","inline-block");
                }
        });
}
jQuery(document).ready(function () {
        itotbadge();
});


function awardsbadge() {
    var check_awards = jQuery(".list-badges-awards");

        check_awards.each(function (index, value) {
                if (jQuery(this).html() == "1") {
                        jQuery(this).css("display","inline-block");
                }
        });
}
jQuery(document).ready(function () {
        awardsbadge();
});


function qatabadge() {
    var check_qata = jQuery(".list-badges-qata");

        check_qata.each(function (index, value) {
                if (jQuery(this).html() == "1") {
                        jQuery(this).css("display","inline-block");
                }
        });
}
jQuery(document).ready(function () {
        qatabadge();
});


function pchoicebadge() {
    var check_pc = jQuery(".list-badges-pchoice");

        check_pc.each(function (index, value) {
                if (jQuery(this).html() == "1") {
                        jQuery(this).css("display","inline-block");
                }
        });
}
jQuery(document).ready(function () {
        pchoicebadge();
});

function ecobadge() {
    var check_eco = jQuery(".list-badges-pchoice");

        check_eco.each(function (index, value) {
                if (jQuery(this).html() == "1") {
                        jQuery(this).css("display","inline-block");
                }
        });
}
jQuery(document).ready(function () {
        ecobadge();
});



// WSS Escape

//var siteUrl = 'http://tict.tigermedia.com.au';
//var links = document.getElementsByTagName('A');

//for (i = 0; i < links.length; i++)
//{
//	if (links[i].getAttribute('href'))
//	{
//		var href = links[i].getAttribute('href');
//		if (href.substring(0,4) != 'http' && href.substring(0,1) == '/')
//		{
//			//this example requires your links to have absolute paths.
//			//document-relative paths and absolute URLs are not supported.
//			links[i].setAttribute('href', siteUrl + href);
//		} 
//	}
//}
