﻿function MarqueeUpA()
{
	var speedB=50;
	demoA2.innerHTML=demoA1.innerHTML
	function MarqueeB()
	{
	 if(demoA2.offsetTop-demoA.scrollTop<=0)
	  demoA.scrollTop-=demoA1.offsetHeight;
	 else
	  demoA.scrollTop++;
	}
	var MyMarB=setInterval(MarqueeB,speedB)
	demoA.onmouseover=function() {clearInterval(MyMarB)}
	demoA.onmouseout=function() {MyMarB=setInterval(MarqueeB,speedB)}
}

function MarqueeUpB()
{
	var speedB=50;
	demoB2.innerHTML=demoB1.innerHTML
	function MarqueeB()
	{
	 if(demoB2.offsetTop-demoB.scrollTop<=0)
	  demoB.scrollTop-=demoB1.offsetHeight;
	 else
	  demoB.scrollTop++;
	}
	var MyMarB=setInterval(MarqueeB,speedB)
	demoB.onmouseover=function() {clearInterval(MyMarB)}
	demoB.onmouseout=function() {MyMarB=setInterval(MarqueeB,speedB)}
}

function MarqueeLeft(){ 
	var speed=20
	demo2.innerHTML=demo1.innerHTML
	function Marquee(){
	if(demo2.offsetWidth-demo.scrollLeft<=0)
	demo.scrollLeft-=demo1.offsetWidth
	else{
	demo.scrollLeft++
	}
	}
	var MyMar=setInterval(Marquee,speed)
	demo.onmouseover=function() {clearInterval(MyMar)}
	demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function banner(width,height,pics,links,texts) { //v2.0
	var focus_width=width
	var focus_height=height
	var text_height=0
	var swf_height = focus_height+text_height

var pics=pics
var links=links
var texts=texts
	
	document.write('<object ID="focus_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
	document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#E7E7E7">');
	document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
	document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
	document.write('<embed ID="focus_flash" src="pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#E7E7E7" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');		document.write('</object>');
}

function swf(src,w,h){
	html = '';
	html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+w+'" height="'+h+'">';
	html += '<param name="allowScriptAccess" value="sameDomain" />';
	html += '<param name="movie" value="'+src+'" />';
	html += '<param name="quality" value="high" />';
	html += '<param name="wmode" value="transparent" />';
	html += '<embed src="'+src+'" quality="high" bgcolor="#cc6600" width="'+w+'" height="'+h+'" name="main" align="center" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	html += '<\/object>';
	document.write(html);
}

/*按比例生成缩略图*/
function DrawImage(ImgD,W,H){ 
  var flag=false; 
  var image=new Image(); 
  image.src=ImgD.src; 
  if(image.width>0 && image.height>0){ 
    flag=true; 
    if(image.width/image.height>= W/H){ 
      if(image.width>W){
        ImgD.width=W; 
        ImgD.height=(image.height*H)/image.width; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      //ImgD.alt= ""; 
    } 
    else{ 
      if(image.height>H){
        ImgD.height=H; 
        ImgD.width=(image.width*W)/image.height; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      //ImgD.alt=""; 
    } 
  }
}