
var AlertTitle="\n# DIDA-ASBL.Org: ";

function ChangeStyleProperty(strElementID, strProperty, mixValue)
{
	
	var element=document.getElementById(strElementID);
	
	switch(strProperty)
	{
		case "backgroundImage":		element.style.backgroundImage = mixValue
									break

		case "Opacity":				element.style.opacity = mixValue
									break

		default:					break
	}

}

function ToggleElementHide(strElementID)
{

	var element=document.getElementById(strElementID);

	if(element.style.display=="block")
	{
		element.style.display="none"
	}
	else
	{ element.style.display="block" }

}

function ToggleElementShow(strElementID)
{

	var element=document.getElementById(strElementID);

	if(element.style.display=="none")
	{ element.style.display="block" }
	else
	{ element.style.display="none" }

}

function AddBookmark(strTitle, strURL)
{

	var title=strTitle
	var url=strURL

	if (window.sidebar) window.sidebar.addPanel(title, url,"");
	else if(window.opera && window.print)
	{
		var mbm=document.createElement("a");
		mbm.setAttribute("rel","sidebar");
		mbm.setAttribute("href",url);
		mbm.setAttribute("title",title);
		mbm.click();
	}
	else if(document.all) window.external.AddFavorite(url, title);

}

function CheckFormEMail(strLang)
{

	var NAME=document.F_EMAIL.FF_NAME.value;
	var EMAIL=document.F_EMAIL.FF_EMAIL.value;
	var SUBJECT=document.F_EMAIL.FF_SUBJECT.value;
	var MESSAGE=document.F_EMAIL.FF_MESSAGE.value;
	var SECURITYREAD=document.F_EMAIL.FF_SECURITYREAD.value;
	var SECURITYWRITE=document.F_EMAIL.FF_SECURITYWRITE.value;

	switch(strLang)
	{
		case "fr":		strMsg=AlertTitle+"svp, verifiez les champs (voir example qui suit)...\n\nvotre nom: John Doe\n\nvotre e-mail: johndoe@email.net\n\nsujet de votre message: howdy!\n\nvotre message: hello world...\n\ncode de securite: 000000\n"
						break
		case "pt":		strMsg=AlertTitle+"por favor, verifique os campos (veja o exemplo a seguir)...\n\no seu nome: John Doe\n\no seu e-mail: johndoe@email.net\n\no assunto da mensagem: howdy!\n\na sua mensagem: hello world...\n\ncodigo de seguranca: 000000\n"
						break
		case "en":		strMsg=AlertTitle+"please, check your form fields (see the example below)...\n\nyou name: John Doe\n\nyour e-mail: johndoe@email.net\n\nsubject of your message: howdy!\n\nyour message: hello world...\n\nsecurity code: 000000\n"
						break
		default:		strMsg=AlertTitle+"please, check your form fields (see the example below)...\n\nyou name: John Doe\n\nyour e-mail: johndoe@email.net\n\nsubject of your message: howdy!\n\nyour message: hello world...\n\nsecurity code: 000000\n"
						break
	}
	
	if (NAME.length!=0 && EMAIL.indexOf(" ")==-1 && 0<EMAIL.indexOf("@") && EMAIL.indexOf("@")+1 < EMAIL.length && SUBJECT.length!=0 && MESSAGE.length!=0 && SECURITYREAD==hex_md5(hex_sha1(SECURITYWRITE)))
	{
		document.F_EMAIL.submit();
		return true;
	}
	else
	{
		alert (strMsg);
		return false;
	}

}

function CheckFormBlogPost(strLang)
{

	var NAME=document.F_BLOGPOST.FF_NAME.value;
	var EMAIL=document.F_BLOGPOST.FF_EMAIL.value;
	var SUBJECT=document.F_BLOGPOST.FF_SUBJECT.value;
	var MESSAGE=document.F_BLOGPOST.FF_MESSAGE.value;
	var SECURITYREAD=document.F_BLOGPOST.FF_SECURITYREAD.value;
	var SECURITYWRITE=document.F_BLOGPOST.FF_SECURITYWRITE.value;
	
	switch(strLang)
	{
		case "fr":		strMsg=AlertTitle+"svp, verifiez les champs (voir example qui suit)...\n\nvotre nom: John Doe\n\nvotre e-mail: johndoe@email.net\n\nsujet de votre message: howdy!\n\nvotre message: hello world...\n\ncode de securite: 000000\n"
						break
		case "pt":		strMsg=AlertTitle+"por favor, verifique os campos (veja o exemplo a seguir)...\n\no seu nome: John Doe\n\no seu e-mail: johndoe@email.net\n\no assunto da mensagem: howdy!\n\na sua mensagem: hello world...\n\ncodigo de seguranca: 000000\n"
						break
		case "en":		strMsg=AlertTitle+"please, check your form fields (see the example below)...\n\nyou name: John Doe\n\nyour e-mail: johndoe@email.net\n\nsubject of your message: howdy!\n\nyour message: hello world...\n\nsecurity code: 000000\n"
						break
		default:		strMsg=AlertTitle+"please, check your form fields (see the example below)...\n\nyou name: John Doe\n\nyour e-mail: johndoe@email.net\n\nsubject of your message: howdy!\n\nyour message: hello world...\n\nsecurity code: 000000\n"
						break
	}
	if (NAME.length!=0 && EMAIL.indexOf(" ")==-1 && 0<EMAIL.indexOf("@") && EMAIL.indexOf("@")+1 < EMAIL.length && SUBJECT.length!=0 && MESSAGE.length!=0 && SECURITYREAD==hex_md5(hex_sha1(SECURITYWRITE)))
	{
		document.F_BLOGPOST.submit();
		return true;
	}
	else
	{
		alert (strMsg);
		return false;
	}

}

