﻿/*****************************************************************************
******************************************************************************
    Copyright (c) 2007, All rights reserved.
	Name : Mr. Jeerapat Wingpat
	Company Name : Prosoft Comtech.
	Position : Web Developer
	Created Date : 21/12/2007
	Description : JavaScript ที่ใช้ในหน้าจอ Register.aspx
******************************************************************************
*****************************************************************************/

//เมื่อมีการ Click เลือกที่ Control ListBox และ RadioButton
//จะทำการเก็บข้อมูลลง hidValue ของ ListBix และ RadioButton เพื่อเอาไว้ตรวจสอบ
function onClickValidate(hidControlId,text)
{
    document.getElementById(hidControlId).value = text;   
}

function CheckUsername(UserNameID)
{
    var strUsername = 	document.getElementById(UserNameID).value;
    if(strUsername != "")
    {
        window.open('Dialog/CheckUsernameDialog.aspx?Username=' + strUsername ,'cal','left=500,top=300,width=250,height=100,location=no, menubar=no, modal=yes, status=no, toolbar=no, scrollbars=no, resizable=no, tite=no, resizable=no, directories=no');
        
    }
}
function CheckUsernameCompany(UserNameID,CompanyName) {
    var strUsername = document.getElementById(UserNameID).value;
    if (strUsername != "" && CompanyName != "") {
        window.open('../Dialog/CheckUsernameDialog.aspx?Username=' + strUsername + '&company='+ CompanyName, 'cal', 'left=500,top=300,width=250,height=100,location=no, menubar=no, modal=yes, status=no, toolbar=no, scrollbars=no, resizable=no, tite=no, resizable=no, directories=no');
    }
}
function CheckUsernameChange(UserNameID)
{
    var strUsername = 	document.getElementById(UserNameID).value;
    if(strUsername != "")
    {
        window.open('../Dialog/CheckUsernameDialog.aspx?Username=' + strUsername ,'cal','left=500,top=300,width=250,height=100,location=no, menubar=no, modal=yes, status=no, toolbar=no, scrollbars=no, resizable=no, tite=no, resizable=no, directories=no');
        
    }
}


function checkButton(ctlr,BtnID)
{
    if (ctlr.value == "")
    {
        document.getElementById(BtnID).disabled=true;
    }
    else
    {
        if(ctlr.value.length > 4)
        {
            document.getElementById(BtnID).disabled=false;
        }else
            {
                document.getElementById(BtnID).disabled=true;
            }
    }
}

function onCheckErrorShowMSG(txtCtrl,TrID)
{
    if(txtCtrl.value == "")
    {
        document.getElementById(TrID).style.display = "";
    }
    else
    {
        document.getElementById(TrID).style.display = "none";
    }    
}

function CheckValidate(ctrl)
{
    
}
