//HOVER EFFEKT PÅ LAGER
function hover(id){
	document.getElementById(id).style.opacity = 0.80;//FF
	document.getElementById(id).style.filter='alpha(opacity=70)';//IE
}
function hoverOut(id){
	document.getElementById(id).style.opacity = 1.0;//FF
	document.getElementById(id).style.filter='alpha(opacity=100)';//IE
}

//ÖPPNAR NYTT FÖNSTER
var new_win_i = 0;
function openWindow(url, width, height){
	new_win_i++;
	var attr = "directories=no,location=no,menubar=no,scrollbars=yes,status=no,resizable=yes,toolbar=no,width="+width+",height="+height;
	setHighlightWindow = window.open(url, "newWindow"+new_win_i, attr);
}

//VISARE MEDDELDANDE I ALERT RUTA
function js_message(mess){
	alert(mess);
}

//BEKRÄFTA ÅTGÄRD
function confirming(){
	if(confirm("Är du säker på att du vill utföra denna åtgärd?\nDet går inte att återställa händelsen i efterhand.")){return;}
	else{return false;}
}

//ÄNDRA BAKGRUNDSFÄRG (Hela dokumentet)
function setBgColor(id, color){
	if(color.length == 6){
		frames['gastboken'].document.getElementById(id).style.backgroundColor = "#"+color;
	}
}

//ÄNDRA TECKENSNITT (Hela dokumentet)
function setFont(id, font){
	frames['gastboken'].document.getElementById(id).style.fontFamily = font;
	frames['gastboken'].document.formular.f_namn.style.fontFamily = font;
	frames['gastboken'].document.formular.f_epost.style.fontFamily = font;
	frames['gastboken'].document.formular.f_hemsida.style.fontFamily = font;
	frames['gastboken'].document.formular.f_ort.style.fontFamily = font;
	frames['gastboken'].document.formular.f_text.style.fontFamily = font;
}

//ÄNDRA TEXTFÄRG (Formuläret)
function setTxtColor(id, color){
	if(color.length == 6){
		frames['gastboken'].document.getElementById(id).style.color = "#"+color;
	}
}

//ÄNDRA RAMFÄRG (Formuläret)
function setBordColor(id, color){
	if(color.length == 6){
		frames['gastboken'].document.getElementById(id).style.borderColor = "#"+color;
		frames['gastboken'].document.formular.f_namn.style.borderColor = "#"+color;
		frames['gastboken'].document.formular.f_epost.style.borderColor = "#"+color;
		frames['gastboken'].document.formular.f_hemsida.style.borderColor = "#"+color;
		frames['gastboken'].document.formular.f_ort.style.borderColor = "#"+color;
		frames['gastboken'].document.formular.f_text.style.borderColor = "#"+color;
		if(frames['gastboken'].document.getElementById('js_smilies')){
			frames['gastboken'].document.getElementById('js_smilies').style.borderColor = "#"+color;
		}
	}
}

//ÄNDRA TEXTFÄLT-BAKGRUNDSFÄRG (Formuläret)
function setInputBgColor(color){
	if(color.length == 6){
		frames['gastboken'].document.formular.f_namn.style.backgroundColor = "#"+color;
		frames['gastboken'].document.formular.f_epost.style.backgroundColor = "#"+color;
		frames['gastboken'].document.formular.f_hemsida.style.backgroundColor = "#"+color;
		frames['gastboken'].document.formular.f_ort.style.backgroundColor = "#"+color;
		frames['gastboken'].document.formular.f_text.style.backgroundColor = "#"+color;
		if(frames['gastboken'].document.getElementById('js_smilies')){
			frames['gastboken'].document.getElementById('js_smilies').style.backgroundColor = "#"+color;
		}
	}
}

//ÄNDRA TEXTFÄLT-BAKGRUNDSFÄRG (Formuläret)
function setInputTxtColor(color){
	if(color.length == 6){
		frames['gastboken'].document.formular.f_namn.style.color = "#"+color;
		frames['gastboken'].document.formular.f_epost.style.color = "#"+color;
		frames['gastboken'].document.formular.f_hemsida.style.color = "#"+color;
		frames['gastboken'].document.formular.f_ort.style.color = "#"+color;
		frames['gastboken'].document.formular.f_text.style.color = "#"+color;
	}
}

