$.extend({
getUrlVars: function(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
},
getUrlVar: function(name){
return $.getUrlVars()[name];
}
});
function clickIndexLi_1(){
  $("#index_menu>li ul").hide();
  $("ul#index_ul_1").show();
}
function clickIndexLi_2(){
  $("#index_menu>li ul").hide();
  $("ul#index_ul_2").show();
}
function clickIndexLi_3(){
  $("#index_menu>li ul").hide();
  $("ul#index_ul_3").show();
}
function clickIndexLi_4(){
  $("#index_menu>li ul").hide();
  $("ul#index_ul_4").show();
}
function clickIndexLi_5(){
  $("#index_menu>li ul").hide();
  $("ul#index_ul_5").show();
}
function clickIndexLi_6(){
  $("#index_menu>li ul").hide();
  $("ul#index_ul_6").show();
}
function clickContectLi(){
  var content_li_no = $(this).attr("nn");
  if ($("ul#contents_menu li.c"+content_li_no).css("display") == "none")
  {
  $("ul#contents_menu li.hide").hide(300);
  $("ul#contents_menu li.c"+content_li_no).show(300);
  }
}
function clickContectLi_a(){
  $("ul#contents_menu>li>a").css("background-color","");
  $("ul#contents_menu>li>a").css("color","");
  $(this).css("background-color","#2D3C83");
  $(this).css("color","#FFFFFF");
  var cla = $(this).attr("cla");
  var tit = $(this).attr("tit");
  var cd = $(this).attr("cd");
  $("p#content").html(tit);
  $("p#biaoti").html(cla);
  $("span#span_tit").html(tit);
  $("span#span_cla").html(cla);
  $("div.textbox div").hide();
  $("div#d"+cd).show();
  $("div#d"+cd+" div").show();
  contentAutoHight();
}
function clickContectList_a(){
	var cd = $(this).attr("cd");
	$("div.textbox div").hide();
	$("div#d"+cd).show();
	contentAutoHight();
}
function indexMouseOver()
{
	$("div#transition_btn ul li").removeClass();
	$(this).addClass("overed");
	var index_mov_no = $(this).attr("nn");
  $("div#transition_image img").fadeOut();
	$("#transition_image_"+index_mov_no).fadeIn();
}
function indexMovAutoChange1()
{
	$("div#transition_btn ul li").removeClass();
	$("div#transition_btn ul li:eq(0)").addClass("overed");
	$("div#transition_image img").fadeOut();
	$("#transition_image_1").fadeIn();
}
function indexMovAutoChange2()
{
	$("div#transition_btn ul li").removeClass();
	$("div#transition_btn ul li:eq(1)").addClass("overed");
	$("div#transition_image img").fadeOut();
	$("#transition_image_2").fadeIn();
}
function indexMovAutoChange3()
{
	$("div#transition_btn ul li").removeClass();
	$("div#transition_btn ul li:eq(2)").addClass("overed");
	$("div#transition_image img").fadeOut();
	$("#transition_image_3").fadeIn();
}
function indexMovAutoChange()
{
	indexMovAutoChange1();
	setTimeout("indexMovAutoChange2()", 10000);
	setTimeout("indexMovAutoChange3()", 20000);
}
function contentAutoHight(){
	var h_left = $("div#leftmenu").height();
	var h_right = $("div#contentright").height()-30;
	if (h_right>288)
	{
		$("div#leftmenu").height(h_right)
	}
	else
	{
		$("div#leftmenu").css("height","");
	}
};
function NextPage(page_no){
	  //pages
	  var max_page_no;
	  if($("ul#news li").length % 5 == 0)
	  {
		  max_page_no = $("ul#news li").length / 5;
	  }
	  else
	  {
		  max_page_no =  Math.floor($("ul#news li").length / 5) + 1
	  }
	  $("span#max_page_no").html(max_page_no);
	  var page_no;
	  if (page_no == 1)
	  {
		  $("ul#news li").show();
		  $("ul#news li:gt(4)").hide();
		  $("span#curr_page_no").html(page_no);
	  }
	  if (page_no > 1)
	  {
		  var page_li_max = 4 + ((page_no - 1) * 5);
		  var page_li_min = (page_no - 1) * 5;
		  $("ul#news li").show();
		  $("ul#news li:gt("+page_li_max+")").hide();
		  $("ul#news li:lt("+page_li_min+")").hide();
		  $("span#curr_page_no").html(page_no);
	  }
}
function clickNextPage(){
	var max_page_no;
	if($("ul#news li").length % 5 == 0)
	{
		max_page_no = $("ul#news li").length / 5;
	}
	else
	{
		max_page_no =  Math.floor($("ul#news li").length / 5) + 1
	}
	page_no_click = parseInt($("span#curr_page_no").html()) + 1;
	if (page_no_click <= max_page_no)
	{
	NextPage(page_no_click);
	}
}
function clickPrevPage(){
	page_no_click = parseInt($("span#curr_page_no").html()) - 1;
	NextPage(page_no_click);
}
function clickFirstPage(){
	NextPage(1);
}
function clickLastPage(){
	var max_page_no;
	if($("ul#news li").length % 5 == 0)
	{
		max_page_no = $("ul#news li").length / 5;
	}
	else
	{
		max_page_no =  Math.floor($("ul#news li").length / 5) + 1
	}
	NextPage(max_page_no);
}
