
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.pc=(navigator.appVersion.indexOf("Mac") == -1)
	this.iepc=(this.pc &&  (this.ie4 || this.ie5)==1)
	this.ie4mac=((!this.pc) &&  (this.ie4)==1)
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns5mac=((!this.pc) && (this.ns5)==1)
	this.iemac=((!this.pc) && (this.ie5 || this.ns5)==1)
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this;
}
bw=new checkBrowser()

function move(l,t,div,nest){ 	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 	
obj.left=l;	obj.top=t;
}

function dshow(div,nest){	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0; 	obj.visibility='visible';
}

function CheckforDiv(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'
	this.exists=(bw.dom && (document.getElementById(obj)))?1:(bw.ie4 && (document.all[obj]))?1:(bw.ns4 && (eval(nest+'document.'+obj)))?1:0;
	this.exists=(this.exists == "undefined" || this.exists == null)?false:this.exists;
	return this.exists
}

function makeObj(obj,nest){
	nest=(!nest) ? '':'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.height=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.width=bw.ns4?this.css.document.width:this.el.offsetWidth
	this.cx=(this.width/2)
	this.cy=(this.height/2)
	
	if (firsttime){
		this.origtop=(bw.ns4 || (bw.iemac && !bw.ie5))?this.css.top:eval(this.css.top.slice(0,this.css.top.length-2));
		this.origleft=(bw.ns4 || (bw.iemac && !bw.ie5))?this.css.left:eval(this.css.left.slice(0,this.css.left.length-2));
		if (bw.ns5mac){
			this.origtop=eval(this.css.top.slice(0,this.css.top.length-2));
			this.origleft=eval(this.css.left.slice(0,this.css.left.length-2));
		}
		OrigX[this.el.id]=this.origleft;	OrigY[this.el.id]=this.origtop;
	}
	else{	  		this.origleft=OrigX[this.el.id];	this.origtop=OrigY[this.el.id];	}
	
	if (page.width>magickx && page.height>magicky){
		this.newleft=page.cx-magickcx+this.origleft;
		this.newtop=page.cy-magickcy+this.origtop;
	}
	else if (page.width>magickx && page.height<magicky){
		this.newleft=page.cx-magickcx+this.origleft;
		this.newtop=this.origtop;
	}
	else if (page.width<magickx && page.height>magicky){
		this.newleft=this.origleft;
		this.newtop=page.cy-magickcy+this.origtop;
	}
	else{
		this.newleft=this.origleft;
		this.newtop=this.origtop;
	}
	move(this.newleft,this.newtop,this.el.id);
	if (this.el.id !="atab" || this.el.id !="plus1" || this.el.id !="plus2" || this.el.id !="plus3" || this.el.id !="arrow1" || this.el.id !="arrow2" || this.el.id !="arrow3"){  this.css.visibility="visible";}
	if (this.el.id.slice(0,this.el.id.length-1)=="plus" || this.el.id.slice(0,this.el.id.length-1)=="arrow"){ this.css.visibility="hidden";}
	return this;
}



function makeSObj(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
	this.up=goUp;this.down=goDown;
	this.moveIt=moveIt; this.x; this.y;
  this.obj = obj + "Object"
  eval(this.obj + "=this")
	this.firstime=true;
	this.css.visibility="visible";
	if (this.el.id.slice(0,7)=="divText" ){	this.moveIt(0,0);}
	if (this.el.id=="divText" ){	if (this.scrollHeight>oCont.clipHeight){ dshow("arrow1"); dshow("plus1"); } this.factor=this.scrollHeight-oCont.clipHeight }
	if (this.el.id=="divText2" ){	if (this.scrollHeight>oCont2.clipHeight){ dshow("arrow2"); dshow("plus2"); } this.factor=this.scrollHeight-oCont2.clipHeight}
	if (this.el.id=="divText3" ){	if (this.scrollHeight>oCont3.clipHeight){ dshow("arrow3"); dshow("plus3"); }	this.factor=this.scrollHeight-oCont3.clipHeight}
  return this;
}

function pageinfo(){
	this.x=0; 	this.y=0;
	this.width=(bw.ns4 || bw.ns5)?window.innerWidth:document.body.clientWidth;
	this.height=(bw.ns4 || bw.ns5)?window.innerHeight:document.body.clientHeight;
	this.cy=Math.round(this.height/2);	this.cx=Math.round(this.width/2);
	return this;
}


