function ChangeActiveButton(e)
{
	if (e.className == 'btn_off')
	{
		active_btn = document.getElementById('btn_on');
		active_btn.id = '';
		active_btn.firstChild.id = '';
		active_btn.className = 'btn_off';
		active_btn.firstChild.className = 'btn_text';

		e.id = 'btn_on';
		e.className = '';
		e.firstChild.id = 'btn_text_active';
	}
	else if (e.id != 'btn_on')
	{
		e.id = '';
		e.firstChild.id = '';
		e.className = 'btn_off';
		e.firstChild.className = 'btn_text';
	}
}

function addBreadCrumb(title, link)
{
	var crumbs = document.getElementById('breadcrumb');
	var newCrumb = newLink.cloneNode(true);

	newCrumb.href = link;
	newCrumb.appendChild(document.createTextNode(title));

	crumbs.appendChild(document.createTextNode(' > '));
	crumbs.appendChild(newCrumb);
}

//====================================================================
//  PARSING THE LOCATION.SEARCH STRING
//====================================================================
// the constructor takes the location.search string, builds a bunch of arrays
// and attaches some functions to the object
function SearchData(search)
{
	this.keyValuePairs = new Array();
	if (search.length > 1)
	{
		this.search = search.substring(1, search.length); // remove leading "?"
		this.keyValuePairs = this.search.split("&");
	}
	else
	{
		this.search = null;
	}

	// returns an array of the key=value pairs
	this.getKeyValuePairs = function() { return this.keyValuePairs; }

	// returns the value for a specified key
	this.getValue = function(key)
	{
		for(var j=this.keyValuePairs.length; j-- > 0;)
		{
			if(this.keyValuePairs[j].split("=")[0] == key)
				return this.keyValuePairs[j].split("=")[1];
		}
		return false;
	}

	// returns an array of the key names
	this.getParameters = function()
	{
		var a = new Array(this.getLength());
		for(var j=this.keyValuePairs.length; j-- > 0;)
		{
			a[j] = this.keyValuePairs[j].split("=")[0];
		}
		return a;
	}

	// returns a count of key/value pairs
	this.getLength = function() { return this.keyValuePairs.length; }
}
/* usage example:
var test = new SearchData("?name=snitch&color=tabby&volume=loud");
// var test = window.location.search;
alert("parms = "+test.getParameters());
alert("color = "+(test.getValue("color") ? test.getValue("color") : "No color was defined."));
*/
function GoToPage(page, searchstr)
{
	if (searchstr != '') {
		window.location.href = page+'?'+searchstr;
	}
	else {
		window.location.href = page;
	}
}
function Platform_selected(platf)
{
	var arr_subdoms = new Array('palm','pocketpc','symbian-s60','symbian-s80','symbian-s90','uiq','blackberry','symbian-s60-3rd','smartphone','java','uiq3','windows','iphone','xperiax1','symbian-s60-5th','android');
	var p = arr_subdoms[platf-1];
	
	window.location.href = 'http://'+p+'.mobisystems.com/platform.html?p='+platf+'&s';
}

function AddOption(sel, val, txt)
{
	var opt = new Option();
	opt.value = val;
	opt.appendChild(document.createTextNode(txt));
	sel.appendChild(opt);
}
function CountNokiaClicks()
{
	if (window.location.search != '')
	{
		var s = window.location.search+'&nsm';
	}
	else
	{
		var s = '?nsm';
	}
	window.location.href = window.location.pathname+s;
}