﻿var EAdService = {};
EAdService.Content = {};
EAdService.Get = function(oID){return EAdService.Content[oID] || "not set ad";}
EAdService.Set = function(oID,value){EAdService.Content[oID]=value;}
EAdService.Call = function(oID){
	if (typeof(EAdService.Content[oID]) == 'function')
	{
		EAdService.Content[oID]();
		return;
	}
	return EAdService.Content[oID];
}
//create by xuxin
function ChangeADS(Img1,URL1,Img2,URL2,objName,width,height)
{
var FP=new myFlash("http://gg2.homev.cn/bj/Files/Public/flipper.swf",(width || 146),(height || 90));
FP.addParam("bgcolor", "#FFFFFF");
FP.addParam("quality", "High");
FP.addParam("allowScriptAccess", "always");
FP.addParam("menu", "false");
FP.addParam("wmode", "transparent");
FP.addVars("ad_num", "2");
FP.addVars("pic_width", (width || 146) - 6);
FP.addVars("pic_height", (height || 90) - 6);
FP.addVars("flip_time", "300");
FP.addVars("pause_time", "2000");
FP.addVars("wait_time", "2000");
FP.addVars("pics", Img1);
FP.addVars("urls", escape(URL1));
FP.addVars("def_pic", Img2);
FP.addVars("def_link", escape(URL2));
return FP.toObject(objName);
}
document.write('<style type="text/css">');
document.write('.ardleft{width:150px;height:85px;float:left}');
document.write('.ardce{width:580px;height:85px;float:left;margin-left:7px}');
document.write('.anright{width:150px;height:85px;float:right}');
document.write('</style>');
var showad = true;
var Toppx = 30;     //上端位置
var AdDivW = 100;    //宽度
var AdDivH = 230;    //高度
var PageWidth = 1024; //页面多少宽度象素下正好不出现左右滚动条
var MinScreenW = 1024; //显示广告的最小屏幕宽度象素

var dunlianArray = new Array();

function init_dunlian(){
	
	if (dunlianArray.length == 0) return;
	if (window.screen.width<MinScreenW) return;
	
	var Borderpx = ((window.screen.width-PageWidth)/2-AdDivW)/2;
Borderpx  = 10;
	var top = document.body.scrollTop+Toppx;
	var left = document.body.scrollLeft+Borderpx;
	var leftr = document.body.scrollLeft+document.body.clientWidth-AdDivW-Borderpx;
	
	/*
document.getElementById("javascript.LeftDiv").style.display="";
document.getElementById("javascript.LeftDiv").style.top=document.body.scrollTop+Toppx;
document.getElementById("javascript.LeftDiv").style.left=document.body.scrollLeft+Borderpx;
document.getElementById("javascript.RightDiv").style.display="";
document.getElementById("javascript.RightDiv").style.top=document.body.scrollTop+Toppx;
document.getElementById("javascript.RightDiv").style.left=document.body.scrollLeft+document.body.clientWidth-document.getElementById("javascript.RightDiv").offsetWidth-Borderpx;*/
	
	
	
	
	var ClosebuttonHtml;
	var span = document.createElement('span');
	var html = "";
	var ul,ur;
	
	
	for(var i=0;i<dunlianArray.length;i++)
	{
		ClosebuttonHtml = '<div align="right" style="position: absolute;top:0px;right:0px;margin:2px;padding:2px;z-index:2000;"><a href="javascript:;" onclick="hidead('+i+')" style="color:red;text-decoration:none;font-size:12px;">关闭</a></div>';
	
		html += '<div id="javascript.LeftDiv'+ i +'" style="position: absolute;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:'+ ((top + AdDivH) * i + top) +'px;left:'+left+'px;word-break:break-all;">'+ClosebuttonHtml+'<div><embed height="'+AdDivH+'" width="'+AdDivW+'" wmode="opaque" bgcolor="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="High" src="'+dunlianArray[i][0]+'" name="tomdl_rel'+ i +'_l"/></div></div>';
		
		html += '<div id="javascript.RightDiv'+ i +'" style="position: absolute;z-index:1000;width:'+AdDivW+'px;height:'+AdDivH+'px;top:'+ ((top + AdDivH) * i + top) +'px;left:'+leftr+'px;word-break:break-all;">'+ClosebuttonHtml+'<div><embed height="'+AdDivH+'" width="'+AdDivW+'" wmode="opaque" bgcolor="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="High" src="'+dunlianArray[i][1]+'" name="tomdl_rel'+ i +'_r"/></div></div>';
		
	}
	span.innerHTML = html;
	
	document.body.appendChild(span);

/*background-color:#EEEEE2;*/

}


function hidead(i)
{
	showad = false;
		document.getElementById("javascript.LeftDiv" + i).style.display="none";
		document.getElementById("javascript.RightDiv" + i).style.display="none";
	/*for(var i=0;i<adArray.length;i++)
	{
		document.getElementById("javascript.LeftDiv" + i).style.display="none";
		document.getElementById("javascript.RightDiv" + i).style.display="none";
	}*/
}
//window.onscroll=scall;
//window.onresize=scall;
//window.onload=scall;

