﻿// * * * * * * * * * * * * * * * * * * * * * * * * * *
// Календарь
// * * * * * * * * * * * * * * * * * * * * * * * * * *
function showCalendar(elementName, time, lang)
{
	var value = document.getElementById(elementName);
	window.showModelessDialog("design/calendar/calendar.aspx?time=" + time + "&lang="+lang, value, "help:no;scroll:no;status:no; dialogWidth:220px; dialogHeight:200px");
}


var eventKey;

function registerSubmitHandlers() {
	if ( typeof(autoSubmitNames)!="undefined" ) {
		for( i = 0; i<autoSubmitNames.length; i++ ) {
		var ob = document.getElementById(autoSubmitNames[i]);
		if ( ob!=null )
			ob.onkeydown = doSubmit;
		}
		if ( !document.all ) {
			eventKey = "e.keyCode";
			document.PrxOff_captureEvents(Event.KeyDown);
		}
		else
		eventKey = "event.keyCode";
	}
}

function doLinkSubmit(linkID) {
	if ( document.all )
		document.getElementById(linkID).click();
	else
		document.location.href = document.getElementById(linkID).href;
}

function doSubmit(e) {
	if (eval(eventKey) == 13 && window.event.srcElement.tagName != "TEXTAREA") {
		for(i=0; i < autoSubmitNames.length; i++) {
			if (autoSubmitNames[i]==this.id) {
				eval(autoSubmit[i]);
				return false;
			}
		}
	}
}

function show_confirm(txtMesg){
	var Resp = confirm(txtMesg);
	return (Resp);
}

// * * * * * * * * * * * * * * * * * * * * * * * * * *
// Подтверждение удаления
// * * * * * * * * * * * * * * * * * * * * * * * * * *
function ConfirmDelete() {
     return confirm("Удалить выделенные элементы?");
}

function ShowDiv(div_id){
adiv=document.getElementById(div_id); 
adiv.style.display='block';
}

function HideDiv(div_id){
adiv=document.getElementById(div_id); 
adiv.style.display='none';
}

function change_src(img,src) 
{ 
	im = document.images[img];
	if (im) im.src=src;
	else 
	{
		im = document.getElementById(img);
		if (im) im.setAttribute("src",src); 
	}
} 
