// version 4.0 06-10-2002, SIMM Business Ventures, auth:Simon Woodward
// added scolling div text routine to emulate marquee tag
// added routine to scroll any given string
// changed default for pseudo code routine to reflect html 4.0 browsers
// changed loadPage function
// version 3.0 08-06-2002:changed layer appear and disappear order
// 
theDays = new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
theMonths = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct",
                        "Nov","Dec");
hValues = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");
var toId = new Array();
startLeft = 0;
finTop = 0;
SBV_getBT();
SBV_getBrowserType();
function SBV_getBrowserType() {
	netscape = false;
	ie = false;
	if (parseInt(navigator.appVersion) >= 4) {
		if (navigator.appName == "Microsoft Internet Explorer"){
			ie = true;
			netscape = false ;
			}
		if (navigator.appName == "Netscape"){
			netscape = true;
			ie = false ;
			}
	}
}
function SBV_binfo(){
    var n = new Object(window.navigator);
    var s = new Object(window.screen);
    var b = "";
    b = n.appName + "^" + n.appVersion + "^" + s.width + "^" + s.height ;
    b += "^" + n.userAgent+"^"+n.platform;
return b;
}
function SBV_brwserInfo(itemN){
    var brw = SBV_binfo().split("^");
return brw[itemN];
}
function SBV_scrollString(SBVstring){
	SBVnewString = SBVstring.substring(1,SBVstring.length)+SBVstring.substring(0,1);
return SBVnewString;
}
function SBV_scrollMsg(){
    window.status = statusMsg;
    statusMsg = SBV_scrollString(statusMsg);
    setTimeout("SBV_scrollMsg()",97);    
}
function SBV_funcSequencer(funcList,cntr){
	lp=funcList.length-1;
	if (cntr>lp)return;
	fT=funcList[cntr].split("?");
	f=fT[0];t=fT[1];
	cntr++;
	callSlf=";SBV_funcSequencer(funcTime,"+cntr+");";
	execString='toId['+cntr+']=set';
	execString+="Timeout(\""+f+callSlf+"\","+t+");";
	// if (!window.confirm(execString))return;
	eval(execString);
}
function SBV_getBT() {
	// © SIMM Business Ventures 2001, 2002
	// web page pseudo-code generator
	isIE = false; isNS = false; isNS6 = false;
	brwsr = SBV_brwserInfo(0)+parseInt(navigator.appVersion);
	//alert(SBV_binfo());
	switch(brwsr) {
		case 'Microsoft Internet Explorer4':
			isIE = true;
			dom = "document.all['";
			tDom = "'].style.";
			iDom = "'].";
		break;
		case 'Netscape4':
			isNS = true ;
			dom = "document['" ;
			tDom = "']."; iDom = tDom;
		break;
		case 'Netscape5':
			isNS6 = true ;
			dom = "document.getElementById('";
			tDom = "').style.";
			iDom = "').";
		break;
		default:
			isIE = true;
			dom = "document.getElementById('";
			tDom = "').style.";
			iDom = "').";
	}
}
function SBV_updateDivHTML(dataPath,divId,h,w,frm){
	frms = "";
	if (frm!=null){
		frms="parent.frames['"+frm+"'].";
		}
	htmlString = "<object data=\\\"";
	htmlString += dataPath + "\\\" type=\\\"text/html\\\" height=\\\""+h+"\\\" width=\\\""+w+"\\\">Oh no";
	htmlString += "</object>";
	execString = frms + dom + divId +iDom + "innerHTML = " ;
	execString += "\"" + htmlString + "\"";
	//if (!window.confirm(execString))return;
	eval(execString);
}
function SBV_scrollUp(divId,speedInMS,finalTop,stepping,curPos,frm){
	frms = "";
	if (frm!=null){
		frms="parent.frames['"+frm+"'].";
		}
	if (curPos>finalTop){
		curPos-=stepping;
		execString=frms+dom+divId+tDom+'top='+curPos;
		eval(execString);
		execString="setTimeout('SBV_scrollUp(";
		execString+='"'+divId+'",'+speedInMS+','+finalTop+','+stepping+','+curPos+','+frm+")',"+speedInMS+');';
		//if (!window.confirm(execString))return;
		eval(execString);
		} else {
			curPos=finalTop;
			execString=frms+dom+divId+tDom+'top='+curPos;
			eval(execString);
			}
}
function SBV_binfo(){
    var n = new Object(window.navigator);
    var s = new Object(window.screen);
    var b = "";
    b = n.appName + "^" + n.appVersion + "^" + s.width + "^" + s.height ;
    b += "^" + n.userAgent+"^"+n.platform;
return b;
}
function SBV_brwserInfo(itemN){
    var brw = SBV_binfo().split("^");
return brw[itemN];
}
function SBV_marquee(SBVdivTag,SBVtext,SBVspeed,SBVtextLen,SBVfrm){
// html 4.0 , JS1.3 compliant browsers only
	//if (!window.confirm(execString))return;
	frms = "";
	if (SBVfrm!=null){
		frms="parent.frames['"+SBVfrm+"'].";
		}
	//modify marquee text
	SBVtext = SBV_scrollString(SBVtext);
	displayText=SBVtext.substring(0,SBVtextLen);
	//if (!window.confirm(displayText))return;
	execString = frms+dom+SBVdivTag+iDom+"innerHTML=\""+displayText+"\";";
	//execString = frms+dom+SBVdivTag+iDom+"innerHTML=\""+SBVtext+"\";";
	//write out marquee text
	eval(execString);
	execString = "setTimeout(\"SBV_marquee('"+SBVdivTag+"','"+SBVtext+"',"+SBVspeed;
	(SBVtextLen)?SBVtextLen=","+SBVtextLen:SBVtextLen="";
	(SBVfrm)?endStr=SBVtextLen+","+SBVfrm+")\","+SBVspeed+");":endStr=SBVtextLen+")\","+SBVspeed+");";
	execString += endStr;
	//if (!window.confirm(execString))return;
	eval(execString);
}
function SBV_changeLayer(appear,disappear,frm){
	var app = appear.split(",");
	var dis = disappear.split(",");
	var frms = "";
	if (frm!=null){
		frms="parent.frames['"+frm+"'].";
		}
	if (disappear!=""){
		for (i=0;i<dis.length;i++){
			var execString = frms+dom+dis[i]+tDom+'visibility="hidden";';
			eval(execString);
			}	
		}
	if (appear!=""){
		for (i=0;i<app.length;i++){
			var execString = frms+dom+app[i]+tDom+'visibility="visible";';
			eval(execString);
			}
		}
}
function SBV_changeHTML(SBVdivTag,SBVhtmlUpdate,SBVfrm){
	var frms = "";
	if (SBVfrm!=null){
		frms="parent.frames['"+SBVfrm+"'].";
		}
	execString = frms+dom+SBVdivTag+iDom+"innerHTML=\'"+SBVhtmlUpdate+"\';";
	//if (!window.confirm(execString))return;
	eval(execString);
}
function SBV_newWindow(url,name,size,offset,otherFeat){
	// modified to extend allowable window features 22/9/2001
	var sz = size.split(",");
	var os = offset.split(",");
	var h = sz[0];
	var w = sz[1];
	var l = os[0];
	var t=os[1];
	if (ie){
		var x = "left="+l+",";
		var y = "top="+t+",";
		}
	if (netscape){
		var x = "screenX="+l+",";
		var y = "screenY="+t+",";
		}
	var featureSet=x+y+'height='+h+',width='+w;
	if (otherFeat!=null) featureSet+=","+otherFeat;
	execString=name+'=window.open("'+url+'","'+name+'","'+featureSet+'");';
	eval(execString);
	// if (!window.confirm(execString))return;
	execString=name+".window.focus();";
	eval(execString);
}
function SBV_mmgLeft2R(whichText,lOffSet,distance,speed) {
    var exeString = dom+whichText+tDom+"left="+lOffSet+";";
    eval(exeString);
    lOffSet = lOffSet + distance ;
    var exeString = "setTimeout('SBV_mmgLeft2R(";
    exeString += '"'+whichText+'"';
    exeString += ","+lOffSet+","+distance+","+speed+")',"+speed+");";
    if (lOffSet<410) eval(exeString);
}
function SBV_stopNoise(){
	(WM_easyDetect('realaudio')==1)?document.embeds[0].DoStop():nothing2do=1;
}

