function Obj(objName){if(document.getElementById)return eval('document.getElementById("' + objName + '")');else if(document.layers) return eval("document.layers['" + objName +"']");else return eval('document.all.' + objName);}
//清除正在加载
function Clear(menu)
{
    if(menu){document.getElementById("Dh"+menu).className="set"}
    var sets=document.getElementById("sponsorAdDiv");if(sets!=null)sets.style.display="none";
}
//若是北京，则某些导航显示，否则不显示
function DisplayByBJ(i,j,k,cityid)
{
   if(cityid=="1")
   {
       document.getElementById("Dh"+i).style.display="block";
       document.getElementById("Dh"+j).style.display="block";
       document.getElementById("Dh"+k).style.display="block";
   }
   else
   {
       document.getElementById("Dh"+i).style.display="none";
       document.getElementById("Dh"+j).style.display="none";
       document.getElementById("Dh"+k).style.display="none";
   }
}
function checklogin(formobj)
{
    if(formobj.username.value=="")
    {
        ShowAlert(3,"","用户名不能为空！","");return false;
    }
     if(formobj.password.value=="")
    {
        ShowAlert(3,"","密码不能为空！","");return false;
    }
}
function CloseAd(id){document.getElementById(id).style.visibility="hidden";}
//显示FlashBanner
function ShowFlash(focus_width,focus_height,pics,links,texts)
{
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ focus_height +'">');                                           
    document.write('<param name="allowScriptAccess" value="sameDomain"><param name="quality" value="high"><param name="bgcolor" value="#fff">');
    document.write('<param name="movie" value="/Images/Public/pixviewer1.swf"><param name="menu" value="false"><param name="wmode" value="opaque">'); 
    document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+(focus_width+2)+'&borderheight='+(focus_height+2)+'">');
    document.write('<embed src="/Images/Public/pixviewer1.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+(focus_width+2)+'&borderheight='+(focus_height+2)+'&textheight=0" menu="false" bgcolor="#ffffff" quality="high" width="'+ (focus_width) +'" height="'+ (focus_height) +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');  
}
//显示纯FLash
function ShowFlash1(focus_width,focus_height,files)
{
    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ focus_height +'">');                                           
    document.write('<param name="allowScriptAccess" value="sameDomain"><param name="quality" value="high"><param name="bgcolor" value="#fff">');
    document.write('<param name="movie" value="/Images/'+files+'"><param name="menu" value="false"><param name="wmode" value="opaque">'); 
    document.write('<embed src="/Images/'+files+'" wmode="opaque"  menu="false" bgcolor="#fff" quality="high" width="'+ (focus_width) +'" height="'+ (focus_height) +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>'); 
}
function IndexFlash()
{
    document.write('<a href="http://www.yidijiajiao.com" target="_blank" style="float:none;margin:0;padding:0"><img src="/Images/11.jpg" style="width:660px;height:76px;" alt="异地家教网"></a>');
    //ShowFlash1(650,76,"Top.swf")
}

var delta=0.08;
var theFloaters=new floaters();
var ie=document.all && !window.opera;
var collection;
var closeimg="/Images/close.gif";

//左面
//var str='<a href="/3.html" target="_blank"><img src="/Images/shuqian.jpg" alt="通向名校之路 启迪智慧之光"></a>';
//var fleft=(ie)?3:1;
//theFloaters.addItem('floatTips1',fleft,120,110,str+'<a onclick="CloseAd(\'floatTips1\');" title="关闭"><img src="'+closeimg+'"></a>');
//右面
//str='<a href="/AboutUs/Free.shtml" target="_blank"><img src="http://www.yidijiajiao.com/AboutUs/images/guanggao.gif" alt="异地家教网名师、状元课程暑假大馈赠"></a>';
//theFloaters.addItem('floatTips2','document.documentElement.clientWidth-116',120,110,str+'<a onclick="CloseAd(\'floatTips2\');" title="关闭"><img src="'+closeimg+'"></a>');

//theFloaters.play();

function CloseAd(id){document.getElementById(id).style.visibility="hidden";}

function floaters() {
    this.items	= [];
    this.addItem	= function(id,x,y,heights,content)
		  {
			document.write('<div id='+id+' style="width:'+heights+'px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</div>');
			var newItem				= {};
			newItem.object			= document.getElementById(id);
			newItem.x				= x;
			newItem.y				= y;
			this.items[this.items.length]		= newItem;
		  }
    this.play= function(){collection=this.items;setInterval('play()',10);}
}
function play()
{
	for(var i=0;i<collection.length;i++)
	{
		var followObj		= collection[i].object;
		var followObj_x		= (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);
		var followObj_y		= (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);

		if(followObj.offsetLeft!=(document.documentElement.scrollLeft+followObj_x)) {
			var dx=(document.documentElement.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
			dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
			followObj.style.left=followObj.offsetLeft+dx+"px";
			}
		if(followObj.offsetTop!=(document.documentElement.scrollTop+followObj_y)) {
			var dy=(document.documentElement.scrollTop+followObj_y-followObj.offsetTop)*delta;
			dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
			followObj.style.top=followObj.offsetTop+dy+"px";
			}
		followObj.style.display	= '';
	}
}

function GetImage(img)
{
    document.getElementById("Logo").style.background="url('../Images/bg"+img+".jpg')";
}


