﻿// JScript File

function calendarPicker(strField)
{
	window.open('DatePicker.aspx?field=' + strField,'smallWin','height=170,width=220,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=no,left=400,top=400');
}

/*function doit(htmfile) 
{
	popUpWin = window.open(htmfile,'smallWin','height=330,width=450,toolbar=0,location=0, directories=0,status=0,menubar=0,scrollbars=no,resizable=no')
	if (navigator.appName == 'Netscape') 
	{
		popUpWin.focus()
	}
}*/

function doit(htmfile,ht,wid) 
{
    popUpWin = window.open(htmfile, 'smallWin', 'height='+ht+',width='+wid+',toolbar=0,location=0, directories=0,status=0,menubar=0,scrollbars=yes,resizable=no')
    if (navigator.appName == 'Netscape') {
        popUpWin.focus()
    }
}

function confirmSubmit()
{
    var agree=confirm("Are you sure you wish to delete?");
    if (agree)
	    return true ;
    else
	    return false ;
}


function check_uncheck (Val) 
{ 
    var ValChecked = Val.checked;
    var ValId =Val.id;
    var frm = document.forms[0];
    var flag=0;
    // Loop through all elements
    for (i=0; i<frm.length; i++)  
    {
        // Look for Header Template's Checkbox
        if (this!=null)
        {   if (ValId.indexOf ('CheckAll') != -1) 
            {
                // Check if main checkbox is checked, then select or deselect datagrid checkboxes 
                if(ValChecked) frm.elements[i].checked = true;
                else frm.elements[i].checked = false;
            } 
            else if (ValId.indexOf ('selectRec') != -1) 
            {
                // Check if any of the checkboxes are not checked, and then uncheck top select all ie.element3 checkbox
                if(frm.elements[i].checked == false)   
                frm.elements[12].checked = false;           
                //alert("in 1st for");
            }    
        }// if
    }// for
} // function

/*//for right click and all
var message = "Function Disabled!";
function clickIE4() 
{
    if (event.button == 2) 
    {
        alert(message);
        return false;
    }
}
function clickNS4(e) 
{
    if (document.layers || document.getElementById && !document.all) 
    {
        if (e.which == 2 || e.which == 3) 
        {
            alert(message);
            return false;
        }
    }
}
if (document.layers) 
{
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = clickNS4;
}
else if (document.all && !document.getElementById) 
{
    document.onmousedown = clickIE4;
}
document.oncontextmenu = new Function("alert(message);return false")


//Disable select-text script (IE4+, NS6+)
function disableselect(e) 
{
    return false
}
function reEnable() 
{
    return true
}
//if IE4+
document.onselectstart = new Function("return false")
//if NS6
if (window.sidebar) 
{
    document.onmousedown = disableselect
    document.onclick = reEnable
}
*/
