is_opera = new Boolean(navigator.appName.indexOf('Opera') + 1);

var d = document;
 
function form_validate(form, field) {
   if ( d.site_search.search.value < 1 || d.site_search.search.value == 'Поиск') {
      alert('Введите поисковую фразу');
      return false;
   }
   return true;
}


function preload(obj) {
	new Image().src = obj;
};

function changeImg(loc,file) {
	obj = document.getElementById(loc);
	obj.src = file;
}

/* function additems() {
	obj = d.getElementById('tmp');
	df = d.createDocumentFragment();
	n = Math.floor(Math.random() * (11));
	for (i = 0; i < n; i++) {
		div = d.createElement('div');
		df.appendChild(div);
	}
	
	obj.appendChild(df);	
}

window.onload = function() {
	db = d.lastChild.lastChild;
	obj = d.createElement('div');
	obj.id = 'tmp';
	db.appendChild(obj);
	
	additems();
	
	obj.onclick = function() {if (this.childNodes.length) {
		this.removeChild(this.firstChild)
	} else {
		additems();	};
	
	}
	
	
} */

function cleanup(o, nocont) {
	for (var i=0, o2; o2 = o.childNodes[i]; i++) {
		if (o2.nodeType == 3 && o2.nodeValue.match(/^\s+$/)) {
			o.removeChild(o2);
			i--;
			continue;
		}
		
		if (!nocont) cleanup(o2);
	}
	
	return o;
}

function make_vac_list(o) {

	itms = cleanup(o).childNodes;
	this.s = itms[0].firstChild;
	
	for (var i=0, o2; i<itms.length; i++) {
		
		o2 = itms[i].firstChild;
		
		if (o2.className == 's') o.s = o2;
		
		o2._p = this;
		o2.pad = o2.nextSibling;
		o2.onclick = function() {
			this._p.s.pad.style.display = 'none';
			this._p.s.className = '';
			this.pad.style.display = 'block';
			this.className = 's';
			
			this._p.s = this;
			
			return (false);
		}
	}
	
	
	//this.s.className = 's';
	
	for (var i=0; o2, i<itms.length; i++) {
		o2 = itms[i].childNodes[1]; 
		o2.style.display = 'none'//(o2 == this.s.pad) ? 'block' : 'none';
	}
	
	return (this);
}
	
	
	
	

