// JavaScript Document



var minwidth=780;//页面实际宽度，ff用
//获取ID
function ShowMsg(){
		
	document.writeln("<div id=\"msgdiv\" style=\"position:absolute;display:none;\"><\/div>");
	document.writeln("<div id=\"overdiv\" style=\"position:absolute;display:none;\">");
	document.writeln("<\/div>");
	//回调函数
	this.ok_callback=function(){};
	this.cancel_callback=function(){};
	this.msgobjname="";
	this.show=function(type,url,title){ //类型，图片链接，标题
		so.addParam("wmode", "transparent");
		is_flash_touming = 1;
		flagshow=true;
		var tempobj1=$id("msgdiv");
		var tempobj2=$id("overdiv");
		var msgobj=this.msgobjname;
		/*页面遮照*/
  		tempobj2.style.filter="alpha(opacity=75)";//ie透明
  		tempobj2.style.opacity = 75/100;//css3透明
    	tempobj2.style.backgroundColor = "#000000";
	  	tempobj2.style.display = '';
    	tempobj2.style.zIndex= 100;	
		tempobj2.style.left=0;
		tempobj2.style.top=0;

		if(document.documentElement.scrollHeight>1020) {	
			tempobj2.style.height=document.documentElement.scrollHeight+"px";
		}else{
			tempobj2.style.height="1020px";
		}

		if(document.documentElement.clientWidth>minwidth){
			tempobj2.style.width= document.documentElement.clientWidth +"px";
		}else{
			tempobj2.style.width= minwidth +"px";
		}
		
		/*div*/	
	if(type==2) {
		/*div*/		
		tempobj1.style.display="none";
		tempobj1.style.left= (document.documentElement.clientWidth)/2-350+"px";		
		tempobj1.style.top= (document.documentElement.scrollTop+(document.documentElement.clientHeight)/20)+"px";
		tempobj1.style.display= '';
		tempobj1.style.zIndex= 200;
		
		/*div样式	*/	
		var OutStr;
		OutStr='<div id="pic_BO">  <table width="700" border="0" cellspacing="0" cellpadding="0">    <tr>      <td width="700" height="104" align="center" valign="top"><table width="700" border="0" cellspacing="0" cellpadding="0">        <tr>          <td width="6" height="10"></td>          <td height="10"></td>          <td width="6" height="10"></td>        </tr>        <tr>          <td>&nbsp;</td>          <td height="20" align="right"><a href="javascript:ShowMsgo.ok();"><img src="'+siteurl+'images/News_close.jpg" width="20" height="20" border="0" /></a></td>          <td>&nbsp;</td>        </tr>        <tr>          <td>&nbsp;</td>          <td height="74">&nbsp;</td>          <td>&nbsp;</td>        </tr>      </table></td>    </tr>    <tr>      <td width="700" height="190" valign="top" bgcolor="#0054A7"><table width="700" border="0" cellspacing="0" cellpadding="0">        <tr>          <td height="30" colspan="4">&nbsp;</td>          </tr>        <tr>          <td width="83" rowspan="3">&nbsp;</td>         <td width="120" height="160" rowspan="3"><img src="'+siteurl+'images/BO_Hakon.jpg" width="120" height="160" /></td>          <td width="18" height="160" rowspan="3">&nbsp;</td>          <td height="90">&nbsp;</td>        </tr>        <tr>          <td height="30"><font class="Business_name">Mr. Hakon Rydland</font><br>            <font class="Business_name1">Executive Vice President </font><br></td>        </tr>        <tr>          <td></td>        </tr>      </table></td>    </tr>    <tr>     <td width="700" height="186" valign="top" background="'+siteurl+'images/Business_bg.jpg"><table width="700" border="0" cellspacing="0" cellpadding="0">        <tr>          <td width="82" height="16"></td>          <td></td>        </tr>        <tr>          <td>&nbsp;</td>          <td><font class="Business_address1">Address  :  No. 5369 Middle Jiasong Road, Zhaoxiang, Shanghai, China 201704<br>E-mail      : </font><a href="mailto:hakon.rydland@jswb.com"  class="Business_address"target="_blank">hakon.rydland@jswb.com</a><br><font class="Business_address1">Fax            :  +86-21-6975 5566</font><br></td>        </tr>        <tr>          <td>&nbsp;</td>          <td>&nbsp;</td>        </tr>      </table></td>    </tr>  </table></div>';
	
	}else if(type==9) {
		tempobj1.style.display="none";
    	tempobj1.style.left= (document.documentElement.clientWidth)/2-400+"px";		
    	tempobj1.style.top= (document.documentElement.scrollTop+(document.documentElement.clientHeight)/20)+"px";
		tempobj1.style.display= '';
    	tempobj1.style.zIndex= 200;
		
		/*div样式	*/	
    	var OutStr;
		OutStr='<div id="pic_pro"><table width="1020" border="0" cellspacing="0" cellpadding="0">  <tr>    <td colspan="3"></td>  </tr>  <tr>    <td width="1020" height="15" colspan="3"></td>  </tr>  <tr>    <td width="10">&nbsp;</td>    <td width="1000"><table width="1000" border="0" cellspacing="0" cellpadding="0">      <tr>        <td width="980" height="20" class="news_PIC_pro">'+title+'</td>        <td width="20" height="20" align="right"><a href="javascript:ShowMsgo.ok();"><img src="'+siteurl+'images/News_close.jpg" width="20" height="20" border="0" /></a></td>      </tr>    </table></td>    <td width="10">&nbsp;</td>  </tr>  <tr>    <td width="1020" height="14" colspan="3"></td>  </tr>  <tr>    <td colspan="3"><table width="1020" border="0" cellspacing="0" cellpadding="0">      <tr>        <td width="10">&nbsp;</td>        <td><img src="'+url+'" width="1000" height="775" /></div></td>        <td width="10">&nbsp;</td>      </tr>    </table></td>  </tr>  <tr>    <td width="1020" height="11" colspan="3"></td>  </tr></table></div>';
	
	}else{
		tempobj1.style.display="none";
    	tempobj1.style.left= (document.documentElement.clientWidth)/2-400+"px";		
    	tempobj1.style.top= (document.documentElement.scrollTop+(document.documentElement.clientHeight)/20)+"px";
		tempobj1.style.display= '';
    	tempobj1.style.zIndex= 200;
		
		/*div样式	*/	
    	var OutStr;
		OutStr='<div id="pic"><table width="780" border="0" cellspacing="0" cellpadding="0">  <tr>    <td colspan="3"></td>  </tr>  <tr>    <td width="780" height="15" colspan="3"></td>  </tr>  <tr>    <td width="10">&nbsp;</td>    <td width="760"><table width="760" border="0" cellspacing="0" cellpadding="0">      <tr>        <td width="740" height="20" class="news_PIC">'+title+'</td>        <td width="20" height="20" align="right"><a href="javascript:ShowMsgo.ok();"><img src="'+siteurl+'images/News_close.jpg" width="20" height="20" border="0" /></a></td>      </tr>    </table></td>    <td width="10">&nbsp;</td>  </tr>  <tr>    <td width="780" height="14" colspan="3"></td>  </tr>  <tr>    <td colspan="3"><table width="780" border="0" cellspacing="0" cellpadding="0">      <tr>        <td width="10">&nbsp;</td>        <td><img src="'+url+'" width="760" height="570" /></div></td>        <td width="10">&nbsp;</td>      </tr>    </table></td>  </tr>  <tr>    <td width="780" height="11" colspan="3"></td>  </tr></table></div>';
	}
    	tempobj1.innerHTML=OutStr;
		
		//点击周围遮照也取消
		tempobj2.style.cursor='pointer';
		tempobj2.onclick=function(){ShowMsgo.ok();};		

	}
	this.ok = function()
	{
		flagshow=false;
		$id('msgdiv').style.display='none';
		$id('overdiv').style.display='none';
		this.ok_callback();
	}
	this.cancel=function(){
		flagshow=false;
		$id('msgdiv').style.display='none';
		$id('overdiv').style.display='none';
		this.cancel_callback();
	}
}

var ShowMsgo=new ShowMsg();
//设置对象名,供内部引用
ShowMsgo.msgobjname="ShowMsgo";
//定义回调函数
ShowMsgo.ok_callback=function(){
	//alert("ok");
	}
ShowMsgo.cancel_callback=function(){
	//alert("cancel")
	}

var flagshow=false;	
var flag=true;


//窗口大小改变时，同时改变遮照和div
function resize() 
{ 
	if(flagshow)
	{
		var tempobj1=$id("msgdiv");
		var tempobj2=$id("overdiv");
		tempobj2.style.height=document.documentElement.scrollHeight+"px";	
		if(typeof_browser()==0){
    	    tempobj2.style.width= document.documentElement.scrollWidth+"px";
		}else{
			if(document.documentElement.clientWidth>minwidth){
			    tempobj2.style.width= document.documentElement.clientWidth +"px";
			}else{
				tempobj2.style.width= minwidth +"px";
			}
			
		}
		
    	tempobj1.style.left= (document.documentElement.clientWidth)/2-400+"px";
    	tempobj1.style.top= (document.documentElement.scrollTop+(document.documentElement.clientHeight)/10)+"px";
		
	}
}