﻿//#region Copyright Zerone Consulting Private Limited
//
// All rights are reserved. Reproduction or transmission in whole or in part, in
// any form or by any means, electronic, mechanical or otherwise, is prohibited
// without the prior written consent of the copyright owner.
//
// Filename        : Common.js
// Purpose         : Common.js
// Creation Date   : 23/June/2009
// Author          : Naveenkumar CN
//
// Change History  :
// Changed by      :                                     Date : 
// Purpose         :
//
//#endregion


// Purpose  : Variable contains the prefix of 
//            controls that inheritted from masterpagre
// Auther   : Naveenkumar CN
// Created  : 23/June/2009
var MASTER_PAGE_PREFIX  = "ctl00_cplhContent_"


// Purpose  : Set focus to a control from a content page
// Auther   : Naveenkumar CN
// Created  : 23/June/2009
function SetFocus( cntrl )
{
    document.getElementById( MASTER_PAGE_PREFIX + cntrl).focus();
    document.getElementById( MASTER_PAGE_PREFIX + cntrl).select();
}

// Purpose  : set focus to a control from a page
// Auther   : Naveenkumar CN
// Created  : 23/June/2009
function SetFormFocus( cntrl )
{
    document.getElementById( cntrl).focus();
    document.getElementById( cntrl).select();
}

//Purpose: Confirmation Message before deleting
//Author: Mexi thomas
//Date : 24th June 2009

function funcConfirm(strItem)
    {      
        confirmString =   "Do you want to delete this " + strItem + " ?";
        
        if(confirm(confirmString))
        {
             return true;
        }
        else
        {
             return false;
        }        
    }
    //Mexi Thomas
    //To select and unselect the checkboxes
    
    function checkUncheck()
{
    var checked;
    checked = document.getElementById("ctl00_cplhContent_gvRegUsers_ctl01_chkCheckAll").checked;	
    fnGetElement(checked)
}
	
function fnGetElement(checked)
{
    var arrElements = document.getElementsByTagName('input');
    var objElement = null;
    for(i = 0; i < arrElements.length; i++)
    {
        if(arrElements[i].id.indexOf('chkUsers') != -1)
        {		        
            arrElements[i].checked = checked;
        }
    }
}
function fnGetValue(val)
{
alert(val);
var arrChks = document.getElementsByTagName('input');
var objElement = null;

   
}
