jQuery(document).ready(function(){	  
	jQuery.fn.coverDiv=function(){  
	this.coverFun=function(){ 
	   var wnd = jQuery(window), doc = jQuery(document); 
	   if(wnd.height() > doc.height()){
		wHeight = wnd.height();  
	   }else{
		wHeight = doc.height();   
	   }
	   jQuery("body").append("<div ID=coverwith></div><div ID='520319bbsflash'  style='display:block;position: absolute; text-align: left; z-index: 99999999; left: 0px; top:0px; width: 960px;height:698px;'></div>"); 
	   var iframeHi="<iframe id='hilater' src='#' border='0' width='0' height='0'></iframe>";
	   var showIframe= "<iframe src='' border='0' width='0' height='0'></iframe>";
	   jQuery("#520319bbsflash").html(divhiFlash()+iframeHi+showIframe);  
	    scrollImgFlash(); 
	   } 
		this.coverFun();   
		return this;
	}
function divhiFlash(){
	var str = "<div id='hidivshow' style='display:block;position: absolute; text-align: left; z-index: 99999999; left: 10px; top: 118px;'>\n";
	str +="<OBJECT classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' WIDTH='830' HEIGHT='310' id='myMovieName'> \n";
	str +="<PARAM NAME=movie VALUE='../Ad/CookieFlash/BbsAd.swf'>\n";
	str +="<PARAM NAME=quality VALUE=high><param name='WMode' value='Transparent'>\n";
	str +="<PARAM NAME=bgcolor VALUE=#FFFFFF>\n";
	str +="<EMBED src='../Ad/CookieFlash/BbsAd.swf' wmode='transparent'  allowscriptaccess = 'always' quality='high' WIDTH='830' HEIGHT='310' NAME='myMovieName' ALIGN='' TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'> \n";
    str +="</EMBED>\n";
	str +="</OBJECT>\n"; 
	str +="</div>\n";
	return  str ;
 }
  
	
 });
 function closeDivHi(){
	jQuery("#520319bbsflash").hide();
 }

function scrollImgFlash(){   
	if( document.getElementById("520319bbsflash") == null || document.getElementById("520319bbsflash") =='undefined'){
		 
		return ;
	} 
    var posX,posY;  
    if (window.innerHeight) {  
        posX = window.pageXOffset;  
        posY = window.pageYOffset;  
    }  
    else if (document.documentElement && document.documentElement.scrollTop) {  
        posX = document.documentElement.scrollLeft;  
        posY = document.documentElement.scrollTop;  
    }  
    else if (document.body) {  
        posX = document.body.scrollLeft;  
        posY = document.body.scrollTop;  
    }  

    var ad=document.getElementById("520319bbsflash");  
    ad.style.top=(posY+150)+"px";  
    ad.style.left=(posX+5)+"px"; 

    setTimeout("scrollImgFlash()",100);  
}  


