icoup11 = new Image();
icoup11.src = "/pictures/ruki1.gif";
icoup12 = new Image();
icoup12.src = "/pictures/ruki2.gif";

icoup21 = new Image();
icoup21.src = "/pictures/pismo1.gif";
icoup22 = new Image();
icoup22.src = "/pictures/pismo2.gif";

icoup31 = new Image();
icoup31.src = "/pictures/poisk1.gif";
icoup32 = new Image();
icoup32.src = "/pictures/poisk2.gif";










var fenster;
var closed = 1;
function windowpopup(popup_url,popup_name,popup_with,popup_height,myWidth,myHeight)
{
if(fenster)
{ if(!closed)
  { fenster.close();
    closed=1;
    fenster=0;
  }
}
   if(!myWidth) {myWidth = 10;}
	if(!myHeight){myHeight = 50;}
	var popup_left = (window.screen.width/2)  - (popup_with/2 + myWidth);
	var popup_top  = (window.screen.height/2) - (popup_height/2 + myHeight);
	var fenster = window.open(popup_url ,popup_name,"toolbar=no,location=no,status=no,menubar=no,scrollbars=1,resizable=1,width=" + popup_with + ",height=" + popup_height + ",left=" + popup_left + ",top=" + popup_top + ",screenX=" + popup_left + ",screenY=" + popup_top);
	fenster.focus();
}





function showElem(elemId){
	document.getElementById(elemId).style.visibility = "visible";
}
function hideElem(elemId){
	document.getElementById(elemId).style.visibility = "hidden";
}
function putElem(elemId) {
	document.getElementById(elemId).style.display = "block";
}
function removeElem(elemId) {
	document.getElementById(elemId).style.display = "none";
}
function getElement( elemId )
{
	return document.getElementById(elemId);

} 


function addbasket ()
{
	windowpopup('popupminiwin', '/scripts/miniwin.html', 200,100);
}



var orig_width;
var popup_left = window.screen.width/2;
var popup_top  = window.screen.height/2;


function showImg(img){
	
	getElement('divshowimg').style.display='block';
	document.images['showimg'].src=img.src;

	
	
	orig_width=img.width;
	orig_height=img.height;
	gooShowImg(20,orig_width,orig_height);

}

function gooShowImg(i,orig_width,orig_height){

	if (i<=0){
		clearTimeout(timer1);
		return false;
	}
	else {
		cur_width = document.images['showimg'].width=parseInt(orig_width/i);
		cur_height = document.images['showimg'].height=parseInt(orig_height/i);
				
		popup_left = (document.body.clientWidth/2)  - (cur_width/2)+document.body.scrollLeft;
		popup_top  = (document.body.clientHeight/2) - (cur_height/2)+document.body.scrollTop;

		getElement('divshowimg').style.left=popup_left;
		getElement('divshowimg').style.top=popup_top;
		
		
		i--;
		timer1=setTimeout("gooShowImg("+i+","+orig_width+","+orig_height+")",10);
		
		
		
	}
}
function gooCloseImg(i,orig_width,orig_height){

	if (i>20){
		clearTimeout(timer2);getElement('divshowimg').style.display='none';
		return false;
	}
	else {
		cur_width = document.images['showimg'].width=parseInt(orig_width/i);
		cur_height = document.images['showimg'].height=parseInt(orig_height/i);
		
		popup_left = (document.body.clientWidth/2)  - (cur_width/2)+document.body.scrollLeft;
		popup_top  = (document.body.clientHeight/2) - (cur_height/2)+document.body.scrollTop;

		getElement('divshowimg').style.left=popup_left;
		getElement('divshowimg').style.top=popup_top;

		
		i++;
		timer2=setTimeout("gooCloseImg("+i+","+orig_width+","+orig_height+")",10);
	}
}

function closeShowdiv(){
	clearTimeout(timer1);
	
	gooCloseImg(1,orig_width,orig_height);
	
	
}







