//common.js

// CODA BUBBLE
	$(document).ready(function() {
		$(function(){
		   opts = {
			  distances : [15,15,15],
			  leftShifts : [-90,-92,-91],
			  bubbleTimes : [500,500,500],
			  hideDelays : [30,30,30],
			  bubbleWidths : [183,203,203],
			  bubbleImagesPath : "YOUR RELATIVE PATH TO SKIN FOLDER",
			  msieFix : true
		   };
		   $('.coda_bubble').codaBubble(opts);
		});
	});

//search box
function cleartxt() {
				document.fsearch.qsearch.value = "";
		}
		function createdefault() {
				var txtval = document.fsearch.qsearch.value;
				if(txtval=='')
				{
					document.fsearch.qsearch.value='Search...';
				} 
		}

//layer main menu
function viewGnbsub(layerId){
						var sublayer_length = 6; //jumlah dropdown induk
						var divId = "subLayer";
							
						for(var i=1;i<=sublayer_length;i++){
							if(layerId==divId+i) {
								if(layerId != "none") document.getElementById(divId+i).style.display = "block";
							} else {
								document.getElementById(divId+i).style.display = "none";
							}
						}
					}
					
//Simple jQuery Slideshow Script
function slideSwitch() {
	var $active = $('#slideshow DIV.active');
				
	if ( $active.length == 0 ) $active = $('#slideshow DIV:last');
				
	// use this to pull the divs in the order they appear in the markup
	var $next =  $active.next().length ? $active.next()
	: $('#slideshow DIV:first');
				
	$active.addClass('last-active');
				
	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 1000, function() {
		$active.removeClass('active last-active');
	});
}
				
$(function() {
	setInterval( "slideSwitch()", 5000 );
});

// home intro				
/*
		        $(document).ready(function(){ 
           			
					$('#homeIcons .icon').hover(
					  function () {
						$(this).find(".hover").animate({ 
							width: "305",
							height: "160",
							padding: "5",
							left:"-5",
							top:"-5",
							opacity: 1
							
						  }, {queue:false,duration:500} );

					  }, 
					  function () {
						$(this).find(".hover").animate({ 
							width: "160",
							height: "100",
							padding: "0",
							left:"0",
							top:"0",
							opacity: 0
							
						  }, {queue:false,duration:500});
					  }
				    );
        		}); 
		  */
		  
