﻿$(document).ready(function(){
	
	/***************************** 社群分享 start ****************************/
	$("#share ul li.fb a").click(function(){
		window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title),'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	});
	$("#share ul li.plurk a").click(function(){
		window.open('http://www.plurk.com/?qualifier=shares&status='.concat(encodeURIComponent(location.href)).concat(' ').concat('(').concat(encodeURIComponent(document.title)).concat(')'));
		return false;
	});
	$("#share ul li.mySpace a").click(function(){
		window.open('http://www.myspace.com/Modules/PostTo/Pages/?u='+encodeURIComponent(document.location.toString()),'ptm','height=450,width=440').focus();
		return false;
	});
	$("#share ul li.twitter a").click(function(){
		window.open('http://twitter.com/home/?status='.concat(encodeURIComponent(document.title)).concat(' ').concat(encodeURIComponent(location.href)));
		return false;
	});
	/***************************** 社群分享 end ****************************/
	
	/***************************** 搜尋框 焦點 start ****************************/
	$(".keyword").each(function(){
		var inputKeyword=$(this);
		inputKeyword.data("defaultV", inputKeyword.val()).focus(function(){
			if($(this).val()==$(this).data("defaultV")){
				$(this).val("");
			}
		}).blur(function(){
			if($(this).val()==""){
				$(this).val($(this).data("defaultV"));
			}
		});
	});
	/***************************** 搜尋框 焦點 end ****************************/
	
	/***************************** 兩專區選單 start ****************************/
	$("#header #headerCT #navBlock #zoneNav>li").hover(function(){
		$(this).addClass("hover");
		var subNav=$(this).find(".subNav");
		subNav.stop().show().animate({
			opacity: 1
		}, {
			duration: "fast",
			queue: false
		});
	}, function(){
		$(this).removeClass("hover");
		var subNav=$(this).find(".subNav");
		subNav.stop().animate({
			opacity: 0
		}, {
			duration: "fast",
			queue: false,
			complete: function(){
				subNav.hide();
			}
		});
	});
	/***************************** 兩專區選單 end ****************************/
	
	/***************************** 瀏覽路徑 start ****************************/
	$("#breadCrumb ul li:first-child").addClass("first");
	$("#breadCrumb ul li:last-child").addClass("last");
	/***************************** 瀏覽路徑 end ****************************/
	
	/***************************** 拉長左選單底色高度 start ****************************/
	var leftHeight=$("#leftNav").height();
	var mainCTHeight=$("#mainCT").height();
	if(leftHeight<mainCTHeight){
		$("#leftNav").height(mainCTHeight);
	}
	/***************************** 拉長左選單底色高度 end ****************************/
	
	/***************************** 社群分享(分享本頁) start ****************************/
	$(".shareThisPage ul li.fb a").click(function(){
		window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(location.href)+'&t='+encodeURIComponent(document.title),'sharer','toolbar=0,status=0,width=626,height=436');
		return false;
	});
	$(".shareThisPage ul li.plurk a").click(function(){
		window.open('http://www.plurk.com/?qualifier=shares&status='.concat(encodeURIComponent(location.href)).concat(' ').concat('(').concat(encodeURIComponent(document.title)).concat(')'));
		return false;
	});
	$(".shareThisPage ul li.mySpace a").click(function(){
		window.open('http://www.myspace.com/Modules/PostTo/Pages/?u='+encodeURIComponent(document.location.toString()),'ptm','height=450,width=440').focus();
		return false;
	});
	$(".shareThisPage ul li.twitter a").click(function(){
		window.open('http://twitter.com/home/?status='.concat(encodeURIComponent(document.title)).concat(' ').concat(encodeURIComponent(location.href)));
		return false;
	});
	/***************************** 社群分享(分享本頁) end ****************************/
	
});