function SBV_colrLoop(cntr,idTags){
	ids=idTags.split(",");
	actColr=255-cntr;
	unitNum=actColr%16;
	baseNum=((actColr==0)?0:parseInt(actColr/16));
	colr="0000"+hValues[baseNum]+hValues[unitNum];
	colb=hValues[baseNum]+hValues[unitNum]+"0000";
	execString=dom+ids[0]+tDom+'color="'+colr+'";';
	execString+=dom+ids[1]+tDom+'color="'+colb+'";';
	cntr=cntr+8;
	if(cntr<256){
		eval(execString);
		execString="setTimeout('SBV_colrLoop("+cntr+",\""+idTags+"\")',80);";
		eval(execString);
		}	
}
function SBV_scrollOut(whichDiv,whichDiv_Width,finalLeftPos,yTop,speedInSecs) {
	if (moveLeft==9999){
		execString = dom+whichDiv+tDom+"top="+yTop+";";
		eval(execString);
		execString = dom+whichDiv+tDom+"width="+whichDiv_Width+";";
		eval(execString);
		execString = dom+whichDiv+tDom+"left=-"+whichDiv_Width+";";
		eval(execString);
		execString = dom+whichDiv+tDom+'visibility="'+'visible'+'";';
		eval(execString);
		moveLeft=0-whichDiv_Width;
		}
	if (moveLeft<finalLeftPos){
		execString = dom+whichDiv+tDom+"left="+moveLeft+";"; 
		eval(execString);
		moveLeft+=15;
		speedInMS = speedInSecs*1000;
		execString = "setTimeout('SBV_scrollOut(";
		execString += '"'+whichDiv+'",'+whichDiv_Width+','+finalLeftPos+','+yTop+','+speedInSecs;
		execString += ")',"+speedInMS+");";
		eval(execString);
		} else {
			if (elCount<textEl.length){
				elCount++;
				moveLeft=9999;
				execString = "eval(textEl["+elCount+"]);";
				eval(execString);
				} else elCount = 0;
			}		
}
function SBV_displayTime(dt){
    var now = new Date();
    tTime = theDays[now.getDay()]+" "+now.getDate()+" ";
    tTime += theMonths[now.getMonth()]+" "+now.getFullYear()+".";
    if (dt==1){
        theMins = now.getMinutes();
        theTest = parseInt(theMins);
        if (theTest < 10){
            theMins = "0" + theMins ;
            }
        tTime += "<br>"+now.getHours()+":"+theMins+"h";
        }
 return tTime;
}
function SBV_ldPage(whatToLoad,frameNumber) {
	parent.frames[frameNumber].location = whatToLoad ;
}


