
var column = 0;
var timerDown;
var timerUp;
var scrolllength=-1;


var column=0;

function scroll_column(valMove)
{
  var ObgUl = document.getElementById("bulletList");
  var objLi = ObgUl.getElementsByTagName('li');
  var liLen = objLi.length - 1;
  if(valMove>0)
  {
    //alert('column='+column+', liLen='+liLen)
    //if(liLen>column)
    if(column<liLen-1)
    {	
      objLi[column].style.display="none";
      objLi[column+2].style.display="block";
      column++;
    }
  }
  if(valMove<0)
  {
    if(column>0)
    {
      objLi[column+1].style.display="none";
      objLi[column-1].style.display="block";
      column--;
    }
  }
  loadScrollColArrows(column);
  return(false);
}

function loadScrollColArrows(pos)
{
  var bulletTable=document.getElementById('bulletList_table');
  var count=bulletTable.getElementsByTagName("li").length;
  if(pos+2>=count)
  {
    document.getElementById('bulletlist_next').src='../images/template/next_disabled.gif';
    document.getElementById('bulletlist_next').style.cursor='arrow';
  }
  else
  {
    document.getElementById('bulletlist_next').src='../images/template/next.gif';
    document.getElementById('bulletlist_next').style.cursor='hand';
  }

  if(pos==0)
  {
    document.getElementById('bulletlist_prev').src='../images/template/previous_disabled.gif';
    document.getElementById('bulletlist_prev').style.cursor='arrow';
  }
  else
  {
    document.getElementById('bulletlist_prev').src='../images/template/previous.gif';
    document.getElementById('bulletlist_prev').style.cursor='hand';
  }  
}

defaultStep=1
step=defaultStep

function scrollDivDown(id)
{
  document.getElementById(id).scrollLeft+=step;
  loadScrollArrows(id);
  timerDown=setTimeout("scrollDivDown('"+id+"')",10);
  return(false);
}

function scrollDivUp(id)
{
  document.getElementById(id).scrollLeft-=step;
  loadScrollArrows(id);
  timerUp=setTimeout("scrollDivUp('"+id+"')",10);
  return(false);
}

function loadScrollArrows(id)
{
  var pos=document.getElementById(id).scrollLeft;
  var thescroll=document.getElementById('scrollpuff').offsetWidth;
  var div1Width=document.getElementById('div1').offsetWidth;
  if(scrolllength<0)
  {
    scrolllength=thescroll;
  }
  if(pos+div1Width>=scrolllength)
  //if(pos+div1Width>=thescroll)
  {
    document.getElementById('puffimage_next').src='../images/template/next_disabled.gif';
    document.getElementById('puffimage_next').style.cursor='arrow';
  }
  else
  {
    document.getElementById('puffimage_next').src='../images/template/next.gif';
    document.getElementById('puffimage_next').style.cursor='hand';
  }

  if(pos==0)
  {
    document.getElementById('puffimage_prev').src='../images/template/previous_disabled.gif';
    document.getElementById('puffimage_prev').style.cursor='arrow';
  }
  else
  {
    document.getElementById('puffimage_prev').src='../images/template/previous.gif';
    document.getElementById('puffimage_prev').style.cursor='hand';
  }
}


function Print_Friendly_Version(url)
{
  var width=690;
  var height=675;
  var x1=(screen.width/2)-(width/2);
  var y1=(screen.height/2)-(height/2);
  var features='width='+width+',height='+height+',top='+y1+',left='+x1+',screenX='+x1+',screenY='+y1+',resizable=0,scrollbars=1, menubar=1';
  window.open(url, '_blank', features)
}
function Print_Friendly_Version_gallery(url)
{
  var width=770;
  var height=675;
  var x1=(screen.width/2)-(width/2);
  var y1=(screen.height/2)-(height/2);
  var features='width='+width+',height='+height+',top='+y1+',left='+x1+',screenX='+x1+',screenY='+y1+',resizable=0,scrollbars=1, menubar=1';
  window.open(url, '_blank', features)
}
function swfScript(flashMovie,flashWidth,flashHeight)
{
		var flashCode = 
			'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ' +
			'codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '+
			'width="' + flashWidth + '" ' + 
			'height="' + flashHeight + '"> ' +
			'<param name="allowScriptAccess" value="sameDomain" />' +
			'<param name="movie" value="' + flashMovie + '" />' +
			'<param name="quality" value="best" />' +
			'<param name="scale" value="noscale" />' +
			'<param name="bgcolor" />' +
                        '<param value="Opaque" name="WMode" />'+
			'<embed src="' + flashMovie + '" ' +
			'width="' + flashWidth + '" ' + 
			'height="' + flashHeight + '" ' +
			'quality="best" scale="noscale" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
			'</object>';
		document.write(flashCode);
}
var topMargin = 2;
var slideTime = 600;
var ns6 = (! document.all && document.getElementById);
var ie4 = (document.all);
var ns4 = (document.layers);
var ie6 = (document.documentElement);
//window.setInterval("main()", 10);
function floatObject(){
  findHt = (ns6 || ns4) ? innerHeight : document.body.clientHeight;
}

