function dopphotos(width,height,file)
{
	DopPhotosTimeout = setTimeout("dopphotos_start('"+width+"','"+height+"','"+file+"')",800);
	DopPhotosZamenaTimeout = setTimeout("Math.random()",1);
}

function dopphotos_start(width,height,file)
{
	dopphoto_view(width,height,file);
}

function dopphotos_stop()
{
	clearTimeout(DopPhotosTimeout);
}

function dopphoto_view(width,height,file)
{
	var doctype = "XHTML";
	
	if(doctype=="XHTML")
	{
		scrollLeft=Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
		scrollTop=Math.max(document.documentElement.scrollTop, document.body.scrollTop);
		X = (document.documentElement.clientWidth - width - 22)/2 + scrollLeft;
		Y = (document.documentElement.clientHeight - height - 22)/2 + scrollTop;
		X_window = document.documentElement.clientWidth + scrollLeft;
		Y_window = document.body.clientHeight;
	}
	
	if(doctype=="HTML")
	{
		X = (document.body.clientWidth - width - 22)/2 + document.body.scrollLeft;
		Y = (document.body.clientHeight - height - 22)/2 + document.body.scrollTop;
		X_window = document.body.clientWidth + document.body.scrollLeft;
		Y_window = document.body.scrollHeight;
	}
	
	if(file.length>0)
	{
		document.getElementById("dopphoto_img").className=file;
		document.getElementById("dopphoto_img").src="/base_images/dopphotos/"+file+"_dopphoto.jpg";
	}
	
	//document.getElementById("dopphoto_img").width = width;
	//document.getElementById("dopphoto_img").height = height;
	
	document.getElementById("dopphotos").style.width = (Number(width) + 24)+"px";
	document.getElementById("dopphotos").style.height = (Number(height) + 45)+"px";
	
	document.getElementById("dopphotos").style.left = X+"px";
	document.getElementById("dopphotos").style.top = Y+"px";
	document.getElementById("dopphotos").style.display="block";
	
	document.getElementById("page_bigdiv").style.width = X_window+"px";
	document.getElementById("page_bigdiv").style.height = Y_window+"px";
	document.getElementById("page_bigdiv").style.display="block";
	
	PhotoTimeout = setTimeout("dopphoto_view('"+width+"','"+height+"','');",300);
}

function dopphoto_load()
{
	fadeOpacity('dopphoto_img','opacity');
	dopphoto_zamena_class=document.getElementById("dopphoto_img").className;
	dopphoto_zamena(dopphoto_zamena_class);
}

function dopphoto_close()
{
	clearTimeout(PhotoTimeout);
	clearTimeout(DopPhotosZamenaTimeout);
	fadeOpacity.back('dopphoto_img','opacity');
	setTimeout("dopphoto_hidden();",300);
}
function dopphoto_hidden()
{
	document.getElementById("dopphotos_text").innerHTML="&nbsp;";
	document.getElementById("dopphotos").style.display="none";
	document.getElementById("page_bigdiv").style.display="none";
}





function dopphotos_one(width,height,file)
{
	DopPhotosTimeout = setTimeout("dopphotos_one_start('"+width+"','"+height+"','"+file+"')",800);
	DopPhotosZamenaTimeout = setTimeout("Math.random()",1);
}

function dopphotos_one_start(width,height,file)
{
	photo_view('products/'+file,width,height);
}

function dopphotos_one_stop()
{
	clearTimeout(DopPhotosTimeout);
}