function lib_bwcheck(){ //Browsercheck (needed)
	this.ver=navigator.appVersion
	this.agent=navigator.userAgent
	this.dom=document.getElementById?1:0
	this.opera5=this.agent.indexOf("Opera 5")>-1
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
	this.ie=this.ie4||this.ie5||this.ie6
	this.mac=this.agent.indexOf("Mac")>-1
	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
	return this
}
var bw=new lib_bwcheck()

//If you want it to move faster you can set this lower, it's the timeout:
var speed = 100

var loop, timer

//Object constructor
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.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=0; 
	this.y=0;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}

// A unit of measure that will be added when setting the position of a layer.
var px = bw.ns4||window.opera?"":"px";

function moveIt(x,y){
	//this.x = x
	this.y = y
	//this.css.left = this.x+px
	this.css.top = this.y+px
}

//Makes the object go up
function goDown(move){
	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)
	}
}

//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll(speed){
	if (scrolltextLoaded){
		loop = true;
		if (speed>0) oScroll.down(speed)
		else oScroll.up(speed)
	}
}

//Stops the scrolling (called on mouseout)
function noScroll(){
	loop = false
	if (timer) clearTimeout(timer)
}
//Makes the object
var scrolltextLoaded = false
function scrolltextInit(){
	oCont = new makeObj('divScrollTextCont')
	oScroll = new makeObj('divText','divScrollTextCont')
	oScroll.moveIt(0,0)
	oCont.css.visibility = "visible"
	scrolltextLoaded = true
}
//Call the init on page load if the browser is ok...
//if (bw.bw) onload = scrolltextInit

///// preload
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		home_over = newImage("../../images/home-over.jpg");
		company_profile_over = newImage("../../images/company-profile-over.jpg");
		downloads_over = newImage("../../images/downloads-over.jpg");
		register_over = newImage("../../images/register-over.jpg");
		contacts_over = newImage("../../images/contacts-over.jpg");
		preloadFlag = true;
	}
}
///// end preload

function WriteText()
{
	document.write ("<div id=\"divScrollTextCont\"><div id=\"divText\">");
	
	document.write ("<p><B><a href=\"http://www.salostorm.com/\" target=\"_blank\">Welcome to Salo Storm Software</a></b><br><br>");

    	document.write ("<b>Monday, 20 February, 2006</b><br>");
    	document.write ("A tutorial for extreme password generator is added.<br><br>");

    	document.write ("<b>Monday, 6 March, 2006</b><br>");
    	document.write ("A new version of Password Spyer 2k (version 2.6) is released.<br><br>");
    	
    	document.write ("<b>Friday, 24 March, 2006</b><br>");
    	document.write ("<a href=\"http://www.salostorm.com/products/EPGPro/index.htm\">Extreme Password Generator Pro</a> is now available for free.<br><br>");

    	document.write ("<b>Monday, 10 May, 2006</b><br>");
    	document.write ("A new version of <a href=\"http://www.salostorm.com/products/FFS/index.htm\">Fast File Splitter</a> is released (version 3.4).<br><br>");

    	document.write ("<b>Friday, 26 May, 2006</b><br>");
    	document.write ("A new article describing different FFS features added.<br><br>");

    	document.write ("<b>Wednesday, 28 June, 2006</b><br>");
    	document.write ("A <a href=\"http://www.salostorm.com/blog\">blog</a> was opened.<br><br>");

	document.write ("</p></div></div>");
}

