// JScript File

function ConfirmDelete(title){
	if(confirm("You are about to delete the selected "+ title +".\nYou will not be able to get back the details once deleted.\nDo you wish to continue?"))
	{
		return true;			
	}
	else
	{
		return false;
	}
	return false;
}	

function ConfirmQuestionnaireDelete(){
	if(confirm("There are questionnaires submitted by this Physician.Deleting this Physician will also delete the allotted templates and submitted questionnaires. Are you sure you want to continue?"))
	
	//You are about to delete the selected "+ title +".\nYou will not be able to get back the details once deleted.\nDo you wish to continue?"))
	{
		return true;			
	}
	else
	{
		return false;
	}
	return false;
}	

function ConfirmArchive(status, title){
	if(confirm("You are about to "+ status +" the selected "+ title +".\nDo you wish to continue?"))
	{
		return true;			
	}
	else
	{
		return false;
	}
	return false;
}	

function onOpenPopup(url, nWidth, nHeight, name) {
	
	var nLeft	= 0;
	var nTop	= 0;
	nLeft		= (window.screen.width - nWidth)/2;
	nTop		= (window.screen.height - nHeight)/2;
	window.open(url, name, "width=" + nWidth + ", height=" + nHeight + ", location=no,left=" + nLeft + ",top=" + nTop + ", menubar=no, status=no, toolbar=no, scrollbars=yes, resizable=no");
}

function onOpenDirectionMap(url, nWidth, nHeight, name) {
	
	var nLeft	= 0;
	var nTop	= 0;
	nLeft		= (window.screen.width - nWidth)/2;
	nTop		= (window.screen.height - nHeight)/2;
	window.open(url, name, "width=" + nWidth + ", height=" + nHeight + ", location=no,left=" + nLeft + ",top=" + nTop + ", menubar=no, status=no, toolbar=no, scrollbars=no, resizable=no");
}

function openDialogWindow(url, nWidth, nHeight, name) {
	
	var nLeft	= 0;
	var nTop	= 0;
	nLeft		= (window.screen.width - nWidth)/2;
	nTop		= (window.screen.height - nHeight)/2;	
	window.showModalDialog(url, "", "dialogHeight: " + nHeight + "px; dialogWidth: " + nWidth + "px; dialogTop: " + nTop + "px; dialogLeft: " + nLeft + "px; edge: Raised; center: Yes; resizable: No; status: Yes;");
}

function navigatePage(pageIndex) {
	var frm	= document.aspnetForm;
	frm.ctl00_PageIndexHidden.value	= pageIndex;
	frm.ctl00_ActionHidden.value = "PAGINATION";
	frm.submit();
}

var	strFocusControlId	= "";
function setFocus() {
	if(strFocusControlId != "") {
		var objControl	= document.getElementById(strFocusControlId);
		objControl.focus();
	}
}

function getGridControl(gridId, controlId, nRowIndex) {
	var objControl	= null;
    
	if(nRowIndex >= 10) {
		controlId	= "ctl00_MainContent_" + gridId + "_ctl" + nRowIndex + "_" + controlId;
	} else {
		controlId	= "ctl00_MainContent_" + gridId + "_ctl0" + nRowIndex + "_" + controlId;
	}
	
	objControl	= document.getElementById(controlId);
	return(objControl);
}

function openImageWindow(strImage, nWidth, nHeight) {
	var nLeft	= 0;
	var nTop	= 0;
	nLeft		= (window.screen.width - nWidth)/2;
	nTop		= (window.screen.height - nHeight)/2;
	var imagePopup = window.open(strImage,"","left=" + nLeft + ",top=" + nTop + ",height=" + nHeight + ",width=" + nWidth);
	imagePopup.document.write("<html><body topmargin='0' leftmargin='0'><img src='"+strImage+"'></body></html>");
	return false;
}


