// Innitiate Main Menu
$(document).ready(function() { 
	$('ul#menu').superfish(); 
}); 

//Homepage boxes
function equalHeight(group) {
	tallest = 0;
	group.each(function() {
		thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}
$(document).ready(function() {
	equalHeight($(".equalize"));
	equalHeight($(".equalize2"));
});


//News Scroller (Widget)
$(document).ready(function() {
 
 	$('.news-scroller').cycle({ 
	    fx: 'scrollVert',
		speed: 2000,
		rev: true,
		timeout: 10000,
		next: '.news-next', 
	    prev: '.news-previous'
	 });      
 
});


// Social Drop Down Panel 
$(document).ready(function() {
	$(".btn-slide").click( function() {
		if ($("#openCloseIdentifier").is(":hidden")) {
			$("#social").animate( {top: "0"} , 650 );
			$(this).addClass("active");
			$("#openCloseIdentifier").show();
		} else {
			$("#social").animate( {top: "-46px"} , 650 );
			$(this).removeClass("active");
			$("#openCloseIdentifier").hide();
		}
	});  
});


//Innititate Pretty Photo
$(document).ready(function(){
	$("a[rel^='lightbox']").prettyPhoto({theme:'light_rounded'});
});


//Contact Form
$(document).ready(function() {

	//Define URL to PHP mail file
	var url = "";
	
	//Activate jQuery form validation
	$("#jaybich-contact").validate({
	
		submitHandler: function() {
		
			//Define data string
			var datastring = $("#jaybich-contact").serialize();
			
			//Submit form
			$.ajax({
				type: "POST",
				url: url,
				data: datastring,
				success: function(){
					//$('#jaybich-contact').slideUp();
					$('#sent').fadeIn();
				}
			});
		}
	
	});
			
});

//Comments Form
$(document).ready(function() {
	
	//Activate jQuery form validation
	$(".comments-form").validate();
			
});

//Portfolio thumbnail
$(document).ready(function(){

	$('.portfolio-box a').hover(function() {
		
		//Show darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:0.5},400);

	}, function() {
		
		//Hide darkenned hover over thumbnail image
		$(this).find('img').stop(true, true).animate({opacity:1},400);
			
	});

});
$(function() {
	$('#news_ticker').cycle({ 
		cleartype:  10,
		cleartypeNoBg: true
	});
});
$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) {
	$(pager).find('li').removeClass('selected').filter('li:eq('+currSlideIndex+')').addClass('selected');
};
	function tujuhkonfirmasi(deletepage_url,satu,satu_value,dua,dua_value,tiga,tiga_value,empat,empat_value,lima,lima_value,enam,enam_value,tujuh,tujuh_value,messagetext) { 
  if (confirm(messagetext)==1){
  	location.href = eval('\"'+deletepage_url+'?'+satu+'='+satu_value+'&'+dua+'='+dua_value+'&'+tiga+'='+tiga_value+'&'+empat+'='+empat_value+'&'+lima+'='+lima_value+'&'+enam+'='+enam_value+'&'+tujuh+'='+tujuh_value+'\"');
  }
}
//Cufon text
Cufon.replace('h2, h3');
Cufon.replace('.hot_news', { textShadow: '#000000 1px 2px', fontFamily: 'Century Gothic', fontSize: '14', color: '-linear-gradient(#f5f4f4, 1=#e3e3e3, 0.80=#a2a2a2, #fff)'});
Cufon.replace('.eform', { textShadow: '#000000 1px 2px', fontFamily: 'Verdana', fontSize: '14', color: '-linear-gradient(#36F, 1=#e3e3e3, 0.80=#a2a2a2, #fff)'});
