    rnd.today=new Date(); 
    rnd.seed=rnd.today.getTime(); 
    function rnd() 
    { 
　　　　rnd.seed = (rnd.seed*9301+49297) % 233280; 
　　　　return rnd.seed/(233280.0); 
    }
    function rand(number) 
    { 
　　　　return Math.ceil(rnd()*number); 
    } 
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/* 旧函数，已废弃*/
function createFlashIM(baseURL,DataURL)
{
	intWidth=84;
	intHeight=34;
    //--------------------
	document.write('<div style="z-index:10100; width:'+intWidth+'px;height:'+intHeight+'px;overflow:hidden;">');
	document.write('<div style="z-index:10200; left: 0px;">');
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" WIDTH="'+intWidth+'" HEIGHT="'+intHeight+'">');
	
	document.write('<param name=movie value="'+baseURL+'/Chat/images/OpenIM.swf?loadURL='+DataURL+'">');	
	
    document.write('<param name=wmode value=transparent>');
    document.write('<param name=quality VALUE=high>');
    document.write('<param name=allowScriptAccess VALUE=always>');
    document.write('<embed quality=high wmode="transparent" src="'+baseURL+'/Chat/images/OpenIM.swf" bgcolor=#FFFFFF WIDTH='+intWidth+' HEIGHT='+intHeight+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
    document.write('</embed>');
    document.write('</object>');
	document.write('</div>');
	document.write('<div style="position: relative; z-index:10300; top:-36px;width:'+intWidth+'px;height:'+intWidth+'px;">');
	document.write('<img src="'+baseURL+'/images/blank.gif" width='+intWidth+' height='+intHeight+' onclick="javascript:ShowDialogIM()" style="cursor:hand;" />');
	document.write('</div>');
    document.write('</div>');
} 

//--新函数，将会取代createFlashIM()--------------------------------------------------------------------------------------------------------------------

function createFlashIM_new(baseURL,DataURL){
    var intWidth=1;
	var intHeight=1;
    document.write('<div style="z-index:10200; left: 0px;">');
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" WIDTH="'+intWidth+'" HEIGHT="'+intHeight+'">');
	
	document.write('<param name=movie value="'+baseURL+'/Chat/images/im_contact.swf?loadURL='+DataURL+'">');	
	
    document.write('<param name=wmode value=transparent>');
    document.write('<param name=quality VALUE=high>');
    document.write('<param name=allowScriptAccess VALUE=always>');
    document.write('<embed allowScriptAccess=always quality=high wmode="transparent" src="'+baseURL+'/Chat/images/im_contact.swf?loadURL='+DataURL+'" bgcolor=#FFFFFF WIDTH='+intWidth+' HEIGHT='+intHeight+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
    document.write('</embed>');
    document.write('</object>');
	document.write('</div>');
	
}

//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function createEnFlashSms(intWidth,intHeight)
{
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" WIDTH="'+intWidth+'" HEIGHT="'+intHeight+'">');
	document.write('<param name=movie value="http://Chat.mainone.com/Chat/images/OpenEnSms.swf">');
    document.write('<param name=wmode value=transparent>');
    document.write('<param name=quality VALUE=high>');
    document.write('<param name=allowScriptAccess VALUE=always>');
    document.write('<embed quality=high wmode="transparent" src="http://Chat.mainone.com/Chat/images/OpenEnSms.swf" bgcolor=#FFFFFF WIDTH='+intWidth+' HEIGHT='+intHeight+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
    document.write('</embed>');
    document.write('</object>');
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
function showIMDLG(strURL){
    window.open(""+strURL+"","短信洽谈室","left=200,top=200,width=566,height=471,menubar=no,toolbar=no,dependent=yes,chrome=yes,modal=yes");
}
//--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
var  lastScrollY=0; 
 function initAd() 
{
    if(document.getElementById("AdLayer") == null || typeof(document.getElementById("AdLayer")) == "undifined")
    {return;}
    document.getElementById("AdLayer").style.posTop = -100;
    document.getElementById("AdLayer").style.visibility = 'visible';     
    MoveLayer('AdLayer');
}
function scrollIt()
{
           var object =  document.getElementById("AdLayer");
            diffY=document.documentElement.scrollTop;
            diffH = object.style.posTop;
            percent=.3*(diffY-lastScrollY);
            if(percent>0)percent=Math.ceil(percent);
            else percent=Math.floor(percent);
            alert(diffH+diffY);
            object.style.top=diffH+diffY;
            lastScrollY=lastScrollY+percent;
           
}
function MoveLayer(layerName) 
{
    var x = 1;
    var y = 150;        
    var diff = (document.body.scrollTop + y - document.getElementById("AdLayer").style.posTop)*.40;
    y = document.documentElement.scrollTop + y; //- diff;
    eval("document.getElementById('" + layerName + "').style.posTop = y");
    eval("document.getElementById('" + layerName + "').style.posLeft = x");        
    setTimeout("MoveLayer('AdLayer');", 20);
}