// JavaScript Document
function switchAddonLayer(id)
{
	if (document.getElementById(id).style.display == 'none')
	{
		for (var i=1;i<8;i++)
		{
			document.getElementById('addon'+i).style.display = 'none';			
		}
		document.getElementById(id).style.display = 'block';
	}
	else
	{
		document.getElementById(id).style.display = 'none';
	}
}

function switchSoundBtn(path,filename)
{
	var d = document.form_preview;
	
	if (d.sound_switch.value == 1)
	{
		d.sound_switch.value = 0;
		document.getElementById('soundloop').src = '';
		document.getElementById('soundoff').src = path+'btn_special_music.gif';
	}
	else
	{
		d.sound_switch.value = 1;
		document.getElementById('soundloop').src = 'soundloop.php?filename='+filename;
		document.getElementById('soundoff').src = path+'btn_soundoff.gif';
	}
}

function smilie(emo) 
{
	document.form_ecard.addon_smilie.value = emo;
	
	document.form_ecard.ecard_msg.value += ''+emo;
	document.form_ecard.ecard_msg.focus();
}

function switchFontSize(size)
{
	document.form_ecard.addon_font_size.value = size;
	document.getElementById('ecard_msg').style.fontSize = size;
}

function switchBgColor(color)
{
	document.form_ecard.addon_bg_color.value = color;
	document.getElementById('ecard_msg').style.backgroundColor = color;
	document.getElementById('ecard_frommail').style.backgroundColor = color;
	document.getElementById('ecard_fromname').style.backgroundColor = color;
	document.getElementById('ecard_toname').style.backgroundColor = color;
	document.getElementById('ecard_tomail').style.backgroundColor = color;
}

function switchFontColor(color)
{
	document.form_ecard.addon_font_color.value = color;
	document.getElementById('ecard_msg').style.color = color;
	document.getElementById('ecard_frommail').style.color = color;
	document.getElementById('ecard_fromname').style.color = color;
	document.getElementById('ecard_toname').style.color = color;
	document.getElementById('ecard_tomail').style.color = color;
}

function switchFontFamiliy(font)
{
	document.form_ecard.addon_font.value = font;
	document.getElementById('ecard_msg').style.fontFamily = font;
	document.getElementById('ecard_frommail').style.fontFamily = font;
	document.getElementById('ecard_fromname').style.fontFamily = font;
	document.getElementById('ecard_toname').style.fontFamily = font;
	document.getElementById('ecard_tomail').style.fontFamily = font;
}
