
// (c)2002 SoftByte Labs - http://SoftByteLabs.com

basePath = ''

FN0 = 'sblBanner'
FN1 = 'sblMenu'

Browser = navigator.appName

if (Browser == "Netscape") {
	Browser = "ns"
} else if ((Browser == "Opera") || (navigator.userAgent.indexOf("Opera") > 0)) {
	Browser = "opera"
}	else if (Browser == "Microsoft Internet Explorer") {
	Browser = "ie"
}	else {
	Browser = "other"
}


function ProgVer(prg) {
	var rslt = new String("     ")
	switch (prg) {
		case "BW": rslt = "v4.35" ; break
		case "B3": rslt = "v3.63" ; break
		case "CP": rslt = "v2.20" ; break
		case "CO": rslt = "v3.02" ; break
		case "CM": rslt = "v2.19" ; break
		case "MX": rslt = "v3.41" ; break
		case "NW": rslt = "v3.15" ; break
		case "SP": rslt = "v4.33" ; break
		case "XP": rslt = "v2.00" ; break
		case "SD": rslt = "5.1.43.19" ; break
	}
	return rslt
}


function ProgDate(prg) {
	var rslt = new String("           ")
	switch (prg) {
		case "BW": rslt = "14-Oct-2002" ; break
		case "B3": rslt = "10-Aug-1998" ; break
		case "CP": rslt = "20-Dec-1999" ; break
		case "CO": rslt = "30-Oct-2002" ; break
		case "CM": rslt = "19-Nov-1998" ; break
		case "MX": rslt = "25-Jul-2002" ; break
		case "NW": rslt = "20-May-2002" ; break
		case "SP": rslt = " 2-Jan-2000" ; break
		case "XP": rslt = "24-Jul-1997" ; break
		case "SD": rslt = "25-Jan-1998" ; break
	}
	return rslt
}


function ProgSize(prg) {
	var rslt = new String("         ")
	switch (prg) {
		case "BW": rslt = "2,098,059" ; break
		case "B3": rslt = "1,549,763" ; break
		case "CP": rslt = "  520,324" ; break
		case "CO": rslt = "1,508,545" ; break
		case "CM": rslt = "1,549,567" ; break
		case "MX": rslt = "1,972,498" ; break
		case "NW": rslt = "  880,698" ; break
		case "SP": rslt = "  581,869" ; break
		case "XP": rslt = "1,400,981" ; break
		case "SD": rslt = "1,570,331" ; break
	}
	return rslt
}


function WriteProgVer(doc,prg) {
	switch (prg) {
		case "BW": doc.write(ProgVer("BW")) ; break
		case "B3": doc.write(ProgVer("B3")) ; break
		case "CP": doc.write(ProgVer("CP")) ; break
		case "CO": doc.write(ProgVer("CO")) ; break
		case "SP": doc.write(ProgVer("SP")) ; break
		case "CM": doc.write(ProgVer("CM")) ; break
		case "NW": doc.write(ProgVer("NW")) ; break
		case "MX": doc.write(ProgVer("MX")) ; break
		case "XP": doc.write(ProgVer("XP")) ; break
		case "SD": doc.write(ProgVer("SD")) ; break
	}
}


function WriteCopyright(doc) {
	doc.write("<center><font size=-2>Copyright (c)1986-2002 SoftByte Laboratories. All rights reserved.</font></center>")
}


function CheckFrames(f1,f2) {
	if (self.location.protocol == "file:") {
		cmd = top.location.href.split("///")
		cmd = cmd[1].split("?")
		cmd = cmd[0].split("/")
		if (cmd[cmd.length-1] != "Frames.html") {
			newurl = basePath+"Frames.html?f1="+f1+"&f2="+f2
			top.location.replace(newurl)
		}
	} else {
		cmd = top.location.href.split("//")
		tmp = cmd[0].toLowercase
		if ((tmp == "http:") || (tmp == "https:")) {
			cmd = cmd[1].split("?")
			cmd = cmd[0].split("/")
			if (cmd[cmd.length-1] != "Frames.html") {
				newurl = basePath+"Frames.html?f1="+f1+"&f2="+f2
				top.location.replace(newurl)
			}
		} else {
			if (top.location.href.indexOf("Frames.html") == -1) {
				newurl = basePath+"Frames.html?f1="+f1+"&f2="+f2
				top.location.replace(newurl)
			}
		}
	}
}


