window.onload = function()
{
	var p = parseInt(getVar('p'));
	if(p == 1 || p == 2) buyOrDown(p);
}

function setTab(name,cursel,n){
	for(i=1; i<n; i++){
		var menu = document.getElementById(name + i);
		var con = document.getElementById("con_" + name + "_" + i);
		if(menu == 'undefined' || con == 'undefined') return false;
		menu.className = (i == cursel) ? "hover" : "";
		con.style.display = (i == cursel) ? "block" : "none";
	}
}

function buyOrDown(d)
{
	document.getElementById('twoul').className = 'Menubox2_'+d;
	document.getElementById('two1').className = '';
	document.getElementById('two2').className = '';
	document.getElementById('two'+d).className = 'hover';
	document.getElementById('con_two_1').style.display = 'none';
	document.getElementById('con_two_2').style.display = 'none';
	document.getElementById('con_two_'+d).style.display = 'block';
}

function getVar(key)
{
	if(!window.location.search){
		return false;
	}

	var query = window.location.search.substring(1) + '&';
	var tem = query.split("&");
	var arr = Array();
	var x;

	for(x in tem){
		if(typeof(tem[x]) == 'string'){
			var temp = tem[x] . split("=");
			var title = temp[0];
			var value = temp[1];
			arr[title] = value;
		}
	}

	var typeKey = typeof(arr[key]);

	if(key != ""){
		if(typeKey == 'undefined' || typeKey == 'unknown') return false;
		return arr[key];
	}
	return arr;
}

