function ShowHelpDiv(selfObj, hintKey){
	var obj = document.getElementById('helpDiv');
	if(obj.style.display == 'block'){
		obj.style.display = 'none';
	} 
	else {
		obj.style.left = getObjectX(selfObj);
		obj.style.top = getObjectY(selfObj)+16;
		document.getElementById('helpDivContent').innerHTML = hints[hintKey];
		obj.style.display = 'block';
	}
}

function getObjectY(imgElem) {
  
   xPos = eval(imgElem).offsetTop;
   tempEl = eval(imgElem).offsetParent;
     while (tempEl != null) {
      xPos += tempEl.offsetTop;
      tempEl = tempEl.offsetParent;
     }
   return xPos;
}

function getObjectX(Elem) {
	if(Elem){
   xPos = eval(Elem).offsetLeft;
   tempEl = eval(Elem).offsetParent;
     while (tempEl != null) {
      xPos += tempEl.offsetLeft;
      tempEl = tempEl.offsetParent;
     }
	 }else xPos = 30;
	 
   return xPos;
}

function checkAgree(){
	
	if(document.getElementById('agree2').checked == false){
		alert('Вы не дали согласия на передачу информации');
		return false;
	}
	
	return true
}


// заполнение листа селект значениями из другого листа
function FillSelectList(sourceList, targetList){
	for(i=0; i<sourceList.options.length; i++)
		targetList.options[targetList.options.length] = new Option(sourceList.options[i].text, sourceList.options[i].value, false, false);
}
