	var currNvgTimer=0,currNvgId=0, FavDiv, FavShow=0;
	dom = (document.getElementById) ? (true) : (false);
	ie = document.all;
	ie4 = ie && !dom;
	if (!dom)window.location = '/';
	function nvgShow(id){
		if(currNvgTimer){
			clearTimeout(currNvgTimer);
			if(currNvgId!=id)nvgHideNow(currNvgId);
			currNvgTimer=0;
		}
		if(currNvgId)
			if(currNvgId!=id)nvgHideNow(currNvgId)
		currNvgId = 0;
		var a=document.getElementById(id);
		if(a){
			var dimms = Element.extend($(id.replace('nvg','_'))).cumulativeOffset();
			var obj = Element.extend(a);
			currNvgId=id;
			obj.setStyle({
				left:dimms.left,
				top:(dimms.top+25),
				visibility:'visible'
			});
			
		}
	}
	function nvgHide(id){currNvgTimer=setTimeout('nvgHideNow("'+id+'")',1000);}
	function nvgHideNow(id){var a=document.getElementById(id);if(a)a.style.visibility='hidden';}
	
	function splash(obj) {
		Element.extend(obj);
		obj.setStyle({
			backgroundColor:'#cdf'
		});
	}
	
	function desplash(obj) {
		Element.extend(obj);
		//new Effect.Highlight(obj,{duration:0.5});
		obj.setStyle({
			backgroundColor:'#ffffff'
		});
	}
	

	
	function validateForm() {
		var controls = $$('.validable');
		var result = true;
		for(var i=0; i<controls.length; i++) {
			var item = controls[i];
			if(item.value.blank()) {
				result = false;
				var name = item.name+'star';
				if(!($(name))) {
					var star = new Element('span',{id:name,'class':'error'}).update('*');
					Element.insert(item,{after:star});
				}
			}
		}
		if(!result) {
			alert('Заполните обязательные поля');
		}
		return result;
	}
	
	function initForm() {
		var controls = $$('.validable');
		for(var i=0; i<controls.length; i++) {
			var item = controls[i];
			var name = item.name+'star';
			if(!($(name))) {
				var star = new Element('span',{id:name,'class':'error'}).update('*');
				Element.insert(item,{after:star});
			}
		}
		
	}
