function _bug()
{
	window.open('/bug.php?id='+flashid);
}

function _winfull()
{
	window.open('/full.html?'+swfurl,'','fullscreen');
}

function fullPlay()
{
	window.open(getSwfUrl(youxipath),'','fullscreen');
}

function songClip()
{
	var textobj=window.document.all.songclipurl;
	textobj.select();
	if (document.all)
	{         
				therange=textobj.createTextRange()         
				therange.execCommand("Copy")         
				window.alert("地址已复制到您的剪切栏,可直接粘贴发送给您的好友!");      
	}
}

function vw_window_open(sUrl,nWidth,nHeight,bNewWin,bCenter)
{
	if(sUrl&&sUrl.length>7)
	{
		if(bCenter)
		{
			var nleft=screen.width/ 2- nWidth/ 2;
			var ntop=screen.Height/ 2- nHeight/ 2;
			return window.open(sUrl,bNewWin?"_blank":"_self","height="+nHeight+",width="+nWidth+",left="+nleft+",top="+ntop+",status=yes,toolbar=no,menubar=no,scrollbars=yes,location=no");
		}
		else
		{
			return window.open(sUrl,bNewWin?"_blank":"_self");
		}
	}
	return null;
}

function AddFav(tt) 
{
	var url=window.location.href;
	var title=document.title;
	switch(tt)
	{
		case "baidu":
		{
		c = "" + (window.getSelection ? window.getSelection() : document.getSelection ? document.getSelection() : document.selection.createRange().text);
		var openurl="http://cang.baidu.com/do/add?it="+encodeURIComponent(title)+"&iu="+encodeURIComponent(url)+"&dc="+encodeURIComponent(c)+"&fr=ien#nw=1";
		window.open(openurl,"_blank","scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes");
		}
		break;
		
		case "sina":
		{
		//d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(vivi=window.open('http://vivi.sina.com.cn/collect/icollect.php?pid=28&title='+escape(title)+'&url='+escape(url)+'&desc='+escape(t),'vivi','scrollbars=no,width=480,height=480,left=75,top=20,status=no,resizable=yes'));	
		window.open('http://www.renrenweb.com/bookmark.aspx?t='+encodeURIComponent(title)+'&u='+encodeURIComponent(url)+'&d=','favit','width=600,height=450,left=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');		
		}
		break;
		
		case "qq":
		{
			window.open('http://shuqian.qq.com/post?title='+encodeURIComponent(title)+'&uri='+encodeURIComponent(url)+'&jumpback=2&noui=1','favit','width=960,height=600,left=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');
		}
		break;
		
		case "qqspace":
		{
			var _qq = Cookie.read('qq');
			if(!_qq)
			{	_qq=prompt('输入您的QQ号码（请先登录您的QQ空间）','');	}
			else
			{	_qq=prompt('输入您的QQ号码（请先登录您的QQ空间）',_qq);	}
			if(_qq)
			{
				if(_qq.match(/^[1-9]\d{4,9}$/)==null)
				{
					alert('请输入正确的QQ号码');
					return false;
				}
				else
				{
					Cookie.create('qq',_qq,30); //保存30天
					var str='http://'+ _qq +'.qzone.qq.com/addNewBlog?title='+ youxi_name +'小游戏&category=双人游戏&content=[url='+url+'][img]http://www.1k6k.com'+youxi_pic+'[/img][/url]%0A[url=http://www.1k6k.com/][B]双人小游戏[/B][/url]-[url='+url+'][B]'+youxi_name +'小游戏[/B][/url] [url='+url+'][ft=red,3,][ 点击开始玩游戏 ][/ft][/url]';
					vw_window_open(str,"800","600","_blank",true);
				}
			}
		}
		break;
		
		case "page":
		{
			if (window.sidebar)
			{ window.sidebar.addPanel(title, url,"");   }
			else if( document.all ) 
			{ window.external.AddFavorite( url, title); } 
			else if( window.opera && window.print )
			{ return true;  }	
		}
		break;
		
		default:
		{
			title="1k6k双人小游戏-1k6k.com";
			url="http://www.1k6k.com";
			if (window.sidebar)
			{ window.sidebar.addPanel(title, url,"");   }
			else if( document.all ) 
			{ window.external.AddFavorite( url, title); } 
			else if( window.opera && window.print )
			{ return true;  }	
		}
		break;
	}
}

//删除左右两端的空格
function trim(str)
{
	return str.replace(/(^\s*)|(\s*$)/g, "");
}

flashid=0;

var Cookie=(function(){return{'create':function(name,value,days){var expires="";if(days>0){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires="; expires="+date.toGMTString()}document.cookie=name+"="+value+expires+"; path=/"},'read':function(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}return null},'erase':function(name){Cookie.create(name,"",-1)}}})();