var $ = jQuery.noConflict();

// color changes initialization
var i = 0;
var myColors = ['#CF7D2C','#6DBB48','#7E82FA','#D13F81','#92417F','#46BD8A'];

function changeColor() { 
		jQuery("body").animate({backgroundColor:myColors[i]}, "slow");
		i++; 
		if(i == myColors.length){
			i = 0;
		}
	}


jQuery(document).ready(function() {	

	// loading page
	if ($.browser.msie) { 
		$('#wrapper').show(); 
	} 
	else {
		$('#wrapper').fadeIn(3000);
	}

	// pause button cycle
	$('.pause').click(function() { 
		$('#wheel ul').cycle('pause'); 
		$(this).toggleClass('paused'); 
	});
	
	$('.paused').click(function() { 
		$('#wheel ul').cycle('resume'); 
	});
	
	// background image height
	var contentHeight = jQuery(window).height();
	jQuery('#wrapper').css('height',contentHeight);

	
	// on resize window
	jQuery(window).resize(function(){
		contentHeight = jQuery(window).height();
		jQuery('#wrapper').css('height',contentHeight);
	});
	
	// fancybox
	$("a.fancybox_image").fancybox({
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'elastic',
			'speedIn'			:	600, 
			'speedOut'		:	200, 
			'overlayShow'		:	true,
			'overlayOpacity'	: 	0.3
	}); 
		
	$("a.fancybox_video").fancybox({
			'transitionIn'	:	'elastic',
			'transitionOut'	:	'elastic',
			'speedIn'			:	600, 
			'speedOut'		:	200, 
			'overlayShow'		:	true,
			'overlayOpacity' 	: 	0.3,
			'type'			: 	'swf',
			'swf'      		: 	{'wmode':'transparent','allowfullscreen':'true'}
	}); 
		
	// dropdown menu
	jQuery('ul.children').parent('li').children('a').addClass('hasDrop');
	jQuery('ul.sub-menu').parent('li').children('a').addClass('hasDrop');
	jQuery('.headerRight ul').droppy();
	jQuery('nav ul.children li:last-child a, nav ul.sub-menu li:last-child a').css('border-bottom', 0);
	$("nav ul > li").has('a.hasDrop').mouseover(function() {
		jQuery(this).addClass('drop'); 
	}).mouseout(function() {
		jQuery(this).removeClass('drop'); 
	});

	// hiding default text in form fields
	jQuery('[placeholder]').focus(function() {
		var input = jQuery(this);
		if (input.val() == input.attr('placeholder')) {
		  input.val('');
		  input.removeClass('placeholder');
		}
	}).blur(function() {
		var input = jQuery(this);
		if (input.val() == '' || input.val() == input.attr('placeholder')) {
		  input.addClass('placeholder');
		  input.val(input.attr('placeholder'));
		}
	}).blur();
		
	// Meet Dari section
	$("#meet").click(function() {
		$(".author").slideToggle("2000","easeOutBounce"); 
	});
	
	$(".author .close").click(function() {
		$(".author").slideToggle("2000","easeOutBounce"); 
	});
	
	// Try this section
	$("#trythis .close").click(function() {
		jQuery("#trythis").slideToggle("1000","easeOutBounce"); 
	});
   
});