function netscapeCssFix() {
	if (bw.ns4) {  	if (document.OSCOPE.OSCOPE_netscapeCssFix.initWindowWidth != window.innerWidth || document.OSCOPE.OSCOPE_netscapeCssFix.initWindowHeight != window.innerHeight) {			history.go(0);  	}	}
	else{
		if (bw.ie4 || bw.ns4){	history.go(0);	}
		else	{		history.go(0); }
	}
}


function mLover(id,div){ 
	if (document.images){
			if (bw.ns4){  document.layers[div].document[id].src=eval(id+"_z.src");	}
			else {	document[id].src=eval(id+"_z.src");	}
	}
}

function mLout(id,div){
	if (document.images){
			if (bw.ns4){  document.layers[div].document[id].src=eval(id+".src");  }
			else {	document[id].src=eval(id+".src");  }
	}
}

oNavObj= new Object;
var divs; var idvalue;
var index="1";
var j=0;



var dnarrow1 =  new Image(13,13);	dnarrow1.src = "/images/dnarrow.gif";
var dnarrow1_z =  new Image(13,13);	  dnarrow1_z.src = "/images/dnarrow_z.gif";
var uparrow1 =  new Image(13,13);	uparrow1.src = "/images/uparrow.gif";
var uparrow1_z =  new Image(13,13);	  uparrow1_z.src = "/images/uparrow_z.gif";


//If you want it to move faster you can set this lower:
var speed=65

//Sets variables to keep track of what's happening
var loop, timer

//-------- required function ---
function scroll(speed,type){
	if(loaded){
		loop=true;
		if (type == "divText"){
			if(speed>0) oScroll.down(speed)
			else oScroll.up(speed)
		}
	}
}
//Makes the object go up


function goDown(move){
if (this.el.id =="divText"){	if(this.y>-this.scrollHeight+oCont.clipHeight){
		this.moveIt(0,this.y-move)
			if(loop) setTimeout(this.obj+".down("+move+")",speed)
}	}
}


//Makes the object go down
function goUp(move){
	if(this.y<0){
		this.moveIt(0,this.y-move)
		if(loop) setTimeout(this.obj+".up("+move+")",speed)
	}
}
var num=0;


function moveIt(x,y){
	if(!firsttime) { 
//*imp
		num=(-y)*(68/this.factor);
		if (this.el.id=="divText"){		oPlus.top=oPlus.strtY+Math.round(num);
			if (oPlus.top>oPlus.lmtY){oPlus.top=oPlus.lmtY;}
			if (oPlus.top<oPlus.strtY){oPlus.top=oPlus.strtY; }
			if (y<(-this.scrollHeight+oCont.clipHeight)){ y=-this.scrollHeight+oCont.clipHeight			}
			if (isNaN(oPlus.top) && bw.iemac){ history.go(0); }
			else{oPlus.css.top=oPlus.top;}
		}
	}
	if (y>0){y=0;}
	this.x=x; this.y=y
	this.css.left=this.x
	this.css.top=this.y
}

//--------- required function --------//
function noScroll(){
	loop=false
	if(timer) clearTimeout(timer)
}





//--------------/////////////

var page;  var oMain; var oFooter; var oHeader; var oRelTwo; var oScript;
var oCont; var ratio;
//MAGICK X AND Y equal the Height and Width of the entire HTML'd areas.
// *imp
var magickx = 1024;    var magicky = 768; var firsttime=true; var loaded=0;
var magickcx = Math.round(magickx/2);    var magickcy = Math.round(magicky/2);
var OrigX = new Object; var OrigY = new Object; var w = new Object;

function init(){
	loaded = 1;
	center();
//if(ns) showNSLayers();
}


function center(){
	page = new pageinfo();

	oContB=(CheckforDiv("divCont"))?new makeObj("divCont"):false;
	oCont=(CheckforDiv("divCont"))?new makeSObj("divCont"):false;
	oArrow=(CheckforDiv("arrow1"))?new makeObj("arrow1"):false;
	oPlus=(CheckforDiv("plus1"))?new makeObj("plus1"):false;
	oScroll=(CheckforDiv("divText","divCont"))?new makeSObj('divText','divCont'):false;
//*imp
	oScroll.ratio=(68/(oScroll.scrollHeight-oCont.clipHeight));
	if (CheckforDiv("plus1")){
		oPlus.strtY = (bw.ns4)?oPlus.css.top:(bw.ns5)?eval(oPlus.css.top.slice(0,oPlus.css.top.length-2)):oPlus.css.pixelTop;
		oPlus.top = oPlus.strtY;
//*imp
		oPlus.lmtY = oPlus.strtY+68;
	}
	firsttime=false;
}



