window.buttons = 0;
var boxes = {
	add: function(type, title){
		if(type==1){
			document.getElementById("boxes").innerHTML = '<div id="actual_box"><iframe src="http://friend-portal.de/popup/profil_tv.php?yt='+title+'" style="width: 772px; height: 500px; position: fixed; margin-top: 100px;" scrolling="no" frameborder="0"></iframe><button><img src="/img/boxes/buttons/no.png" alt="Close" onClick="boxes.close();"><b>Schlie&szlig;en</b></button></div>';
			document.getElementById("actual_box").style.marginLeft = (screen.availWidth/2-386)+"px";
		} else {
			document.getElementById("boxes").innerHTML = '<div class="box" id="actual_box"><div class="box_top"></div><div class="box_content" id="actual_box_content"><img src="/img/boxes/'+type.toLowerCase()+'.png" alt="'+type.toUpperCase()+'" /><b>'+title+'</b><br/></div><div class="box_bottom"></div></div>';
			document.getElementById("actual_box").style.marginLeft = (screen.availWidth/2-256)+"px";
		}
	},
	addText: function(str){
		document.getElementById("actual_box_content").innerHTML += str+"<br/><br/>";
	},
	addPage: function(url, width, height, scrolling){
		var scroll = scrolling==true?"yes":"no";
		document.getElementById("actual_box_content").innerHTML += "<iframe src='"+url+"' style='width: "+width+"px; height: "+height+"px;' scrolling='"+scroll+"' frameborder='0'></iframe><br/><br/>";
	},
	addButton: function(title, type, func){
		window.buttons++;
		document.getElementById("actual_box_content").innerHTML += '<button id="box_button_'+window.buttons+'"><img src="/img/boxes/buttons/'+type.toLowerCase()+'.png" alt="'+type.toUpperCase()+'"><b>'+title+'</b></button>';
		document.getElementById("box_button_"+window.buttons).onclick = func;
	},
	addCode: function(code){
		document.getElementById("actual_box_content").innerHTML += code;
	},
	addCode: function(code){
		document.getElementById("actual_box_content").innerHTML += code;
	},
	disableButton: function(num){
		var bs = document.getElementById("actual_box_content").getElementsByTagName("button");
		var b = bs.item(num-1);
		b.onclick=void(0);
		b.onfocus=function(){this.blur();};
		b.style.color = '#828282';
		b.style.borderTop = '1px solid #000000';
		b.style.borderLeft = '1px solid #000000';
		b.style.borderRight = '1px solid #333333';
		b.style.borderBottom = '1px solid #333333';
		b.style.background = '#232323';
		b.style.cursor = 'default';
	},
	show: function(){
		main.show(document.getElementById("overall"), 70);
		window.setTimeout('document.getElementById("actual_box").style.display = "block";', 700);
	},
	close: function(){
		main.hide(document.getElementById("overall"), 70);
		window.setTimeout('document.getElementById("actual_box").style.display = "none";', 100);
	}
}