function CheckFormBlogReply(strLang)
{

	var NAME=document.F_BLOGREPLY.FF_NAME.value;
	var EMAIL=document.F_BLOGREPLY.FF_EMAIL.value;
	var MESSAGE=document.F_BLOGREPLY.FF_MESSAGE.value;
	var SECURITYREAD=document.F_BLOGREPLY.FF_SECURITYREAD.value;
	var SECURITYWRITE=document.F_BLOGREPLY.FF_SECURITYWRITE.value;

	switch(strLang)
	{
		case "fr":		strMsg=AlertTitle+"svp, verifiez les champs (voir example qui suit)...\n\nvotre nom: John Doe\n\nvotre e-mail: johndoe@email.net\n\nvotre message: hello world...\n\ncode de securite: 000000\n"
						break
		case "pt":		strMsg=AlertTitle+"por favor, verifique os campos (veja o exemplo a seguir)...\n\no seu nome: John Doe\n\no seu e-mail: johndoe@email.net\n\na sua mensagem: hello world...\n\ncodigo de seguranca: 000000\n"
						break
		case "en":		strMsg=AlertTitle+"please, check your form fields (see the example below)...\n\nyou name: John Doe\n\nyour e-mail: johndoe@email.net\n\nyour message: hello world...\n\nsecurity code: 000000\n"
						break
		default:		strMsg=AlertTitle+"please, check your form fields (see the example below)...\n\nyou name: John Doe\n\nyour e-mail: johndoe@email.net\n\nyour message: hello world...\n\nsecurity code: 000000\n"
						break
	}
	if (NAME.length!=0 && EMAIL.indexOf(" ")==-1 && 0<EMAIL.indexOf("@") && EMAIL.indexOf("@")+1 < EMAIL.length && MESSAGE.length!=0 && SECURITYREAD==hex_md5(hex_sha1(SECURITYWRITE)))
	{
		document.F_BLOGREPLY.submit();
		return true;
	}
	else
	{
		alert (strMsg);
		return false;
	}

}

function CheckFormSubscriber(strLang)
{

	var EMAIL=document.F_SUBSCRIBER.FF_EMAIL.value;
	var SECURITYREAD=document.F_SUBSCRIBER.FF_SECURITYREAD.value;
	var SECURITYWRITE=document.F_SUBSCRIBER.FF_SECURITYWRITE.value;

	switch(strLang)
	{
		case "fr":		strMsg=AlertTitle+"svp, verifiez les champs (voir example qui suit)...\n\nvotre e-mail: johndoe@email.net\n\ncode de securite: 000000\n"
						break
		case "pt":		strMsg=AlertTitle+"por favor, verifique os campos (veja o exemplo a seguir)...\n\no seu e-mail: johndoe@email.net\n\ncodigo de seguranca: 000000\n"
						break
		case "en":		strMsg=AlertTitle+"please, check your form fields (see the example below)...\n\nyour e-mail: johndoe@email.net\n\nsecurity code: 000000\n"
						break
		default:		strMsg=AlertTitle+"please, check your form fields (see the example below)...\n\nyour e-mail: johndoe@email.net\n\nsecurity code: 000000\n"
						break
	}
	
	if (EMAIL.indexOf(" ")==-1 && EMAIL.indexOf("@") > 0 && EMAIL.indexOf(".") > 2 && SECURITYREAD==hex_md5(hex_sha1(SECURITYWRITE)))
	{
		document.F_SUBSCRIBER.submit();
		return true;
	}
	else
	{
		alert (strMsg);
		return false;
	}

}

