$(function(){
	var rightSearchLabel = $("form#mainSearch input.textGlosSearch").val();
	$("form#mainSearch input.textGlosSearch").focus(
													  function(){
														  if (this.value == rightSearchLabel) {
															 $(this).val('');
															 };
														  }
													  )
												.blur(
													  function(){
														  if (this.value == '') {
															 $(this).val(rightSearchLabel);
															 };
														}													  
													  );
	$("form.glosSearch span.btnSearch").css("cursor","pointer");

	$("form.glosSearch span.btnSearch").click(
											  function(){
												  var keyInput = $(this).parent().find("input.textGlosSearch").val();
												  if (keyInput.length > 80)
												  {
													  $(this).parent().find("input.textGlosSearch").val("您输入的关键词过长");
													  rightSearchLabel = $(this).parent().find("input.textGlosSearch").val();
													  }
												else{
												  $(this).parent().submit();
													}
												  }
												  );
	$("span.glosFuncSend a#btnSendToFriend").click(
												   function()
												   {
														var buildURL = '/wiki/raf/gid'+glosId+'.html';
														window.open(buildURL,'rafPage','menubar=0,resizable=1,width=700,height=600,scrollbars=yes');
														return false;
												   }
												   );
	
	$("span.glosFuncSubs a#btnEmail").click(
										   function()
										   {
											   window.open('/html/subscribe-mail.html','subPage','menubar=0,resizable=1,width=700,height=600,scrollbars=yes');
											   return false;
										   }
										   );
	
	$("form#shareGlos input.shareCode").focus(
										  function(){
											 $(this).select();

											 }
										  );
	
});