﻿function openpage(url,width,height){
    left=(screen.width-width)/2;
	top2=(screen.height-height)/2-30;
    window.open(url,"","scrollbars=no,left="+left+",top="+top2+",height="+height+",width="+width);
}

function swf(name,width,height,transparent){
    document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>");
    document.write("<param name='movie' value='"+name+"'>");
    document.write("<param name='quality' value='high'>");
    document.write("<param name='menu' value='false'>");
    if(transparent==1) document.write("<param name='wmode' value='transparent'>");
    document.write("<embed src='"+name+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed>");
    document.write("</object>");
}

function DrawImage(ImgD,w,h){
   xwidth=w;
   xheight=h;
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= xwidth/xheight){
     if(image.width>xwidth){  
     ImgD.width=xwidth;
     ImgD.height=(image.height*xwidth)/image.width;
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }

     }
    else{
     if(image.height>xheight){  
     ImgD.height=xheight;
     ImgD.width=(image.width*xheight)/image.height;     
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }

     }
    }
}

function switchMenu(curr_id, total_num) {
		  var el = document.getElementById('submenu'+curr_id);
		  var btbg = document.getElementById('mainmenu'+curr_id);
		  var txt = document.getElementById('maintext'+curr_id);  
		  if(!el) return;          //一级菜单前面的图片               
		     if(el.style.display =="block"){
			    el.style.display = "none";
			    btbg.className="bt1";
			    txt.style.color="#ffffff";
		     }
			 else{
		        el.style.display = "block";
		        btbg.className="bt2";
			    txt.style.color="#ffff00";
		     }
     /*
     for(var i=1; i<=total_num; i++)
	 {         //二级菜单     
		  var el = document.getElementById('submenu'+i);
		  var btbg = document.getElementById('mainmenu'+i);
		  var txt = document.getElementById('maintext'+i);  
		  if(!el) return;          //一级菜单前面的图片      
		  if(i == curr_id)         
		  {             
		     if(el.style.display =="block"){
			    el.style.display = "none";
			    btbg.className="bt1";
			    txt.style.color="#ffffff";
		     }
			 else{
		        el.style.display = "block";
		        btbg.className="bt2";
			    txt.style.color="#ffff00";
		     }
		  }
		  else{
		    el.style.display = "none";
		    btbg.className="bt1";
			txt.style.color="#ffffff";
		  }
	 }
	 */
	 
}/*<a href="http://xmcyberpolice.cn/alert.asp" target=_blank><img src="http://xmcyberpolice.cn/image/gt.gif" width  ="30" border='0'></a>*/