//ÄNDRA TEXTFÄLT-TEXTSTORLEK (Formuläret)
function setInputTxtSize(size){
	frames['gastboken'].document.formular.f_namn.style.fontSize = size+"em";
	frames['gastboken'].document.formular.f_epost.style.fontSize = size+"em";
	frames['gastboken'].document.formular.f_hemsida.style.fontSize = size+"em";
	frames['gastboken'].document.formular.f_ort.style.fontSize = size+"em";
	frames['gastboken'].document.formular.f_text.style.fontSize = size+"em";
}

//ÄNDRA TEXTSTORLEK (Formuläret)
function setFormTxtSize(size){
	frames['gastboken'].document.getElementById('namn_label').style.fontSize = size+"em";
	frames['gastboken'].document.getElementById('epost_label').style.fontSize = size+"em";
	frames['gastboken'].document.getElementById('hemsida_label').style.fontSize = size+"em";
	frames['gastboken'].document.getElementById('ort_label').style.fontSize = size+"em";
	frames['gastboken'].document.getElementById('text_label').style.fontSize = size+"em";
}

//ÄNDRA POST-BAKGRUNDSFÄRG
function setPostHeadColor(id, color, antal){
	if(color.length == 6){
		for(var i=1;i<=antal;i++){
			if(frames['gastboken'].document.getElementById(id+i)){
				frames['gastboken'].document.getElementById(id+i).style.backgroundColor = "#"+color;
			}
		}
	}
}

//ÄNDRA POST-RAMSFÄRG
function setPostBordColor(color, antal){
	if(color.length == 6){
		frames['gastboken'].document.getElementById('js_posts').style.borderColor = "#"+color;
		for(var i=1;i<=antal;i++){
			if(frames['gastboken'].document.getElementById('js_post_head_'+i)){
				frames['gastboken'].document.getElementById('js_post_head_'+i).style.borderLeftColor = "#"+color;
				frames['gastboken'].document.getElementById('js_post_head_'+i).style.borderRightColor = "#"+color;
				frames['gastboken'].document.getElementById('js_post_head_'+i).style.borderTopColor = "#"+color;
				frames['gastboken'].document.getElementById('js_post_mess_'+i).style.borderLeftColor = "#"+color;
				frames['gastboken'].document.getElementById('js_post_mess_'+i).style.borderRightColor = "#"+color;
				frames['gastboken'].document.getElementById('js_post_mess_'+i).style.borderBottomColor = "#"+color;
			}
		}
	}
}

//ÄNDRA STRECK-RAMFÄRG
function setLineBordColor(color, antal){
	if(color.length == 6){
		for(var i=1;i<=antal;i++){
			if(frames['gastboken'].document.getElementById('js_post_head_'+i)){
				frames['gastboken'].document.getElementById('js_post_head_'+i).style.borderBottomColor = "#"+color;
			}
		}
	}
}

//ÄNDRA POST-TEXTSFÄRG
function setPostTxtColor(id, color, antal){
	if(color.length == 6){
		for(i=1;i<=antal;i++){
			if(frames['gastboken'].document.getElementById(id+i)){
				frames['gastboken'].document.getElementById(id+i).style.color = "#"+color;
			}
		}
	}
}

//ÄNDRA POST-TEXTSTORLEK
function setPostTxtSize(id, size, antal){
	for(i=1;i<=antal;i++){
		if(frames['gastboken'].document.getElementById(id+i)){
			frames['gastboken'].document.getElementById(id+i).style.fontSize = size+"em";
		}
	}
}

//ÄNDRA LÄNK FÄRG (Hela dokumentet)
function setLinkColor(id, color){
	if(color.length == 6){
		frames['gastboken'].document.linkColor = "#"+color;
	}
}

//ÄNDRA LÄNK FÄRG BESÖKTA LÄNKAR (Hela dokumentet)
function setLinkColorV(id, color){
	if(color.length == 6){
		frames['gastboken'].document.vlinkColor = "#"+color;
	}
}