function main(){
  if (ns4){
    this.currentY = document.floatLayer.top;
    this.scrollTop = window.pageYOffset;
    mainTrigger();
  } else if (ns6){
    this.currentY = parseInt(document.getElementById('floatLayer').style.top);
    this.scrollTop = scrollY;
    mainTrigger();
  } else if (ie4){
    this.currentY = floatLayer.style.pixelTop;
    this.scrollTop = document.body.scrollTop;
    mainTrigger();
  }
}

function mainTrigger(){
  var newTargetY = this.scrollTop + this.topMargin
  if (this.currentY != newTargetY){
    if (newTargetY != this.targetY){
      this.targetY = newTargetY
      floatStart();
    }
    animator();
  }
}

function floatStart() { 
  var now	= new Date();
  this.A		= this.targetY - this.currentY;
  this.B		= Math.PI / ( 2 * this.slideTime );
  this.C		= now.getTime();
  if (Math.abs(this.A) > this.findHt) { 
  this.D = this.A > 0 ? this.targetY - this.findHt : this.targetY + this.findHt;
  this.A = this.A > 0 ? this.findHt : -this.findHt;
  } else {	 
    this.D = this.currentY;
  } 
} 

function animator() { 
  var now	= new Date() 
  var newY	= this.A * Math.sin( this.B * ( now.getTime() - this.C ) ) + this.D;
  newY		= Math.round(newY);
  if (( this.A > 0 && newY > this.currentY ) || ( this.A < 0 && newY < this.currentY )) { 
    if ( ie4 )floatLayer.style.pixelTop = newY;
    if ( ns4 )document.floatLayer.top = newY;
    if ( ns6 )document.getElementById('floatLayer').style.top = newY + "px";
  } 
} 


var browser=navigator.appName;
var details=navigator.userAgent;
if((browser.indexOf("Microsoft")>-1 || browser.indexOf("Explorer")>-1)&&( (details.indexOf("Mac")>-1)||(details.indexOf("mac")>-1))) 
{
window.location.href = 'http://www.xpress4me.com/browser/Incompatible_browser.html';
}

//Enable banners
function enableLayoutBanner()
{
  //add banner
  var divBannerInline=document.getElementById('ad_banner');
  if(divBannerInline)
  {
    if(divBannerInline.offsetHeight>0)
    {
      var adhrline=document.getElementById('ad_hrline');
      if(adhrline)
      {
        adhrline.style.display='block';
      }
      var adadrates=document.getElementById('ad_adrates');
      if(adadrates)
      {
        adadrates.style.display='block';
      }
    }
  }
  //leader board banner
  var divLeaderboardBanner=document.getElementById('leaderboard_banner');
  if(divLeaderboardBanner)
  {
    if(divLeaderboardBanner.offsetHeight>0)
    {
      var leaderboardSpacetop=document.getElementById('leaderboard_spacetop');
      if(leaderboardSpacetop)
      {
        leaderboardSpacetop.style.display='block';
      }
      var leaderboardSpacebottom=document.getElementById('leaderboard_spacebottom');
      if(leaderboardSpacebottom)
      {
        leaderboardSpacebottom.style.display='block';
      }
      var leaderboardadrates=document.getElementById('leaderboard_adrates');
      if(leaderboardadrates)
      {
        leaderboardadrates.style.display='block';
      }
    }
  }
  //killer banner
  var divKillerbanner=document.getElementById('killer_banner');
  if(divKillerbanner)
  {
    if(divKillerbanner.offsetHeight>0)
    {
      var divKillerates=document.getElementById('killer_adrates');
      if(divKillerates)
      {
        divKillerates.style.display='block';
      }
    }
  }
}
