var domainUrl ="http://www.subaye.com" ;
function upload()
{
	if(GetCookie("userID")=="")
		window.open(domainUrl +"/User/Login.asp",'upload');
	else
		window.open('http://up.subaye.com/subaye/my/Upvideo/?userID='+GetCookie("userID"),'upload',"menubar=no,scrollbars=yes,resizable=no,width=650,height=320,left=150,top=180");	
}

function favorite(id)
{
	var url= domainUrl + "/My/favoriteVideo/favorite.aspx?ID="+id;
	var url2= domainUrl +"/User/Login.asp?URL=/My/favoriteVideo/favorite.aspx?ID="+id;

	if(GetCookie("userID")=="")
		window.open(url2,'favorite');
	else
		window.open(url,'favorite',"width=420,height=310");	
}

function share(id)
{	
	window.open(domainUrl + '/My/shareVideo/share.aspx?ID='+id,'share',"width=540,height=550");
}

function Archives(id)
{	
	window.open(domainUrl +'/Archives/default.aspx?corpID='+id);
}
//复制到剪贴板
function copyText(htmlText){
	window.clipboardData.setData("text",htmlText);
	alert("已经把网址复制到剪贴版，您可以用 CTRL+V 粘贴给QQ / MSN 用户");
}

//关闭DIV
function closeDiv(id){
	document.getElementById(id).style.display='none';
}
//打开DIV
function openDiv(id){
	document.getElementById(id).style.display='block';
}		
//置空
function nullIt(id){
	document.getElementById(id).innerHTML = '';
}

//FULL
  function gofull(){

   var pth,pwh;
   if(Bh<Sh)
   {
      pth = (Sh-Bh)*1/2;
      pwh = (Sh-Bh)*1/2;
   }
   
   document.getElementById(PlayerID).style.height=Bh;//document.body.parentNode.offsetHeight;
   document.getElementById(PlayerID).style.width=Bw;//document.body.parentNode.offsetHeight*4/3;
   
   document.getElementById("swfplayer").style.background="#000";
   document.getElementById("swfplayer").style.position="static";
   document.getElementById("swfplayer").style.width=Sw;//document.body.parentNode.clientWidth;
   document.getElementById("swfplayer").style.height=Sh;//document.body.parentNode.scrollHeight;
   document.getElementById("swfplayer").style.top = "0px";
   document.getElementById("swfplayer").style.left="0px";
   document.getElementById("swfplayer").style.border="0px";
   document.getElementById("swfplayer").style.margin="0px";      
   document.getElementById("swfplayer").style.padding=pth+"px "+pwh+"px";//document.body.parentNode.scrollTop+" 0px";

  }
  function nofull(){
   //document.getElementById("swfplayer").background="#dbdbdb";
   document.getElementById("swfplayer").style.position="";
   document.getElementById("swfplayer").style.width=Sw;
   document.getElementById("swfplayer").style.height="auto";
   document.getElementById("swfplayer").style.top="";
   document.getElementById("swfplayer").style.left="";
   document.getElementById("swfplayer").style.border="0px";
   document.getElementById("swfplayer").style.margin="0px 0px 0px 0px";
   document.getElementById("swfplayer").style.padding="0px";
   document.getElementById(PlayerID).style.height=Sh;
   document.getElementById(PlayerID).style.width=Sw;
  }
  
  function playerfullyn(){
  try{
    var panel=document.getElementById("swfplayer");
    if(panel){
      if(panel.style.position=="static"){
        nofull()
      }else{
        gofull();
      }
    }
  }catch(e){}
}

function Request(QueryString)
{
	var strHref=window.location.href;
	var strParm;
	if(strHref.search(/\?/)!=-1)
	{
		strHref=strHref.substr(strHref.search(/\?/)+1);
		strHref=strHref.split(/&/);
		for(var icount = 0; icount<strHref.length; icount++)
		{
			if(strHref[icount].search("^"+QueryString+"=")!=-1)
			{
				strParm=strHref[icount].substr(QueryString.length+1)
			}
		}
		return(strParm);
	}
}

//功能:得到指定的cookie值
//参数:cookieID
//返回:cookie值
function GetCookie(cookieName)
{
		var search = cookieName + "=" 
		var returnvalue = ""; 
		if (document.cookie.length > 0) 
		{ 
			var offset = document.cookie.indexOf(search) 
			if (offset != -1) 
			{ 
				offset += search.length 
				end = document.cookie.indexOf(";", offset); 
				if (end == -1) 
				end = document.cookie.length; 
				returnvalue=unescape(document.cookie.substring(offset, end)) 
			} 
		} 
		return returnvalue; 
}
