﻿
//QQ
function openQQ(qqcode)
{
	var qqwindow=window.open('tencent://message/?Menu=yes&uin='+qqcode);
	
	setTimeout(function(){qqwindow.close()},2000);

}

//FLASH
function insertFlash(elm, url, w, h)
{
	if (!document.getElementById(elm)) return;
	var str = '';
	str += '<object width="'+ w +'" height="'+ h +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">';
	str += '<param name="movie" value="'+ url +'">';
	str += '<param name="wmode" value="opaque">';
	str += '<param name="quality" value="autohigh">';
	str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
	str += '</object>';
	document.getElementById(elm).innerHTML = str;
}

//pic roll
function Roll(room,m1,m2,height,width,speed,type)
{
        var r=document.getElementById(room);
        var z1=document.getElementById(m1);
        var z2=document.getElementById(m2);        
        type=(type=="")?"u":type;//u:向上;d:向下;l:向左;r:向右        
        speed=(speed=="")?"50":speed;
		z2.innerHTML=z1.innerHTML;
		with(r)
		{
		    noWrap=true; //这句表内容区不自动换行
		    style.width=width; //于是我们可以将它的宽度设为0，因为它会被撑大
		    if(height!=0)
		    {
		        style.height=height;
		    }
		    style.overflowX="hidden"; //滚动条不可见			
		}
		function Marquee()
		{		
		    switch(type)
		    {
		        case "u":
			        if(z2.offsetHeight-r.scrollTop<=0)
			        {					
				        r.scrollTop-=z1.offsetHeight;
			        }
			        else
			        {					
				        r.scrollTop++;
			        }
			    break;
			    case "d":
			        if(r.scrollTop<=0)
			        {			            
				        r.scrollTop=z2.offsetHeight;				        
			        }
			        else
			        {					
				        r.scrollTop--;
			        }
			    break;
			    case "l":
			        if(z2.offsetWidth-r.scrollLeft<=4)
				    {
					    r.scrollLeft-=z1.offsetWidth
				    }
				    else
				    {
					    r.scrollLeft=r.scrollLeft+1;
				    }
			    break;
			    case "r":
			        if(z2.offsetWidth-r.scrollLeft<=4)
				    {
					    r.scrollLeft-=z1.offsetWidth
				    }
				    else
				    {
					    r.scrollLeft=r.scrollLeft+1;
				    }
			    break;			    
			}
		};
		var Time=setInterval(Marquee,speed);				
		r.onmouseover=function() 
		{		    
			clearInterval(Time);
		};
		r.onmouseout=function() 
		{
			Time=setInterval(Marquee,speed);
		}    
} 


/*加入收藏*/
function addBookmark(title)
{
    var url=parent.location.href;
    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;
    }
}