// JavaScript Document
function floatad_common(oid,omiddle,owintop,oheight,oscreen,otimes,ostay){
 var isshow1 = true;
 var isshow2 = true;
 var adusers = null;
 if(oscreen<=screen.width){ isshow1 = true; }else{ isshow1 = false; }
 if(otimes>0){
  adusers = getCookie("aduser"+ oid);
  if(adusers=="aduser"+ oid){
   isshow2 = false;
  }else{
   isshow2 = true;
   setCookie_s("aduser"+ oid,"aduser"+ oid,otimes);
  }
 }else{
  setCookie_s("aduser"+ oid,"aduser"+ oid,-3600);
 }
 //alert(adusers +"\r\n"+ isshow1 +"\r\n"+ isshow2);
 if(isshow1==false || isshow2==false){
  closead(oid);
 }else{
  if(!!window.ActiveXObject && !window.XMLHttpRequest){
   var init = null;
   var obj = document.getElementById(oid);
   if(omiddle=="bottom"){
    var winsize = getPageSize();
    owintop = winsize[3]-oheight;
    if(owintop<0){ owintop = 10; }
   }
   if(obj){
    init = window.setInterval(function(){obj.style.top=getDocument().scrollTop+owintop+"px";},1);
   }else{
    clearInterval(init);
   }
  }
  if(ostay>0){ setTimeout(function (){closead(oid);},ostay*1000); }
 }
}
function closead(oid){
 var obj = document.getElementById(oid);
 if(obj){ obj.parentNode.removeChild(obj); }
}

//other functions
function getDocument(){
 return(document.documentElement&&document.documentElement.clientWidth)?document.documentElement:document.body;
}

function getPageSize(){ 
 var xScroll, yScroll; 
 if (window.innerHeight && window.scrollMaxY) { 
  xScroll = document.body.scrollWidth; 
  yScroll = window.innerHeight + window.scrollMaxY; 
 } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac 
  xScroll = document.body.scrollWidth; 
  yScroll = document.body.scrollHeight; 
 } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari 
  xScroll = document.body.offsetWidth; 
  yScroll = document.body.offsetHeight; 
 } 
 
 var windowWidth, windowHeight; 
 if (self.innerHeight) { // all except Explorer 
  windowWidth = self.innerWidth; 
  windowHeight = self.innerHeight; 
 } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode 
  windowWidth = document.documentElement.clientWidth; 
  windowHeight = document.documentElement.clientHeight; 
 } else if (document.body) { // other Explorers 
  windowWidth = document.body.clientWidth; 
  windowHeight = document.body.clientHeight; 
 } 
 
 // for small pages with total height less then height of the viewport 
 if(yScroll < windowHeight){ 
  pageHeight = windowHeight; 
 } else { 
  pageHeight = yScroll; 
 } 
 
 // for small pages with total width less then width of the viewport 
 if(xScroll < windowWidth){ 
  pageWidth = windowWidth; 
 } else { 
  pageWidth = xScroll; 
 } 
 
 arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
 return arrayPageSize; 
}

function setCookie_d(c_name,value,expire){
 var exdate=new Date();
 exdate.setDate(exdate.getDate()+expire);
 document.cookie=c_name+ "=" +escape(value)+((expire==null) ? "" : ";expires="+exdate.toGMTString());
}

function setCookie_h(c_name,value,expire){
 var exdate=new Date();
 exdate.setTime(exdate.getTime()+expire*60*60*1000);
 document.cookie=c_name+ "=" +escape(value)+((expire==null) ? "" : ";expires="+exdate.toGMTString());
}

function setCookie_s(c_name,value,expire){
 var exdate=new Date();
 exdate.setTime(exdate.getTime()+expire*1000);
 document.cookie=c_name+ "=" +escape(value)+((expire==null) ? "" : ";expires="+exdate.toGMTString());
}

function getCookie(c_name){
 if (document.cookie.length>0){
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1){ 
   c_start=c_start + c_name.length+1 ;
   c_end=document.cookie.indexOf(";",c_start);
   if (c_end==-1) {c_end=document.cookie.length;}
   return unescape(document.cookie.substring(c_start,c_end));
  } 
 }
return "";
}