function WriteTopMenu(ba)
{
	document.write ("<table width=\"770\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"Frame\"><tr>");
	document.write ("<td><a href=\"" + ba + "\"");
	document.write ("onmouseover=\"window.status='home'; changeImages('home', '" + ba + "/images/home-over.jpg'); return true;\"");
	document.write ("onmouseout=\"window.status=''; changeImages('home', '" + ba + "/images/home.jpg'); return true;\">");
	document.write ("<img name=\"home\" src=\"" + ba + "/images/home.jpg\" width=\"129\" height=\"26\" border=\"0\" alt=\"home\"></a></td>");

	document.write ("<td><a href=\"" + ba + "/misc/aboutus.htm\"");
	document.write ("onmouseover=\"window.status='Company Profile'; changeImages('company_profile', '" + ba + "/images/company-profile-over.jpg'); return true;\"");
	document.write ("onmouseout=\"window.status=''; changeImages('company_profile', '" + ba + "/images/company-profile.jpg'); return true;\">");
	document.write ("<img name=\"company_profile\" src=\"" + ba + "/images/company-profile.jpg\" width=\"198\" height=\"26\" border=\"0\" alt=\"Company Profile\"></a></td>");

	document.write ("<td><a href=\"" + ba + "/downloads.htm\"");
	document.write ("onmouseover=\"window.status='Downloads'; changeImages('downloads', '" + ba + "/images/downloads-over.jpg'); return true;\"");
	document.write ("onmouseout=\"window.status=''; changeImages('downloads', '" + ba + "/images/downloads.jpg'); return true;\">");
	document.write ("<img name=\"downloads\" src=\"" + ba + "/images/downloads.jpg\" width=\"140\" height=\"26\" border=\"0\" alt=\"Downloads\"></a></td>");
	
	document.write ("<td><a href=\"" + ba + "/reg.htm\"");
	document.write ("onmouseover=\"window.status='Register Product'; changeImages('Register', '" + ba + "/images/register-over.jpg'); return true;\"");
	document.write ("onmouseout=\"window.status=''; changeImages('Register', '" + ba + "/images/register.jpg'); return true;\">");
	document.write ("<img name=\"Register\" src=\"" + ba + "/images/register.jpg\" width=\"133\" height=\"26\" border=\"0\" alt=\"Register\"></a></td>");
		
	document.write ("<td><a href=\"" + ba + "/support/support.htm\"");
	document.write ("onmouseover=\"window.status='contacts'; changeImages('contacts', '" + ba + "/images/contacts-over.jpg'); return true;\"");
	document.write ("onmouseout=\"window.status=''; changeImages('contacts', '" + ba + "/images/contacts.jpg'); return true;\">");
	document.write ("<img name=\"contacts\" src=\"" + ba + "/images/contacts.jpg\" width=\"130\" height=\"26\" border=\"0\" alt=\"contacts\"></a></td>");
		
	document.write ("<td><img src=\"" + ba + "/images/mend.jpg\" width=\"43\" height=\"26\" alt=\"\"></td></tr></table>");

}

function WriteTopText(ba)
{
	document.write ("<table width=\"770\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"frame\"><tr>");
	document.write ("<td bgcolor=\"#79BEE7\" valign=top class=\"text2\" width=\"388\">");
	document.write ("<img src=\"" + ba + "/images/wel1.jpg\" width=\"388\" height=\"69\" alt=\"\">");
		document.write ("<table><tr><td width=\"40\"></td><td class=\"text2\">");
		document.write ("<span class=\"text1\">Salo Storm Software,</span> ");
		document.write ("We provide useful tools and utilities for Windows platforms <a href=\"" + ba + "/misc/aboutus.htm\" class=\"a\">read more</a></td>");
		document.write ("</tr></table></td>");
	document.write ("<td rowspan=\"2\"><img src=\"" + ba + "/images/main1.jpg\" width=\"385\" height=\"170\" alt=\"\"></td>");
	document.write ("</tr><tr><td valign=\"bottom\" bgcolor=\"#79BEE7\"><img src=\"" + ba + "/images/wel4.jpg\" width=\"388\" height=\"14\" alt=\"\" /></td></tr></table>");
}

function WriteTopHeader(ba)
{
	document.write ("<table width=\"775\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"frame\">");
	document.write ("<tr bgcolor=\"#464646\">");
		document.write ("<td width=\"50\"></td>");
		document.write ("<td width=\"611\"> ");
		document.write ("<img src=\"" + ba + "/images/title.jpg\" width=\"271\" height=\"57\" alt=\"\"></td>");
		document.write ("<td><img src=\"" + ba + "/images/ico1.jpg\" width=\"20\" height=\"102\" alt=\"\"></td>");
		document.write ("<td width=\"81\" colspan=\"2\" align=\"left\" valign=\"top\"><br />");
		document.write ("<table width=\"81\" cellspacing=\"5\">");
		  document.write ("<tr><td width=\"81\"><a href=\"" + ba + "\" class=\"d\">Home</a></tr>");
		  document.write ("<tr><td><a href=\"#\" class=\"d\">Help</a></tr>");
		  document.write ("<tr><td><a href=\"" + ba + "/misc/sitemap.htm\" class=\"d\">Site Map</a></tr>");
	document.write ("</table></td><td width=\"33\"></td></tr></table>");
}