function noOnselect(e){
	target=e.target||window.event.srcElement;
	
	if(target.tagName!='INPUT'){
		if (document.selection)
			document.selection.empty();
	}
}


function popupWin(srcfile) {
	var m = screen.availWidth/2;
	zw = window.open("","zoomwin","width=200,height=200,top=20,left=20,resizable=yes,location=no,scrollbars=no,status=no,toolbar=no,directories=no");
	zwdata = "<html><head><title>Галерея дизайна и интерьера Neuhous</title><script type='text/javascript'> function rwin() { self.resizeTo(document.images['imgfile'].width+12, document.images['imgfile'].height+31); var sleva = " + m + " - ((document.getElementById('imgfile').width)/2); self.moveTo(sleva,50); } </script></head><body topmargin='0' bottommargin='0' leftmargin='0' rightmargin='0' marginheight='0' marginwidth='0' onload='rwin()'><a href='javascript:self.close()'><img id='imgfile' src=" + srcfile +" alt='закрыть окно' title='закрыть окно' border='0'></a></body></html>";
	zw.document.open();
	zw.document.write(zwdata);
	zw.document.close();
}

function getElementPosition(elemId){
	var elem = document.getElementById(elemId);
	
	var w = elem.offsetWidth;
	var h = elem.offsetHeight;
	
	var l = 0;
	var t = 0;
	
	while (elem){
		l += elem.offsetLeft;
		t += elem.offsetTop;
		elem = elem.offsetParent;
	}
	
	return {'left':l,'top':t,'width':w,'height':h};
}

function getClientWidth(){
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}
