  	var popoff=true;
  	var NoSetupURL="welcome_1.html",puk=true;
  	var iFrame,setupUrl="http://ddd.dudu.com/ddd_setup.html";
	var dl_id=1;
  	var newWin,winWidth=100,winHeight=100,posTop=screen.availHeight+50,posLeft=screen.availWidth/2-50,push="";
 	function pushWin(){
    		newWin.callback=NoSetupURL;
    		try{
      		if(push=="up"){newWin.focus();}else{newWin.blur();}
      		newWin.moveTo(posLeft,posTop);newWin.callback=showNoSetup;
      		if(push=="up"){newWin.focus();}else{newWin.blur();window.focus();}
    		}catch(e){}
  		}
  	function directEmbedHelper(){
    		puk=true;
    		pipUrl+="&lpi=1";
    		iFrame=document.createElement("IFRAME");
    		iFrame.style.visibility="visible";iFrame.style.width=5;iFrame.style.height=5;
    		iFrame.frameBorder=0;iFrame.scrolling="no";iFrame.src=pipUrl;directEmbed();
   		}
  	function commence(){
   	 	if(!newWin || newWin.closed){
    			directEmbedHelper();
    			}
		else	{
			pushWin();
			}
  		}
  	function showNoSetup(){
    		if(NoSetupURL ) location.replace( NoSetupURL );
    		if(!puk) setTimeout("newWin.close()",2500);
  		}

/* functions for setup.html*/

	function setCookie(){
		var name = "DDDSetup";
		var value = "5|6";
		var expiry = 1000 * 5184000;
		var expDate = new Date();
		expDate.setTime(expDate.getTime() + expiry);
		document.cookie = name + "=" + escape( value ) + "; expires=" + expDate.toGMTString() + "; path=/; domain=.dudu.com";
		}
	function checksetup(){
		var pdppi_ok = true;
		if( typeof( Spocx ) == "object" ){
			if( typeof( Spocx.dlsite ) != "string" ){
				pdppi_ok = false;
				}
			} 
		else 	{
			pdppi_ok = false;
			}
		if( pdppi_ok ){
			setCookie();
			} 
		else 	{
			try{ window.callback(); }
			catch(e){}
			}
		}
	function makeTime( diff ){
		if( isFinite( diff ) ){
			var now = new Date();
			now.setTime( now.getTime() + ( diff * 1000 ) );
			return( now.toGMTString() );
			}
		}
	function init(){
		var lpi = false;
		var win_width = 100, win_height = 100;
		var top = screen.height + 1;
		var left = screen.width/2 - win_width/2;
		if(!lpi){
			window.resizeTo( win_width, win_height );
			window.moveTo( left, top );
			}
		}
	function OpenDDDSetupWindows(id){
  		if(popoff){
    		 	newWin=window.open(setupUrl,"newWin","width="+winWidth+",height="+winHeight+",left=0,top=10000");
			}
    		 if(id==1){setTimeout("commence()",250);}
		 if(id==2){setTimeout("download_ddd()",2500);} //setTimeout("newWin.close()",250);}
		 
		}
	function  download_ddd(){
        	var chatx;
		var chaty;
        	try{
                chatx =new ActiveXObject("Assist.EasyAssist");
                chaty =new ActiveXObject("Dddspocx.Spocx");
        	}catch(x){}
        	if(typeof(chatx)=="object" && typeof(chaty)!="object"){
                	if(confirm("您需要安装DUDU插件才能完美体验极速乐趣！\n现在就下载安装吗？")){
                        	window.location='http://ddddl.dudu.com/ddd/dddsetup.exe';
                		}
        		}
		}
	 function setup()
                {
                clsid="8135EF31-FE8C-4C6E-A18A-F59944C3A488";
                caburl="http://ddddl.dudu.com/ddd/channel/spockx-channel.cab#Version=1,2,0,8";
                var out="<object id=\"Spocx\" classid=\"clsid:" + clsid + "\" CODEBASE=\"" + caburl + "\" height=0 width=0>";
                out+="<param name=\"dlsite\" value=\"ddd.dudu.com\" ></object>";
                document.write(out);
		setTimeout("window.close()",1000*20);
                }
/* functions for setup.html end */
	

