// JavaScript Document
$(document).ready(function(){	

    // fix PNG
	// create lightbox
	$('a.lightbox').lightBox();	
	$('a[@rel*=lightbox]').lightBox();	
	time = new Date().getTime();
	currentSize = 12;	
	// giam co chu
	$(".sizeDown").click(function(){								   
		currentSize--;
		$("#CurrentSize").val(currentSize);
		if ($("#articledetail_body")!=null)
		{
			$("#articledetail_body").css("font-size", currentSize + 'px');
		}		
		return false;
    });
	// tang co chu
	$(".sizeUp").click(function(){
		currentSize++;
		$("#CurrentSize").val(currentSize);
		if ($("#articledetail_body")!=null)
		{
			$("#articledetail_body").css("font-size", currentSize + 'px');
		}	
		return false;		
    });
	// reset co chu
	$(".resetCurrentsize").click(function(){
		currentSize=12;
		$("#CurrentSize").val(currentSize);
		if ($("#articledetail_body")!=null)
		{
			$("#articledetail_body").css("font-size", currentSize + 'px');
		}	
		return false;		
    });
	// khi share bi click
	$("#hovershare").click(function(){
		$("#divshare").toggle();
		$("#divshare a").click(function(){
			newlink = $(this).attr("href").replace('$url',document.URL);
			window.open(newlink);
			return false;
		});
    });
 
 	//$('#panelscroll').jScrollPane({scrollbarWidth:5, scrollbarMargin:10, animateTo:true,dragMinHeight:0,dragMaxHeight:15,showArrows:false});    
	
	$("a.fancybox").fancybox({
			    'zoomSpeedIn':	0, 
			    'zoomSpeedOut':	0,
				'overlayShow': true,
				'frameWidth':800,
				'frameHeight':600				
	});	
	$('.webpart').hover(function(){
		temp ="<div id='toolwrap' class='wrap'>" + $(this).attr("title") + "</div>"
		$(this).append(temp);
	},
		 function(){
		 $("#toolwrap").remove();
	});
	
	$("#tree").treeview({
		collapsed: true,
		animated: "medium",
		control:"#sidetreecontrol",
		persist: "location"

	});
	$("li.tabs").hover(function () {						
			$(".actives").removeClass("actives");			
			$(this).find("a").addClass("actives");			
			$(".tabcontent").hide();			
			var content_show = $(this).find("a").attr("title");
			$("#"+content_show).show();		  		  
	},
		function(){
	});	
	//var = $(".ContentTitle").val();	
	$.get("/WebPart/Articles/ArticlesHomeAjax.aspx", {t:time}, function(data){
 		if ($("#content_2")!=null)
		{
			$("#content_2").html(data);
		}
	});
	
	
});
	