function highlight_active_menuitem() {
	try{document.getElementById('active_menu').className = document.getElementById('active_menu').className + '_active';}catch(e){}
}
function styleaktiv(form) {
	if(form.className == "inputbox") form.className = "inputbox_aktiv";
		else form.className = "inputbox";
}
function resizeIFrame() {
	try{iFrameHeight();}catch(e){}
}
function resizeMainDiv() {
	var MainDivHeight = 540;
	if (window.innerHeight) {
		MainDivHeight = (window.innerHeight - 209 + 170);
	}else if (document.documentElement && document.documentElement.offsetHeight) {
		MainDivHeight = (document.documentElement.offsetHeight - 209 + 170);
	}
	try{document.getElementById('MainDiv').style.height = MainDivHeight+'px';}catch(e){}
	return MainDivHeight;
}
function scroll_up_MainDiv() {
	document.getElementById('MainDiv').scrollTop = 0;
}

function Set_Cookie(name,value,expires){
	var today = new Date();
	today.setTime( today.getTime() );
	if ( expires ){
		expires = expires * 1000 * 60;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	document.cookie = name+"="+escape(value)+((expires)?";expires="+expires_date.toGMTString():"");
}
function Get_Cookie(name){
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if(( !start )&&( name != document.cookie.substring( 0, name.length ))){
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function domcheck_remember(x,y,z){
	Set_Cookie('dom_check',''+x+'',10);
	Set_Cookie('dom_name',''+y+'',10);
	Set_Cookie('dom_tld',''+z+'',10);
}
function domcheck_form_preset(){
	if(Get_Cookie('dom_name')!=null && Get_Cookie('dom_name')!='null' && Get_Cookie('dom_name')!=''){
		try{document.getElementById('dom_name').value = Get_Cookie('dom_name');}catch(e){}
		try{document.getElementById('dom_tld').value = Get_Cookie('dom_tld');}catch(e){}
	}
}

var show_box1 = 0;
var show_box2 = 0;
var show_box3 = 0;
var show_box4 = 0;
var show_box5 = 0;
var show_box6 = 0;
var top_box1 = 60;
var top_box2 = 80;
var top_box3 = 0;
var top_box4 = 0;
var top_box5 = 100;
var top_box6 = 120;
function hide_box_all_but_self(box_self){
	if(box_self!=1){
		try{document.getElementById('box1_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/down.gif";}catch(e){}
		try{document.getElementById('divbox1_1').style.visibility = "hidden";}catch(e){}
		show_box1 = 0;
	}
	if(box_self!=2){
		try{document.getElementById('box2_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/down.gif";}catch(e){}
		try{document.getElementById('divbox2_1').style.visibility = "hidden";}catch(e){}
		show_box2 = 0;
	}
	if(box_self!=5){
		try{document.getElementById('box5_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/down.gif";}catch(e){}
		try{document.getElementById('divbox5_1').style.visibility = "hidden";}catch(e){}
		show_box5 = 0;
	}
	if(box_self!=6){
		try{document.getElementById('box6_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/down.gif";}catch(e){}
		try{document.getElementById('divbox6_1').style.visibility = "hidden";}catch(e){}
		show_box6 = 0;
	}
}
function move_box_init(){
	try{document.getElementById('divbox1').style.top = top_box1+'px';}catch(e){}
	try{document.getElementById('divbox2').style.top = top_box2+'px';}catch(e){}
	try{document.getElementById('divbox3').style.top = top_box3+'px';}catch(e){}
	try{document.getElementById('divbox4').style.top = top_box4+'px';}catch(e){}
	try{document.getElementById('divbox5').style.top = top_box5+'px';}catch(e){}
	try{document.getElementById('divbox6').style.top = top_box6+'px';}catch(e){}
}
function move_box_below(box_self){
	if(box_self==1){
		try{document.getElementById('divbox2').style.top = 234+'px';}catch(e){}
		try{document.getElementById('divbox5').style.top = 254+'px';}catch(e){}
		try{document.getElementById('divbox6').style.top = 274+'px';}catch(e){}
	}
	if(box_self==2){
		try{document.getElementById('divbox5').style.top = 266+'px';}catch(e){}
		try{document.getElementById('divbox6').style.top = 286+'px';}catch(e){}
	}
	if(box_self==5){
		try{document.getElementById('divbox6').style.top = 280+'px';}catch(e){}
	}
}
function show_box_header_all(){
	try{document.getElementById('divbox1').style.visibility = "visible";}catch(e){}
	try{document.getElementById('divbox2').style.visibility = "visible";}catch(e){}
	try{document.getElementById('divbox5').style.visibility = "visible";}catch(e){}
	try{document.getElementById('divbox6').style.visibility = "visible";}catch(e){}
}
function box_init(){
	move_box_init();
	if(Get_Cookie('box')<=0){
		hide_box_all_but_self(0);
	}else if(Get_Cookie('box')==1){
		hide_box_all_but_self(1);
		show_hide_box1();
		domcheck_form_preset();
	}else if(Get_Cookie('box')==2){
		hide_box_all_but_self(2);
		show_hide_box2();
	}else if(Get_Cookie('box')==5){
		hide_box_all_but_self(5);
		show_hide_box5();
	}else if(Get_Cookie('box')==6){
		hide_box_all_but_self(6);
		show_hide_box6();
	}
}

// Domain-Check
function show_hide_box1(){
	move_box_init();
	hide_box_all_but_self(1);
	if(show_box1){
		try{document.getElementById('box1_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/down.gif";}catch(e){}
		try{document.getElementById('divbox1_1').style.visibility = "hidden";}catch(e){}
		show_box1 = 0;
		Set_Cookie('box',0,10);
	}else{
		try{document.getElementById('box1_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/up.gif";}catch(e){}
		try{document.getElementById('divbox1_1').style.visibility = "visible";}catch(e){}
		move_box_below(1);
		show_box1 = 1;
		Set_Cookie('box',1,10);
	}
}
// Viren-Meldungen
function show_hide_box2(){
	move_box_init();
	hide_box_all_but_self(2);
	if(show_box2){
		try{document.getElementById('box2_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/down.gif";}catch(e){}
		try{document.getElementById('divbox2_1').style.visibility = "hidden";}catch(e){}
		show_box2 = 0;
		Set_Cookie('box',0,10);
	}else{
		try{document.getElementById('box2_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/up.gif";}catch(e){}
		try{document.getElementById('divbox2_1').style.visibility = "visible";}catch(e){}
		move_box_below(2);
		try{
			var temp = '';
			for (var i=0; i<tenalerts.length/3; i++) {
				document.getElementById('tt_akt_'+i+'_1').innerHTML = tenalerts[i*3+0];
				temp = tenalerts[i*3+1].replace(/<br>/,"&nbsp;-&nbsp;");
				if(temp.length>20){temp = temp.substring(0,16)+' ...';}
				document.getElementById('tt_akt_'+i+'_2').innerHTML = '<a class=\"alink\" href=\"'+tenalerts[i*3+2]+'\" target=\"WinSophos\">'+temp+'</a>';
			}
		}catch(e){}
		show_box2 = 1;
		Set_Cookie('box',2,10);
	}
}
// Statistik
function show_hide_box5(){
	move_box_init();
	hide_box_all_but_self(5);
	if(show_box5){
		try{document.getElementById('box5_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/down.gif";}catch(e){}
		try{document.getElementById('divbox5_1').style.visibility = "hidden";}catch(e){}
		show_box5 = 0;
		Set_Cookie('box',0,10);
	}else{
		try{document.getElementById('box5_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/up.gif";}catch(e){}
		try{document.getElementById('divbox5_1').style.visibility = "visible";}catch(e){}
		move_box_below(5);
		show_box5 = 1;
		Set_Cookie('box',5,10);
	}
}
// Aphorismen
function show_hide_box6(){
	move_box_init();
	hide_box_all_but_self(6);
	if(show_box6){
		try{document.getElementById('box6_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/down.gif";}catch(e){}
		try{document.getElementById('divbox6_1').style.visibility = "hidden";}catch(e){}
		show_box6 = 0;
		Set_Cookie('box',0,10);
	}else{
		try{document.getElementById('box6_img').src = "http://www.schrettenbrunner.net/cms/cms/templates/v0/images/up.gif";}catch(e){}
		try{document.getElementById('divbox6_1').style.visibility = "visible";}catch(e){}
		show_box6 = 1;
		Set_Cookie('box',6,10);
	}
}


