﻿// JScript File
<!--
function imgswap(img,ref){
	if (document.images) {
			document.images[img].src = ref;
	}
}
function img(obj,ref)
{       
        document.getElementsByName(obj).src=ref;
}
function EvImageOverChange(name, direction)
{
    switch(direction)
    {
    case 'in':
    name.src = "images/btns/btn_go_hot.gif"
    break;
    case 'out':
    name.src = "images/btns/btn_go.gif"
    break;
    }
}
function ImageOverChange(name, imgsrc)
{
    name.src = imgsrc
}
function Redirect()
{
    window.opener.location.href= "home.aspx";
    window.close();
}
function DisplayOthersTextbox(dlstCategory, other)
{
    var txtOther = document.getElementById(other);    
    if (dlstCategory.value == -1)
    {
        txtOther.style.visibility="visible";       
    }
    else
    {
        txtOther.style.visibility="hidden";        
    }
}
function CheckQuestionLength(txtQuestion, txtLength, length)
{
    if (parseInt(txtQuestion.value.length) > parseInt(length))
    {
        txtQuestion.value = txtQuestion.value.substring(0, length);
        txtLength.value = parseInt(length) - parseInt(txtQuestion.value.length);
        alert("You may only enter "+ length +" characters.");           
    }
    else
    {
        txtLength.value = parseInt(length) - parseInt(txtQuestion.value.length);
    }
}
function ValidateNull(txtother, imageerror)
{
    var txtother = document.getElementById(txtother);
    if (txtother.value == "")
    {
        imageerror.style.visibility = "visible";  
        return false;
        
    }
    else
    {
        document.forms("aspnetForm").submit;
         return true;
        
    }
}
function changeText(lblText)
{
    lblText.innerHTML="";
}
function ValidateKeyword(TxtGo)
{
    var SearchKeyword=TxtGo.value.replace(/^\s*|\s*$/g,"");
    if(SearchKeyword=="")
    {
        alert("Please enter the text to be searched.");
        return false;
    }
    else
    {
        return true;
    }
}

//-->
