﻿function ToggleRow(rowIndex)
{
//    if (document.getElementById("collapseableRow_" + rowIndex) != null)
//    {
//       var index = 1;
//       while (document.getElementById("collapseableRow_" + index) != null)
//       {
//            if (rowIndex != index)
//                document.getElementById("collapseableRow_" + index).style.display = "none";   
//        index++;
//       }

//        if (document.getElementById("collapseableRow_" + rowIndex).style.display == "none")
//            document.getElementById("collapseableRow_" + rowIndex).style.display = "";
//        else
//            document.getElementById("collapseableRow_" + rowIndex).style.display = "none";
//    }
};


function PageLoad()
{
    if (document.getElementById("tblPostMessage") != null)
    {
        if (Request("act", "") == "new")
            document.getElementById("tblPostMessage").style.display = "";  
        else
            document.getElementById("tblPostMessage").style.display = "none";
    }
};


window.onload = PageLoad;

// pulls arguments from the url
function Request(strName, strDefault) 
{
    try {
        var args = document.location.search.replace("?", "").split("&");

        for (var i = 0; i < args.length; i++) {
            if (args[i].substring(0, strName.length + 1) == strName + "=") {
                return args[i].substring(strName.length + 1)
            }
        }
    } catch (ex) {
    }
};

function ClientValidate(source, arguments)
{
    if (arguments.Value.length <= 0)
        arguments.IsValid = false;
    else if (arguments.Value.toLowerCase().indexOf("<script") > -1)
        arguments.IsValid = false;
    else if (arguments.Value.toLowerCase().indexOf("</script") > -1)
        arguments.IsValid = false;
     else 
        arguments.IsValid = true;
    
};


