// -*- coding: utf-8 -*-

function showClient(cid) //show client description
{ 
    hideAllClients();
    if (document.getElementById(cid)) {
	document.getElementById(cid).className = "clientDescShow";
    }
}

function hideAllClients() //hide all client descriptions
{
    divs = document.getElementsByTagName("div");
    for (var i=0;i<divs.length;i++) {
	did = divs[i].getAttribute("id");
	if (did && did.match("client-")) {
	    divs[i].className = "clientDescHide";
	}
    }
}


//=============================
var actItem;
var actItemClass;

function emphasizeItem(obj,cls) //change item's background - emphasize
{
    actItem = obj;
    actItemClass = obj.className;
    actItem.className=cls;
}

function deemphasizeItem() //change item's background - return to original color
{
    if (actItem) {
	actItem.className=actItemClass;
    }
}

//=============================
function matchFields()
{
    var check = true;
    var elms = document.forms["contact-form"].elements;
    for (i=0; i < elms.length; i++) {
	//alert(elms[i].name + ":" + elms[i].value);
        if (elms[i].getAttribute("req") == 1 && elms[i].value == '') {
		  check = false;
	          elms[i].focus();
	          break;
	}
    }
    if (!check) {
	alert("Please fill-in all fields marked with '*' prior to submit.");
	return false;
    }
    else return true;
}