function MakeFrames(frm1,frm2) {
	with (top.document) {
		writeln('<script src="'+basePath+'sbl.js"></script>')
		writeln('<frameset cols="*">')
		writeln('<frameset rows="120,*" border="0" frameborder="0" framespacing="0">')
		writeln('<frame name="'+FN0+'" src="'+frm1+'" noresize scrolling="no"  marginheight="0" marginwidth="0">')
		writeln('<frame name="'+FN1+'" src="'+frm2+'" noresize scrolling="yes" marginheight="0" marginwidth="0">')
		writeln('</frameset>')
		writeln('</frameset>')
	}
}


function GetDomain(TheURL) {
	theAry = TheURL
	thePrt = theAry.split('//')
	theRes = thePrt[1]
	theDom = theRes.split('/')
	theItm = theDom[0].split('.')
	if (theItm[1]) {
		if ((theItm[1].toLowerCase() == 'net') || (theItm[1].toLowerCase() == 'com')) {
			return theDom[0]
		} else {
			return theItm[1] + '.' + theItm[2]
		}
	} else {
		return ''
	}
}


function GetDomExt(TheDom) {
	var str = TheDom.split('.')
	return str[str.length-1].toLowerCase()
}


function ProdPopup(w,h,i,t) {
	if (Browser == "ns") {
		y = (top.window.outerHeight-h)/2 + top.window.screenY
		x = (top.window.outerWidth-w)/2 + top.window.screenX
	} else {
		y = (top.document.body.clientHeight-h)/2 + top.window.screenTop
		x = (top.document.body.clientWidth-w)/2 + top.window.screenLeft
	}
	imgwin = window.open('','','scrollbars=no, top='+y+',left='+x+',width='+w+',height='+h)
	if (!imgwin.opener) imgwin.opener = self
	with (imgwin.document) {
		open()
		writeln('<html><body><img src="'+i+'" style="position:absolute; top:0px; left:0px;" onClick=window.close()></body></html>')
		close()
	}
	w=450
	h=175
	if (Browser == "ns") {
		y = (imgwin.outerHeight-h)/2 + imgwin.screenY
		x = (imgwin.outerWidth-w)/2 + imgwin.screenX
	} else {
		y = (imgwin.document.body.clientHeight-h)/2 + imgwin.screenTop
		x = (imgwin.document.body.clientWidth-w)/2 + imgwin.screenLeft
	}
	txtwin = window.open('','','resizable=yes, scrollbars=no, top='+y+',left='+x+',width='+w+',height='+h)
	if (!txtwin.opener) txtwin.opener = self
	with (txtwin.document) {
		open()
		writeln(
		'<html>\n'+
		'<script>\n'+
		'Browser = "'+Browser+'"\n'+
		'function SelfResize() {\n'+
		'  if (Browser == "ns") {\n'+
		'    h = document.getElementById("tb").offsetHeight - window.innerHeight\n'+
		'  } else {\n'+
		'    h = tb.offsetHeight - document.body.clientHeight\n'+
		'  }\n'+
		'  self.resizeBy(0,h)}\n'+
		'</script>\n'+
		'<body bgcolor="FFFFE1" style="margin:0 0 0 0;" onLoad="SelfResize()">\n'+
		'<table id="tb" cellpadding=8>\n'+
		'  <tr align="center">\n'+
		'    <td>\n'+
		'      '+t+'\n'+
		'      <p><center><input type=button value="Close" onClick=window.close()></center>\n'+
		'    </td>\n'+
		'  </tr>\n'+
		'</table>\n'+
		'</body>\n'+
		'</html>')
		close()
	}
}

// END

