var dialogWin = new Object()
FullScreenLayer=null
ModalDialog=null

function modalOpenDialog(arg1,arg2,arg3,resizable,scrollbars) {
	ModalDialog=openmyDialog(arg1,arg2,arg3,resizable,"",scrollbars)

	return ModalDialog;
}
// Generate a modal dialog.
// Parameters:
//    url -- URL of the page/frameset to be loaded into dialog
//    width -- pixel width of the dialog window
//    height -- pixel height of the dialog window
//    args -- [optional] any data you need to pass to the dialog
function openmyDialog(url, width, height,resizable, args,scroll) {
	if (!dialogWin.win || (dialogWin.win && dialogWin.win.closed)) {
		// Initialize properties of the modal dialog object.
		dialogWin.returnedValue = ""
		dialogWin.args = args
		dialogWin.url = url
		dialogWin.width = width
		dialogWin.height = height
		// Keep name unique so Navigator doesn't overwrite an existing dialog.
		dialogWin.name = (new Date()).getSeconds().toString()
		// Assemble window attributes and try to center the dialog.

			dialogWin.left = (screen.width - dialogWin.width) / 2
			dialogWin.top = (screen.height - dialogWin.height) / 2
			var attr = "left=" + dialogWin.left + ",top=" + 
			   dialogWin.top + ",dependent=yes,personalbar=no,z-lock=yes,scrollbars="+(scroll?"yes":"no")+",resizable="+(resizable?"yes":"no,dependent=yes")+",width=" + dialogWin.width + 
			   ",height=" + dialogWin.height

		dialogWin.win=window.open(dialogWin.url, dialogWin.name, attr)
		dialogWin.win.focus()
	} else {
		dialogWin.win.focus()
	}
	return dialogWin
}


function ImageOn(ImageName){
	s=document[ImageName].src;
	s=s.replace("_off","_on")
	document[ImageName].src=s;
}

function ImageOff(ImageName){
	s=document[ImageName].src;
	s=s.replace("_on","_off")
	document[ImageName].src=s;
}

function getAnswer(MyForm){
	var md;
	md = window.open('http://avtostimul.ru/getsurveyanswers.asp','AnswerWindow','top=100,left=100,width=400,height=140');
	document.SurveyForm.target = 'AnswerWindow';
	setTimeout('document.SurveyForm.submit();',1000);
}