//button script....................................
var iversion = -1;

function version() {
	if (iversion != -1) return iversion;
        if(navigator.appName.indexOf("Netscape") != -1){
                if (navigator.userAgent.indexOf("Mozilla/2.0") != -1) 
                				iversion = 2;
                	else
                	    if (navigator.userAgent.indexOf("Mozilla/3.0") != -1) 
                					iversion = 3;
                			else
                        		if (navigator.userAgent.indexOf("Mozilla/4") != -1)
                        			iversion = 4;
                        		else
                        		    iversion = 1;
        }  else {  // Not netscape.
                if(navigator.appName.indexOf("Internet Explorer") != -1){
                     if (navigator.userAgent.indexOf("Mozilla/4") != -1) 
                     		iversion = 4; 
                         else	
                            iversion = 1;
                     } else 
                     	iversion = 1;
               }
	return iversion;
}

if (3 <= version()) {
	

	profileon = new Image();
	profileon.src = "/images/bt1_pro.gif";
	profileoff = new Image();
	profileoff.src = "/images/bt_pro.gif";
	
	staron = new Image();
	staron.src = "/images/bt1_ss.gif";
	staroff = new Image();
	staroff.src = "/images/bt_ss.gif";
	
	
	musicon = new Image();
	musicon.src = "/images/bt1_mv.gif";
	musicoff = new Image();
	musicoff.src = "/images/bt_mv.gif";
	
	movieson = new Image();
	movieson.src = "/images/bt1_mp.gif";
	moviesoff = new Image();
	moviesoff.src = "/images/bt_mp.gif";
	
	
	
	producton = new Image();
	producton.src = "/images/bt1_pl.gif";
	productoff = new Image();
	productoff.src = "/images/bt_pl.gif";
	
	charityon = new Image();
	charityon.src = "/images/bt1_ce.gif";
	charityoff = new Image();
	charityoff.src = "/images/bt_ce.gif";
	
	tvon = new Image();
	tvon.src = "/images/bt1_tv.gif";
	tvoff = new Image();
	tvoff.src = "/images/bt_tv.gif";
	
	contacton = new Image();
	contacton.src = "/images/bt1_ct.gif";
	contactoff = new Image();
	contactoff.src = "/images/bt_ct.gif";
	
	tradeon = new Image();
	tradeon.src = "/images/bt1_te.gif";
	tradeoff = new Image();
	tradeoff.src = "/images/bt_te.gif";	
	
	goodieson = new Image();
	goodieson.src = "/images/bt_goodies1.gif";
	goodiesoff = new Image();
	goodiesoff.src = "/images/bt_goodies.gif";	
	
	promoson = new Image();
	promoson.src = "/images/bt_promos1.gif";
	promosoff = new Image();
	promosoff.src = "/images/bt_promos.gif";	
	
	freebieson = new Image();
	freebieson.src = "/images/bt_free1.gif";
	freebiesoff = new Image();
	freebiesoff.src = "/images/bt_free.gif";	
	
	guestbookon = new Image();
	guestbookon.src = "/images/bt_gb1.gif";
	guestbookoff = new Image();
	guestbookoff.src = "/images/bt_gb.gif";	
	
	
}


function rollon(imgName)
	{
	if (3 <= iversion) {
	imgOn = eval(imgName + "on.src");
	document[imgName].src = imgOn;
	}
}
function rolloff(imgName) {
	if (3 <= iversion) {
	document[imgName].src = eval(imgName + "off.src");
	}
}
// -->


function openwindow(file)
{

url = "/newwindow.asp?img=/download/calendar/images/"+file;

var hWnd = window.open(url,"openwindow","left=10,top=10,width=775,height=550,resizable=yes,scrollbars=yes");
    if (!hWnd.opener) hWnd.opener = self;
	if (hWnd.focus != null) hWnd.focus();
}