// JavaScript Document
function adpf(){
	
	this.addiv=document.createElement('div');
	this.addiv.style.width='700px';
	this.addiv.style.height='336px';  
	this.addiv.style.position='absolute';
	this.addiv.style.display='block';
	this.addiv.style.left=(getInnerXY()[0]-700)/2+getScrollXY()[0]+'px';
	this.addiv.style.top=(getInnerXY()[1]-336-28)/2+getScrollXY()[1]+'px';
	getbodyobj().appendChild(this.addiv);
	this.fdiv=document.createElement('div');
	this.fdiv.style.width='700px';
	this.fdiv.style.height='316px';  
        this.fdiv.style.display='block';
	this.fdiv.style.styleFloat='left';
	this.addiv.appendChild(this.fdiv);
	var cons = document.createElement("EMBED");
	cons.setAttribute('src', "http://www.txcs.cn/inc/ad/3.swf"); 
	cons.setAttribute('quality',"high"); 
        cons.setAttribute('WMode',"Window"); 
	cons.setAttribute('width', 700); 
	cons.setAttribute('height', 316); 
	cons.setAttribute('align', "middle"); 
	cons.setAttribute('allowScriptAccess',"always"); 
	cons.setAttribute('allowfullscreen',"true"); 
	cons.setAttribute('type', "application/x-shockwave-flash"); 
	this.fdiv.appendChild(cons);
	 
var adclose=function(){
	this.addiv.style.display='none';
	}	 
setTimeout(adclose,8000);

	this.cdiv=document.createElement('div');
	this.cdiv.style.width='700px';
	this.cdiv.style.height='20px';  
    this.cdiv.style.display='block';
	this.cdiv.style.fontSize='14px';
	this.cdiv.style.textAlign='right';
	this.cdiv.style.backgroundColor='#ccc';
	this.cdiv.style.cursor='pointer';
	this.cdiv.style.fontWeight='bold';
	this.cdiv.style.lineHeight='20px';
	this.cdiv.style.styleFloat='left';
	this.addiv.appendChild(this.cdiv);
	
	this.cdiv.innerHTML='¹Ø±Õ';
	this.cdiv.onclick=function(){
		adclose();
		}
}

	function  getInnerXY() 
	{  var myWidth = 0, myHeight = 0;  
	if( typeof( window.innerWidth ) == 'number' ) {      
	myWidth = window.innerWidth;    
	myHeight = window.innerHeight;  } 
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
	{myWidth = document.documentElement.clientWidth;
	myHeight = document.documentElement.clientHeight;  } 
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
	{myWidth = document.body.clientWidth; 
	myHeight = document.body.clientHeight;}  
	return [myWidth, myHeight];
	}
	
    function getScrollXY()
	{ var scrOfX = 0, scrOfY = 0;  
	if( typeof( window.pageYOffset ) == 'number' ) {  
	scrOfY = window.pageYOffset;
	scrOfX = window.pageXOffset;  }
	else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
	{  scrOfY = document.body.scrollTop; 
	scrOfX = document.body.scrollLeft;  } 
	else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) )
	{ scrOfY = document.documentElement.scrollTop; 
	scrOfX = document.documentElement.scrollLeft; }
	return [ scrOfX, scrOfY ];}
	
	function getbodyobj() {
        return document.getElementsByTagName("body")[0];
    }
	
	
	function addLoadEvent11(func) {   
  var oldonload = window.onload;   
  if (typeof window.onload != 'function') {   
    window.onload = func;   
  } else {   
    window.onload = function() {   
    func();
    oldonload();   
         
    }   
  }   
}
addLoadEvent11(adpf);
