function get(id) {

	return document.getElementById(id);

}

function importXML(path)
{
	if (document.implementation && document.implementation.createDocument)
	{
		xmlDoc = document.implementation.createDocument("", "", null);
		xmlDoc.onload = loadImg;
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.onreadystatechange = function () {
			if (xmlDoc.readyState == 4) loadImg()
		};
 	}
	else
	{
		return;
	}
	xmlDoc.load(path);
}

function loadImg()
{
	var x = xmlDoc.getElementsByTagName('root');

	image = new Array();

	for (i=0;i<x.length;i++)
	{

		for (j=0;j<x[i].childNodes.length;j++)
		{
			if (x[i].childNodes[j].nodeType != 1 && document.images) continue;

			image[i] = new Image();
			image[i].src = "images/marcas/"+x[i].childNodes[j].firstChild.nodeValue;

		}

	}

}

function checkEmail(str) {
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(str)){
        return true;
    }
    return false;
}

function checkForm() {
    var field_name = document.getElementById('nome');
    var field_email = document.getElementById('email');
	var field_msg = document.getElementById('msg');

    if(field_name.value.length < 3) {
        alert('O campo "Nome" é de preenchimento obrigatório.');
        field_name.focus();
        return false;
    }
    if(field_email.value.length < 5) {
        alert('O campo "E-mail" é de preenchimento obrigatório.');
        field_email.focus();
        return false;
    }
	if(field_msg.value.length < 5) {
		alert('O campo "Mensagem" é de preenchimento obrigatório.');
		field_msg.focus();
		return false;
	}
    if(!checkEmail(field_email.value)) {
        alert('O e-mail informado não é válido.\nPreencha corretamente o campo "Email".');
        field_email.focus();
        return false;
    }
    return true;
}

function show(id) {

	get('produtos-ti').style.cssText = "display:none;";
	get('softwares').style.cssText = "display:none;";
	get('opcionais').style.cssText = "display:none;";
	get('consultoria').style.cssText = "display:none;";

	get('a-produtos-ti').className = 'arrow';
	get('a-softwares').className = 'arrow';
	get('a-opcionais').className = 'arrow';
	get('a-consultoria').className = 'arrow';

	get(id).style.cssText = 'display:inline;';
	get('a-'+id).className = 'arrowselected';

}