var imgTop;
var imgLeft;
window.screen.width > 800 ? imgTop=1 : imgTop=1;
imgLeft = GetLeftLoc();
imgLeftofLeft = 7;

function GetLeftLoc()
{
  return document.body.clientWidth-100-7;
}

function GetWindowOffsetTop() 
{
  if (document.body)
  { 
    return document.body.scrollTop;
  }
} 

function rightAdLoad()
{
		document.getElementById("adright1").style.top = GetWindowOffsetTop() + imgTop;
		document.getElementById("adright1").style.left = imgLeft;
		//document.getElementById("adright2").style.top = GetWindowOffsetTop() + document.documentElement.offsetHeight - imgTop - 300;
		//document.getElementById("adright2").style.left = imgLeft;
		//rightmove();
}

function rightmove()
{
  if(document.body.offsetWidth>980)
  {
    document.getElementById("adleft1").style.display = "block";
		document.getElementById("adleft1").style.top = GetWindowOffsetTop() +  imgTop ;
		document.getElementById("adleft1").style.left = imgLeftofLeft;
    //document.getElementById("adleft2").style.display = "block";
		//document.getElementById("adleft2").style.top = GetWindowOffsetTop() +  imgTop + 300 + 20;
		//document.getElementById("adleft2").style.left = imgLeftofLeft;
  }
  else
  {
    document.getElementById("adleft1").style.display = "none";
    //document.getElementById("adleft2").style.display = "none";
  }

  if(document.body.offsetWidth>980)
  {
    imgLeft = GetLeftLoc();
    document.getElementById("adright1").style.display = "block";
    //document.getElementById("adright2").style.display = "block";
		document.getElementById("adright1").style.top = GetWindowOffsetTop() + imgTop;
		document.getElementById("adright1").style.left = imgLeft;
		//document.getElementById("adright2").style.top = GetWindowOffsetTop() + imgTop + 300 + 20;
		//document.getElementById("adright2").style.left = imgLeft;
  }
  else
  {
    document.getElementById("adright1").style.display = "none";
    //document.getElementById("adright2").style.display = "none";
  }

  setTimeout("rightmove();", 80);
}

function js_close_div(divname)
{
  document.getElementById(divname).style.visibility = "hidden";
}

if (window.screen.width > 800) //(document.body.offsetWidth>800)
{
    urlLeft = "NewsInfo.asp?Id=400";
    imageLeft = "Img/100_300_l.gif";
    titleLeft = "国外楼梯大全";
    urlRight = "NewsInfo.asp?Id=401";
    imageRight = "Img/100_300_r.gif";
    titleRight = "国外橱柜大全";
    urlLeft2 = "#";
    imageLeft2 = "Img/100_300_l.gif";
    titleLeft2 = "国外楼梯大全";
    urlRight2 = "NewsInfo.asp?Id=400";
    imageRight2 = "Img/100_300_l.gif";
    titleRight2 = "国外楼梯大全";
	//document.write("<div id='adleft1' style='position: absolute;width:80;top:180;left:"+imgLeftofLeft+";visibility: visible;z-index: 3'><a href='" + urlLeft + "' title='" + titleLeft + "' target='_blank'><IMG src='" + imageLeft + "'  border='0' usemap='#MapLeftPic'></a></div><map name='MapLeftPic'><area shape='rect' coords='80,3,95,18' href='javascript:js_close_div(\"adleft1\");'><area shape='rect' coords='1,21,88,299' href='" + urlLeft + "' target='_blank'><area shape='rect' coords='0,1,72,22' href='" + urlLeft + "' target='_blank'></map>");
    document.write("<div id='adright1' style='position: absolute;width:80;top:180;left:"+imgLeft+";visibility: visible;z-index: 1'><a href='"+ urlRight +"' title='" + titleRight + "' target='_blank'><IMG src='" + imageRight+ "'  border='0'  usemap='#MapSHJobs'></a></div><map name='MapSHJobs'><area shape='rect' coords='80,3,95,18' href='javascript:js_close_div(\"adright1\");'><area shape='rect' coords='1,21,88,299' href='" + urlRight + "' target='_blank'><area shape='rect' coords='0,1,72,22' href='" + urlRight + "' target='_blank'></map>");
	//document.write("<div id='adleft2' style='position: absolute;width:80;top:500;left:"+imgLeftofLeft+";visibility: visible;z-index: 3'><a href='" + urlLeft2 + "' title='" + titleLeft2 + "' target='_blank'><IMG src='" + imageLeft2 + "'  border='0'></a></div>");
    //document.write("<div id='adright2' style='position: absolute;width:80;top:500;left:"+imgLeft+";visibility: visible;z-index: 1'><a href='"+ urlRight2 +"' title='" + titleRight2 + "' target='_blank'><IMG src='" + imageRight2+ "'  border='0'></a></div>");
	document.write("<div id='adright2' style='position: absolute;width:80;top:302;left:"+imgLeft+";visibility: visible;z-index: 1'><a href='"+ urlRight2 +"' title='" + titleRight2 + "' target='_blank'><IMG src='" + imageRight2+ "'  border='0'  usemap='#MapRight2'></a></div><map name='MapRight2'><area shape='rect' coords='80,3,95,18' href='javascript:js_close_div(\"adright2\");'><area shape='rect' coords='1,21,88,299' href='" + urlRight2 + "' target='_blank'><area shape='rect' coords='0,1,72,22' href='" + urlRight2 + "' target='_blank'></map>");
	//显示FLASH
	///document.write("<div id='adright1' style='position: absolute;width:80;top:180;left:"+imgLeft+";visibility: visible;z-index: 1'><object id='gomedl2'  classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='100' height='300'><param name=movie value='" + imageRight+ "'><param name=quality value=high><param name='wmode' value='transparent'><embed src='" + imageRight+ "' quality=high  pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'  width='100' height='300'> </object></div><map name='MapSHJobs'><area shape='rect' coords='69,4,87,18' href='javascript:js_close_div(\"adright1\");'><area shape='rect' coords='1,21,88,299' href='" + urlRight + "' target='_blank'><area shape='rect' coords='0,1,72,22' href='" + urlRight + "' target='_blank'></map>");
	///document.write("<div id='adleft1' style='position: absolute;width:80;top:180;left:"+imgLeftofLeft+";visibility: visible;z-index: 3'><object id='gomedl2'  classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='100' height='300'><param name=movie value='" + imageLeft + "'><param name=quality value=high><param name='wmode' value='transparent'><embed src='" + imageLeft + "' quality=high  pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'  width='100' height='300'> </object></div><map name='MapLeftPic'><area shape='rect' coords='69,4,87,18' href='javascript:js_close_div(\"adleft1\");'><area shape='rect' coords='1,21,88,299' href='" + urlLeft + "' target='_blank'><area shape='rect' coords='0,1,72,22' href='" + urlLeft + "' target='_blank'></map>");
    rightAdLoad();
}