// JavaScript Document

function setBorderColor(ele) {
	document.getElementById(ele).style.borderColor = '#ff6600';
	document.getElementById(ele + "text").style.color = '#ff6600';
	// document.getElementById(el).style.width = '90px';
	// document.getElementById(el).style.height = '90px';
}

function resetBorderColor(ele) {
	document.getElementById(ele).style.borderColor = '#dbd1c4';
	document.getElementById(ele + "text").style.color = '#978c76';
	// document.getElementById(el).style.width = '80px';
	// document.getElementById(el).style.height = '80px';
}

function popup(url, name) {
	// mywindow = window.open (url,name,"width=600,height=380");
	mywindow = window
			.open(
					url,
					name,
					"width=600,height=380,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1");
	mywindow.moveTo(0, 0);
	if (window.focus) {
		mywindow.focus()
	}
	return true;
}

function popup2(url, name) {
	// mywindow = window.open (url,name,"width=600,height=380");
	mywindow = window
			.open(
					url,
					name,
					"width=970,height=380,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1");
	mywindow.moveTo(0, 0);
	if (window.focus) {
		mywindow.focus()
	}
	return true;
}

function closeAll() {

	if (document.getElementById("subtab_standard") != null) {
		closeTab("standard", true);
		closeTab("premium", true);
		closeTab("professional", true);
		closeTab("merchant", true);
	}

	if (document.getElementById("subtab_zdf") != null) {
		closeTab("zdf", false);
		closeTab("help", false);
		closeTab("faq", false);
	}

	if (document.getElementById("subtab_news") != null) {
		closeTab("news", false);
		closeTab("kontakt", false);
		// closeTab("konto", false);
		closeTab("mypaylican", false);
		closeTab("bestellungen", false);
		closeTab("stammdaten", false);
	}

	if (document.getElementById("tab_article") != null) {
		closeTab("article", false);
		closeTab("mybestellungen", false);
		// closeTab("konto", false);
		closeTab("statistik", false);
		closeTab("kontakt", false);
		closeTab("stammdaten", false);
	}

	if (document.getElementById("payin") != null) {
		closeTab("account", false);
		closeTab("payin", false);
		closeTab("payout", false);
		closeTab("mypp", false);
	}
}

function showTab(id, sid, cid, color) {
	closeAll();

	if (document.getElementById) // gecko(NN6) + IE 5+
	{
		var obj = document.getElementById("subtab_" + id);

		if (obj != null) {
			obj.style.display = "block";
			var obj = document.getElementById("tab_" + id);

			if (color) {
				obj.className = "maintabtextbigactive_" + color;
			} else {
				obj.className = "maintabtextbigactive";
			}

		}
		if (cid) {

			if (!isNaN(cid)) {
				// ist eine Zahl
				top.mainframe.document.location.href = "/mall/bin/spage/" + sid
						+ "/cmscontent?cid=" + cid + "&l=home";
			} else {
				top.mainframe.document.location.href = cid;
			}

		}
	}

	if (id == 'bestellungen') {
		top.mainframe.document.location.href = "/mall/bin/order_overview?SID="
				+ sid + "&l=mypp";
	}
	if (id == 'mypaylican') {
		top.document.location.href = "/mall/bin/mypaylican?SID=" + sid;
	}
	if (id == 'mypp') {
		top.document.location.href = "/mall/bin/mypp?SID=" + sid;
	}
	if (id == 'payin') {
		top.mainframe.document.location.href = "/mall/bin/payin?SID=" + sid
				+ "&l=mypaylican";
	}
	if (id == 'payout') {
		top.mainframe.document.location.href = "/mall/bin/payout?SID=" + sid
				+ "&l=mypaylican";
	}
	if (id == 'account') {
		top.mainframe.document.location.href = "/mall/bin/account_overview?SID="
				+ sid + "&l=mypaylican";
	}

}

function closeTab(id, idflag) {
	if (document.getElementById) // gecko(NN6) + IE 5+
	{
		var obj = document.getElementById("subtab_" + id);
		obj.style.display = "none";
		var obj = document.getElementById("tab_" + id);

		if (idflag == true) {
			obj.className = "maintabtextbig_" + id;
		} else {
			obj.className = "maintabtextbig";
		}
	}

}

