
/*if (navigator.appName.indexOf("Internet Explorer") != -1) 
document.onmousedown = noSourceExplorer; 
document.onkeydown = formKeyDown;
function formKeyDown()
{ if (event.keyCode == 27) event.returnValue = false;}
function noSourceExplorer()
{ formKeyDown; 
if (event.button == 2 || event.button == 3){ alert("@版權所有,請勿拷貝!!");} 
}*/

function getclass(obj)
{
	if(obj=="2")
	{
		$("#class2").show();
		$("#class1").hide();
	}else{$("#class1").show();
		$("#class2").hide()
		}
}
//首頁的調用單元的js
function getcell(cid)
{
		  $("#cellinfo").load("index.htm?cellid="+cid+"&n="+Math.random()+"  #cellinfo");
}
//首頁的登入框的判斷
 function formcheck()
  {
		if($("#username").val()==""){alert('帳號不能為空!');$("#username").focus();return false;}
		else if($("#pass").val()==""){alert('密碼不能為空!');$("#pass").focus();return false;}
		else{ 		
		$.get("checklogin.htm?act=login&username="+$("#username").val()+"&pass="+$("#pass").val());
		return true;
		}
	}

	function hiden(divid){
	$(divid).hide();//hide()函数,实现隐藏,括号里还可以带一个时间参数(毫秒)例如hide(2000)以2000毫秒的速度隐藏,还可以带slow,fast
	}
	function slideToggle(divid){
	$(divid).slideToggle(1000);//窗帘效果的切换,点一下收,点一下开,参数可以无,参数说明同上
	}
	function show(divid){
	$(divid).show();//显示,参数说明同上
	}
	function toggle(divid){
	$(divid).toggle(1000);//显示隐藏切换,参数可以无,参数说明同上
	
	}
	function slide(){
	$(divid).slideDown();//窗帘效果展开
	}
	//購買和提交創意的提交方式
    function getbussiness(item,cellid,sendname)
     { 
	
	  if(sendname=="")
	   	{
			$("#msgdiv").html("<div class='error'>請登入網站再進行交易!謝謝!如還不是會員會員!請<a href='register.htm'>注冊會員</a></div>");
			return false;	
		}else
		{
			 $.get("projectinfo.php?n="+Math.random(),
				   { add: "business",cid:cellid,pid:item,name:sendname},
				   function(data){
					  $("#msgdiv").html(data);
				   } 
			);
		}	
	  } 
	  //提交回應
    function sendresponse()
     { 
			 $.post("projectinfo.php?add=add&n="+Math.random(),
				   { NICKNAME:$("#NICKNAME").val(),ID:$("#ID").val(),CONTENTS:$("#CONTENTS").val()},
				   function(data){
					  $("#msgdiv").html(data);	
					  $("#response").hide();
				   } 
			);		
	  }  
function gourl(url)
{
	window.location.href=url;
}
/*获取Cookie值*/
function getCookie(c_name){
if(document.cookie.length>0){
    c_start=document.cookie.indexOf(c_name + "=")
    if(c_start!=-1){ 
       c_start=c_start + c_name.length+1 
       c_end=document.cookie.indexOf(";",c_start)
       if(c_end==-1) c_end=document.cookie.length
       return unescape(document.cookie.substring(c_start,c_end))
    }
}
return ""
}
function pubToFaceBook() 
{ 
	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 ; 
}

function pubToPlurk()
{
	window.open('http://www.plurk.com/?qualifier=shares&amp;status='.concat(encodeURIComponent(location.href)).concat(' ').concat('(').concat(encodeURIComponent(document.title)).concat(')'));
	return;
}
