/***************** DROPIN LAYER ******************************************/

    var ie=document.all
    var dom=document.getElementById
    var ns4=document.layers

    var bouncelimit=32 //(must be divisible by 8)
    var curtop
    var direction="up"
    var boxheight=''

    function initbox(phpobj){
     if (!dom&&!ie&&!ns4)
       return
         crossobj=(dom)?document.getElementById(phpobj).style : ie? document.all.phpobj : document.phpobj;
     scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
     crossobj.top=scroll_top-250
     crossobj.visibility=(dom||ie)? "visible" : "show"
     dropstart=setInterval("dropin()",50)
   }

function dropin(){
  scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
    if (parseInt(crossobj.top)<75+scroll_top)
      crossobj.top=parseInt(crossobj.top)+40
      else{
        clearInterval(dropstart)
        bouncestart=setInterval("bouncein()",50)
      }
}

function bouncein(){
  crossobj.top=parseInt(crossobj.top)-bouncelimit
    if (bouncelimit<0)
      bouncelimit+=8
        bouncelimit=bouncelimit*-1
        if (bouncelimit==0){
          clearInterval(bouncestart)
        }
}

function dismissbox(phpobj){
   if (window.bouncestart)
    clearInterval(bouncestart)
  //    crossobj.visibility="hidden"

  div = document.getElementById(phpobj);
  div.style.visibility='hidden';

}

function redo(phpobj){
  bouncelimit=32
    direction="up"
    initbox(phpobj)
    }

//window.onload=initbox
/****************************************[END] DROPIN LAYER ***********************************************************/


function CloseIt()	{
	disappear('ADLayer');
			}


function MarketingLayer()	{
var delay = 2;
setTimeout ("slidedown_showHide();", delay*1000);
	                    	}


function disappear(name_div)	{

	div = document.getElementById(name_div);
	div.style.display='none'; 
				}


/********** SLIDING LAYER ***********************/

var initHeight = 0;
var slidedown_direction = 1;
var slidedownContentBox = false;
var slidedownContent = false;
var slidedownActive = false;
var contentHeight = false;
var slidedownSpeed = 40;  // Higher value = faster script
var slidedownTimer = 0; // Lower value = faster script

function slidedown_showHide() {
  if(initHeight==0)slidedown_direction=slidedownSpeed; else slidedown_direction = slidedownSpeed*-1;
  if(!slidedownContentBox) {
    slidedownContentBox = document.getElementById('dhtmlgoodies_contentBox');
    slidedownContent = document.getElementById('dhtmlgoodies_content');
    contentHeight = document.getElementById('dhtmlgoodies_content').offsetHeight;
  }
  slidedownContentBox.style.visibility='visible';
  slidedownActive = true;
  slidedown_showHide_start();
}

function slidedown_showHide_start() {
  if(!slidedownActive)return;
  initHeight = initHeight/1 + slidedown_direction;
  if(initHeight <= 0) {
    slidedownActive = false; 
    slidedownContentBox.style.visibility='hidden';
    initHeight = 0;
  }
  if(initHeight>contentHeight) {
    slidedownActive = false; 
  }
  slidedownContentBox.style.height = initHeight + 'px';
  slidedownContent.style.top = initHeight - contentHeight + 'px';
  setTimeout('slidedown_showHide_start()',slidedownTimer); // Choose a lower value than 10 to make the script move faster
}

function setslidedownWidth(newWidth) {
  document.getElementById('dhtmlgoodies_slidedown').style.width = newWidth + 'px';
  document.getElementById('dhtmlgoodies_contentBox').style.width = newWidth + 'px';
}

function setSlideDownSpeed(newSpeed) {
  slidedownSpeed = newSpeed;
}

/***************[END] SLIDING LAYER **************************/
