//corner
  addEvent(this, 'load', initCorners);

  function initCorners() {
    var settings = {
      tl: { radius: 10 },
      tr: { radius: 10 },
      bl: { radius: 10 },
      br: { radius: 10 },
      antiAlias: true
    }
    curvyCorners(settings, ".box, .block, .block2, .link-sponsor");
  };
  

	function changebg(var_x, var_y)
	{
		$('#mainmenu').css('background-position',var_x + ' ' + var_y);
	}

$(document).ready(function(){
	
//slide
	$(".nav-contact").click(function(){
		$("#pop-contact").slideToggle("slow");
		$(".nav-contact").css('background-position','0px -9px');
	});
	
// Bloked Link true
	$(".text ul.list li").mouseover(function(){
		$(this).click(function(){
			$(this).css('cursor','pointer');
		}).mouseover(function() {
			$(this).css('backgroundColor','#989298');
		}).mouseout(function() {
			$(this).css('backgroundColor','');	
		});
	});
	
// Colorbox
	$(".pop-artist").colorbox({width:"800px"});
	
//Full Caption Sliding (Hidden to Visible)
	$('.boxgrid.captionfull').hover(function(){
		$(".cover", this).stop().animate({top:'80px'},{queue:false,duration:200});
	}, function() {
		$(".cover", this).stop().animate({top:'120px'},{queue:false,duration:200});
	});
	
//smart colomn
function smartColumns() { //Create a function that calculates the smart columns
        //Reset column size to a 100% once view port has been adjusted
	$("ul.column").css({ 'width' : "100%"});
	var colWrap = $("ul.column").width(); //Get the width of row
	var colNum = Math.floor(colWrap / 200); //Find how many columns of 200px can fit per row / then round it down to a whole number
	var colFixed = Math.floor(colWrap / colNum); //Get the width of the row and divide it by the number of columns it can fit / then round it down to a whole number. This value will be the exact width of the re-adjusted column
	$("ul.column").css({ 'width' : colWrap}); //Set exact width of row in pixels instead of using % - Prevents cross-browser bugs that appear in certain view port resolutions.
	$("ul.column li").css({ 'width' : colFixed}); //Set exact width of the re-adjusted column	

}	
smartColumns();//Execute the function when page loads
$(window).resize(function () { //Each time the viewport is adjusted/resized, execute the function
	smartColumns();
});


	// BUAT CONTACT MESSAGE BOX
	//scroll the message box to the top offset of browser's scrool bar
	$(window).scroll(function()
	{
  		$('#contact_message_box').animate({top:$(window).scrollTop()+"px" },{queue: false, duration: 350});  
	});
    //when the close button at right corner of the message box is clicked 
	$('#close_message').click(function()
	{
  		//the messagebox gets scrool down with top property and gets hidden with zero opacity 
		$('#contact_message_box').animate({ top:"+=15px",opacity:0 }, "slow");
	});
	// CLOSE CONTACT MESSAGE BOX

/*	
// tab-content event
	$('#mod3-mask').css({'height':$('#mod3-panel1').height()});	
	$('#mod3-panel').width(parseInt($('#mod3-mask').width() * $('#mod3-panel div').length));
	$('#mod3-panel div').width($('#mod3-mask').width());
	
	//Get all the links with rel as panel
	$('a[rel=mod3-panel]').click(function () {
		var panelheight = $($(this).attr('href')).height();
		$('a[rel=mod3-panel]').removeClass('selected');
		$(this).addClass('selected');
		
		$('#mod3-mask').animate({'height':panelheight},{queue:false, duration:500});			
		
		$('#mod3-mask').scrollTo($(this).attr('href'), 800);	
		return false;
	});
	
// cu3er script
	var flashvars = {};
	flashvars.xml = "config.xml";
	flashvars.font = "font.swf";
	var attributes = {};
	attributes.wmode = "transparent";
	attributes.id = "slider";
	swfobject.embedSWF("cu3er.swf", "banner", "608", "334", "9", "expressInstall.swf", flashvars, attributes);
	
//lava
	$(function() {
		$('#menu-top').lavaLamp({fx: 'swing', speed:400});
	});

//back to top
	$('.back-top a').click(function(){
		var to = $(this).attr('href');		
		$.scrollTo(to, 1200);		
		return false;
	});
	
//tab
	$("ul.tab-nav a").click(function() {
		var curChildIndex = $(this).parent().prevAll().length + 1;
		$(this).parent().parent().children('.current').removeClass('current');
		$(this).parent().addClass('current');
		$(this).parent().parent().next('.tab-container').children('.current').slideUp('slow',function() {
		$(this).removeClass('current');
		$(this).parent().children('div:nth-child('+curChildIndex+')').slideDown('slow',function() {
		$(this).addClass('current');
		});
	});
	return false;								
	});
	
//color box
	$("a[rel='photo-gallery']").colorbox();
	$(".pop-member").colorbox({width:"600px", inline:true, href:"#pop-member"});
		
// accordion side bar
	$(".mod-accor h3").eq(0).addClass("active");
	$(".mod-accor .side-accor-inside").eq(0).show();

	$(".mod-accor h3").click(function(){
		$(this).next(".side-accor-inside").slideToggle("slow")
		.siblings(".side-accor-inside:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	})
	
// accordion faq
	$(".accordion2 h3").eq(0).addClass("active");
	$(".accordion2 .accor-inside").eq(0).show();

	$(".accordion2 h3").click(function(){
		$(this).next(".accor-inside").slideToggle("slow")
		.siblings(".accor-inside:visible").slideUp("slow");
		$(this).toggleClass("active");
		$(this).siblings("h3").removeClass("active");
	});
	
//sitemap
	$("#navigation").treeview({
		animated: "fast",
		persist: "location",
		collapsed: true,
		unique: true
	});	
	

//global people						   
	$("#mod12-slide").easySlider({
		auto: true,
		continuous: true 
	});
	
	

//global highlight
	$(document).ready(function(){
		$('#slider').s3Slider({
			timeOut: 5000
		});
		$('#slider1').s3Slider({
			timeOut: 3000
		});
	});

//signin
	$(".signin").click(function(e) {          
		e.preventDefault();
		$("fieldset#signin_menu").toggle();
		$(".signin").toggleClass("menu-open");
	});
	
	$("fieldset#signin_menu").mouseup(function() {
		return false
	});
	$(document).mouseup(function(e) {
		if($(e.target).parent("a.signin").length==0) {
			$(".signin").removeClass("menu-open");
			$("fieldset#signin_menu").hide();
		}
	});			
	
    $(function() {
	  $('#forgot_username_link').tipsy({gravity: 'w'});   
    });
*/


/*
//tab-content chart
	$('#mod6-mask').css({'height':$('#mod6-panel1').height()});	
	$('#mod6-panel').width(parseInt($('#mod6-mask').width() * $('#mod6-panel div').length));
	$('#mod6-panel div').width($('#mod6-mask').width());
	
	//Get all the links with rel as panel
	$('a[rel=mod6-panel]').click(function () {
		var panelheight = $($(this).attr('href')).height();
		$('a[rel=mod6-panel]').removeClass('selected');
		$(this).addClass('selected');
		
		$('#mod6-mask').animate({'height':panelheight},{queue:false, duration:500});			
		
		$('#mod6-mask').scrollTo($(this).attr('href'), 800);	
		return false;
	});	
*/
		
});
