function view_foto(adr,w,h){
var new_foto=window.open('view_foto.php?adr='+adr,'','width='+w+',height='+h);
}

function view_img(id,alt){
var viewimg=window.open('view_img.php?id='+id+'&alt='+escape(alt),'','width=100,height=100,status=1');
}

function setclassName(obj,name){
	document.getElementById(obj).className=name;
}

function objectXY(obj) {
var dobj=eval('document.getElementById("'+obj+'")')
   var x = 0, y = 0;
do{
    x += dobj.offsetLeft;
    y += dobj.offsetTop;
  }while (typeof(dobj = dobj.offsetParent) != 'undefined' && dobj != null);
   return [x,y];
}

function bgf(name,color){
	name.style.backgroundColor=color;
}


function win_resize(e,intWidth,intHeight){
  var newW=(intWidth==null || intWidth=='' || isNaN(parseInt(intWidth)))? 800 : parseInt(intWidth);
  var newH=(intHeight==null || intHeight=='' || isNaN(parseInt(intHeight)))? 800 : parseInt(intHeight);
  if(is_ie4 || is_ie){newW+=10;newH+=29;}
  if(is_ns4 || is_ns){newW+=6;newH+=27;}
  if(is_opera){newW+=10;newH+=29;}
  if(is_firefox){newW+=0;newH+=22;}
	if(screen.width>newW)newLeft=Math.round((screen.width-newW)/2);
	 else newLeft=10;
	if(screen.height>newH)newTop=Math.round((screen.height-newH)/2);
	 else newTop=10;
  newH+=20;
  e.resizeTo(newW,newH);
  e.moveTo(newLeft,newTop);
}

function move_window_to_center_screen(){
if(is_ns4 || is_ns){
leftco=document.body.offsetWidth+16;
topco=document.body.offsetHeight+44;
}
if(is_ie || is_ie4 || is_firefox){
leftco=document.body.clientWidth;
topco=document.body.clientHeight;
}
if(is_opera){
leftco=document.body.clientWidth;
topco=document.body.clientHeight+200;
}
newLeft=Math.round((screen.width-leftco)/2);
newTop=Math.round((screen.height-topco)/2);

window.moveTo(newLeft,newTop);
}

var userAgent = navigator.userAgent.toLowerCase();
var is_opera  = (userAgent.indexOf('opera') != -1);
var is_firefox  = (userAgent.indexOf('firefox') != -1);
var is_saf    = ((userAgent.indexOf('applewebkit') != -1) || (navigator.vendor == 'Apple Computer, Inc.'));
var is_webtv  = (userAgent.indexOf('webtv') != -1);
var is_ie     = ((userAgent.indexOf('msie') != -1) && (!is_opera) && (!is_saf) && (!is_webtv));
var is_ie4    = ((is_ie) && (userAgent.indexOf('msie 4.') != -1));
var is_moz    = ((navigator.product == 'Gecko') && (!is_saf));
var is_kon    = (userAgent.indexOf('konqueror') != -1);
var is_ns     = ((userAgent.indexOf('compatible') == -1) && (userAgent.indexOf('mozilla') != -1) && (!is_opera) && (!is_webtv) && (!is_saf));
var is_ns4    = ((is_ns) && (parseInt(navigator.appVersion) == 4));
var is_mac    = (userAgent.indexOf('mac') != -1);

var xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
@end @*/

if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}

var loader_img=new Image();loader_img.src="images/loader.gif";
