/*---------------------------------------------------------------
//
// 档案名称：functions.js
// 原创作者：lslxhx
// 作者邮件：lslxhx@hotmail.com
// 创建日期：星期四，2008年01月03日 01:31:20
// 版权所有(C)StarsNetSoft
//--------------------------------------------------------------*/

// +++++++++++++  设为首页和将网址加入到收藏夹 ++++++++
//设为首页Example
//<span onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.starsnetsoft.com');" style="CURSOR: hand">设为首页</span>
//加入到收藏夹Example
 //<span onClick="AddFavorites('http://www.starsnetsoft.com','星辰网软工作室');" style="CURSOR: hand">加入收藏</span>
 function AddFavorites(url,urlname){
	window.external.AddFavorite(url,urlname);
 }
 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
// +++++++++++++  ReloadUrl(url) ++++++++
//页面重新载入代码
// Example 
// DocumentWrite(MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
function ReloadUrl(url){	
	window.location.href=url;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
// +++++++++++++  MakeFlashString(source,id,width,height,wmode) ++++++++
//嵌入Flash脚本代码
// Example 
// DocumentWrite(MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
// SetInnerHTML(document.all.mm, MakeFlashString('image/ml_flash.swf','emb1','330','520','opaque'));
function MakeFlashString(source,id,width,height,wmode, otherParam){	
	return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0\" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" /><param name=movie value="+source+" /><param name=quality value=high />"+otherParam+"<embed src="+source+" quality=high wmode="+wmode+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+width+" height="+height+"></embed></object>";
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// +++++++++++++  MakeObjectString(classid, codebase, name, id, width,height, param) ++++++++
function MakeObjectString(classid, codebase, name, id, width,height, param){
	return "<object classid="+classid+" codebase="+codebase+" name="+name+" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" />"+param+"</object>";
}


// innerHTML Type
function SetInnerHTML(target, code){ 
	target.innerHTML = code; 
}


// Direct Write Type
function DocumentWrite(src){
	document.write(src);
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// +++++++++++++  playFlash(soource,width,height,name,'transparent','true') ++++++++
//Example
//playFlash('/korean/image/flash/logo.swf?mNum=&sNum=','200','56','test','transparent','true')
function playFlash(filename,width,height,id,trans,lock) {
document.write('<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="'+width+'" height="'+height+'" id="'+id+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="movie" value="'+filename+'" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="wmode" value="'+trans+'" /><param name="menu" value="'+lock+'" /><embed src="'+filename+'" quality="high" bgcolor="#ffffff" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>')
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// +++++++++++++ MM_swapImage('图片名称','','目标图片路径',1)  ++++++++
//Example
//<a href="/help.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('top_menu03','','/image/contact_on.gif',1)"><img src="/image/contact.gif" name="top_menu03" border="0"></a>
function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; 
	document.MM_sr=new Array; 
	for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){
		document.MM_sr[j++]=x; 
		if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
	}
}

// +++++++++++++ MM_swapImgRestore()  ++++++++
function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){
	if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
	for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){
			d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];
		}
	}
}

function MM_findObj(n, d) { //v4.0
	var p,i,x;  if(!d) d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && document.getElementById) x=document.getElementById(n); 
	return x;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// +++++++++++++ MM_jumpMenu('parent',this,0)  ++++++++
//跳转菜单脚本代码
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// +++++++++++++ selectIt(types,frm)  ++++++++
//Example
//全 选<input type="checkbox" name="selectAll" value="checkbox" onClick="selectIt('selectAll','myform')">反 选 <input type="checkbox" name="invest" value="checkbox" onClick="selectIt('','myform')">
function selectIt(action,frm){ 
    var testform=document.getElementById(frm); 
    for(var i=0 ;i<testform.elements.length;i++){ 
        if(testform.elements[i].type=="checkbox"){ 
            e=testform.elements[i]; 
            e.checked=(action=="selectAll")?1:(!e.checked); 
        } 
    }     
} 
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// +++++++++++++ openWin(url, name, w, h)  ++++++++
//
function openWin(url, name, w, h)
{
	window.open(url, name, 'width='+w+',height='+h+',resizable=no,scrollbars=yes');
}

function lay(con) {
  sh.style.visibility='visible';
   // sh1.innerText = con; 
  sh1.innerHTML = con;  
  sh.style.pixelLeft = document.body.scrollLeft+event.x+10; 
  sh.style.pixelTop = document.body.scrollTop+event.y-40;
}
function layon(con) {
  sh.style.visibility='visible';
   // sh1.innerText = con; 
  sh1.innerHTML = con;  
  sh.style.pixelLeft = document.body.scrollLeft+event.x+5; 
  sh.style.pixelTop = document.body.scrollTop+event.y-120;
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// +++++++++++++ openWin(url, name, w, h)  ++++++++
//
function switchBar(){
  if (switchPoint.innerText==3){
    switchPoint.innerText=4
	document.all("leftFrame").style.display="none"
  }else{
	switchPoint.innerText=3
	document.all("leftFrame").style.display=""
  }
}