EAdService.Content['ggv201']=function(){
new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv201/PV1Left01.swf",960,100).toObject("ggv201");
}
;
EAdService.Content['ggv202']=function(){
new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv202/PV1Left01.swf",960,100).toObject("ggv202");
}
;
EAdService.Content['ggv203']=function(){
new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv203/PV1Left01.swf",960,100).toObject("ggv203");
}
;
EAdService.Content['ggv301']=function(){
document.write('<div id="ad:001" class="ardleft2" style="text-algin:center;margin-left:-4px;"></></div>');
ChangeADS("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv301/tyc1.jpg","http://gg2.homev.cn/BJ/GO.aspx?to=84","http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv301/tyc2.jpg","http://gg2.homev.cn/BJ/GO.aspx?to=84","ad:001",170,95);
};
EAdService.Content['ggv302']=function(){
	document.write('<div id="ggv302" class="ardce2" style="text-algin:center;margin-left:14px;margin-right:7px;width:600px;"></div>');
var player = new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv302/shouye1028.swf","600", "90", "9");
player.addParam("wmode","transparent");  
player.toObject("ggv302");
};
EAdService.Content['ggv303']=function(){
	document.write('<div id="ggv303" class="anright2"></div>');
	ChangeADS("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv303/70901.jpg","http://gg2.homev.cn/tongji/gg.aspx?id=W03A","http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv303/70902.jpg","http://gg2.homev.cn/tongji/gg.aspx?id=W03A","ggv303",170,95);
};
EAdService.Content['ggv304']=function(){
new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv304/shouye2.swf",630,100).toObject("ggv304");
}
;
EAdService.Content['ggv305']=function(){
	new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv305/327x100.swf",327,100).toObject("ggv305");
};
EAdService.Content['ggv306']=function(){
new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv306/hb.swf",630,100).toObject("ggv306");
};
EAdService.Content['ggv307']=function(){
	new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv307/3.0.swf",327,100).toObject("ggv307");
};
EAdService.Content['ggv308']=function(){
new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv308/jjdj.swf",630,100).toObject("ggv308");
};
EAdService.Content['ggv309']=function(){
	new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv309/3271.swf",327,100).toObject("ggv309");
};
EAdService.Content['ggv3010']=function(){
dunlianArray[dunlianArray.length] = new Array( 
	'http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv3010/left.swf',
	'http://gg2.homev.cn/BJ/Files/Items/Index/Index/ggv3010/right.swf'
 );
 
 
/*dunlianArray[dunlianArray.length] = new Array( 
	'http://res.homevcache.com/www/v2_8/flash/left.swf',
	'http://res.homevcache.com/www/v2_8/flash/right.swf'
 );
*/
init_dunlian();};
EAdService.Content['gg3011']=function(){

document.write('<div id="gg3011" class="w970"></div>');
new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/gg3011/OSCAR970x60.swf",970,60).toObject("gg3011");

};
EAdService.Content['newtop']= function(){
    var imag=new Array();
    var link=new Array();
    var text=new Array();
    //imag[1]="http://gg2.homev.cn/BJ/Files/Items/Index/Index/newtop/index1.jpg";
    //link[1]="http://gg2.homev.cn/tongji/gg.aspx?id=W01A";
    //text[1]="ads";
    imag[1]="http://gg2.homev.cn/BJ/Files/Items/Index/Index/newtop/index6.jpg";
    link[1]="http://gg2.homev.cn/tongji/gg.aspx?id=W07A";
    text[1]="ads";
    imag[2]="http://gg2.homev.cn/BJ/Files/Items/Index/Index/newtop/index3.jpg";
    link[2]="http://gg2.homev.cn/tongji/gg.aspx?id=W02A";
    text[2]="ads";
    //imag[4]="http://gg2.homev.cn/BJ/Files/Items/Index/Index/newtop/index2.jpg";
    //link[4]="http://gg2.homev.cn/tongji/gg.aspx?id=W03A";
    //text[4]="ads";
    imag[3]="http://gg2.homev.cn/BJ/Files/Items/Index/Index/newtop/index4.jpg";
    link[3]="http://gg2.homev.cn/tongji/gg.aspx?id=W04A";
    text[3]="ads";
    imag[4]="http://gg2.homev.cn/BJ/Files/Items/Index/Index/newtop/index5.jpg";
    link[4]="http://gg2.homev.cn/tongji/gg.aspx?id=W05A";
    text[4]="ads";
    //imag[6]="http://gg2.homev.cn/BJ/Files/Items/Index/Index/newtop/index6.jpg";
    //link[6]="http://zt.bj.homev.cn/2009/ts/wuye.aspx";
    //text[6]="ads";


   var pics="", links="", texts="";
    for(var i=1; i<imag.length; i++){
	    pics=pics+("|"+imag[i]);
	    links=links+("|"+link[i]);
	    texts=texts+("|"+text[i]);
    }
    pics=pics.substring(1);
    links=links.substring(1);
    texts=texts.substring(1);

	document.write('<span id="ad_f__anban"></span>');


	var focus_width=970;
    	var focus_height=180;
	var player = new myFlash("http://lib.homevcache.com/player/focus/focus.swf",focus_width, focus_height, "9");
	player.addAttrib("id","player_cont_ad");
	player.addParam("wmode","transparent");
	player.addVars("pics",pics);
	player.addVars("links",links);
	player.addVars("texts",texts);
	player.addVars("borderwidth",focus_width);
	player.addVars("borderheight",focus_height);
	player.addVars("textheight","0");
	player.toObject("ad_f__anban");
	//document.getElementById('player_cont_ad').TSetProperty("border",1,1000);
};
EAdService.Content['index1']=function(){
 document.write('<div id="index1" class="ad2"></div>');
 new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/index1/index1.swf",675,100).toObject("index1");
};
EAdService.Content['index2']=function(){
 document.write('<div id="index2" class="ad2"></div>');
 new myFlash("http://gg2.homev.cn/BJ/Files/Items/Index/Index/index2/index02.swf",675,100).toObject("index2");
};
