﻿// JScript File

function Browser() {
	var ua = navigator.userAgent.toLowerCase();

	// initialize
	this.OS = 'Not Determined';
	this.isWin = false;
	this.isMac = false;
	// set
	if (navigator.appVersion.indexOf("Win") > 0) this.OS = "Win";	
	if (navigator.appVersion.indexOf("Mac") > 0) this.OS = "Mac";
	if (navigator.appVersion.indexOf("Win") > 0) this.isWin = true;	
	if (navigator.appVersion.indexOf("Mac") > 0) this.isMac = true;	
	
	this.isID = (document.getElementById) ? true : false;

	this.isIE = (ua.indexOf("msie") > 0 && ua.indexOf("opera") == -1 && ua.indexOf("webtv") == -1 && ua.indexOf("konqueror") == -1);// 
    this.isNN = (ua.indexOf('netscape') >= 0 || ua.indexOf('gecko') >= 0);
    this.isAOL = ua.indexOf('aol') >= 0; 
    this.isFireFox = ua.indexOf('firefox') >= 0;

	//look for the version number 
	var iVersion = null ;
	if (this.isIE) {
	  var sInfo = navigator.appVersion.toLowerCase().indexOf('msie') + 5;
	  iVersion = parseFloat(navigator.appVersion.substring(sInfo));	 
	} else if (this.isFireFox){
	  var sInfo = ua.lastIndexOf('/') + 1;
	  iVersion = parseFloat(ua.substring(sInfo,ua.length));
	} else if (this.isNN){
	  var sInfo = ua.lastIndexOf('/') + 1;
	  iVersion = parseFloat(ua.substring(sInfo,ua.length));
	}

	this.version = iVersion;

}
var browser = new Browser();

/***************************** ShowBannerDiv Pack ******************************/

function showBannerDiv(el, timing, theHeight, TopToGoto){
	var obj = document.getElementById(el);
	
	if(obj.style.display == 'none'){
		var setTopAt;
		obj.style.display = '';
        
		if(theHeight > 0){
			setTopAt = '-' + (theHeight) + 'px';
		}else{
			setTopAt = (theHeight) + 'px';
		}
		obj.style.top =  setTopAt;
		
		var theFunctionCall = 'slide(\'' + el + '\', \'' + theHeight + '\', \'' + TopToGoto + '\')';
		var IntervalID = window.setInterval(theFunctionCall, timing);
	}	
}

function slide(el, MaxHeight, TopToGoto, dir){
	var obj = document.getElementById(el);

	if(parseInt(obj.style.top) < TopToGoto){
		var myStringT;
			if(browser.isIE){
				myStringT = (parseInt(obj.style.top) + 21) + 'px';
			}else{
				myStringT = (parseInt(obj.style.top) + 10) + 'px';
			}
		obj.style.top = myStringT;
	}

}

function hideBannerDiv(el){
	var obj = document.getElementById(el);
	obj.style.display = 'none';
}

/***************************** End ShowBannerDiv Pack *****************************/


