function switchComment( obj )
{
	if (obj.style.display == "")
		hideObject(obj);
	else if (obj.style.display == "none") {
		var commentPrefix = "comment";
		for (var i=0;i<document.all.Count;++i) {
			var curForm = document.all(i);
			var formID = curForm.id;
			if ( formID.substr(0,commentPrefix.length) == commentPrefix ) {
				if ( curForm.style.display == "" ) {
					hideObject( curForm );
				}
			}
		}
		showObject(obj);
	}
}

function checkPostForm(objName, objMail, objText)
{
    var res = true;
    if (objName.value == "")
    {
        objName.style.border = "1px solid red";
        res = false;
    }
    else 
        objName.style.border = "1px solid green";
        
    if (objMail.value == "")
    {
        objMail.style.border = "1px solid red";
        res = false;
    }   
    else
    {
        var re = new RegExp("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$");
        res = re.test(objMail.value);
        objMail.style.border = res ? "1px solid green" : "1px solid red";
    }        
         
    if (objText.value == "")
    {
        objText.style.border = "1px solid red";
        res = false;
    }  
    else
        objText.style.border = "1px solid green";
        
    return res;
}

function switchObject( obj )
{
	if (obj.style.display == "")
		hideObject(obj);
	else if (obj.style.display == "none")
		showObject(obj);
}
function showObject( obj )
{
   obj.style.display="";
}

function hideObject( obj )
{
   obj.style.display="none";
}
