//main admin javascript file


//zmena obrazkov
function changeimg(obj, imgurl){
		obj.src = imgurl;
}

function mo(obj, ci, csclass){ //mouseoverv uvode
	if(ci==1){
		obj.style.backgroundColor = "#E1F0FF";
		obj.style.borderColor = "navy";
	}else{
		obj.style.borderColor = "";
		obj.style.backgroundColor = "";
	}
}

function wo_pics_riesenia(url, namew, sirka, vyska, scrollb)
{
	if(scrollb=='1')
		scrollb = 'yes';
	else
		scrollb='no';
		
	win_width = sirka+20; //sirka okna
	win_height = vyska+20; //vyska okna
	x = Math.ceil((screen.width-win_width)/2);
	y = Math.ceil((screen.height-win_height)/2);
	msg = window.open(url, namew, 'toolbar=no,menubar=no,location=no ,directories=no, scrollbars='+scrollb+',resizable=yes,status=no,width='+win_width+',height='+win_height+',top='+y+',left='+x);
}

//upravi okno podla velkosti obrazka
function FitPic(obr)
{
     var IE=document.all;
	 var obrk = document.images[obr];
	 
	 iWidth2 = (!IE)?window.innerWidth:document.body.clientWidth;
     iHeight2 = (!IE)?window.innerHeight:document.body.clientHeight;
     iWidth = obrk.width - iWidth2;
     iHeight = obrk.height - iHeight2;
     
	 if(!IE){
	 	window.resizeBy(iWidth, iHeight);
		self.moveTo((self.screen.width - self.outerWidth) / 2, (self.screen.height - self.outerHeight) / 2);
	 }
     else{
		 window.resizeTo(obrk.width+10, obrk.height+60);
	 	self.moveTo((self.screen.width-document.body.clientWidth) / 2, (self.screen.height-document.body.clientHeight) / 2);
	 }
     self.focus();
}
