
function video_change1(i)




{


v=Video[i];
im=Video1[i];
n=Video2[i];

f='/filefile.asp?file=/video/video/'+v;
x=720;
y=576;

im="";

//document.getElementById("video_Name").innerHTML='';
document.getElementById("video").style.display="none";
document.getElementById("video").width='0px';
document.getElementById("video").height='0px';
document.getElementById("video").style.marginLeft='0px';
document.getElementById("video").style.marginTop='0px'


document.getElementById("videoIMG_x").style.marginLeft='0px';
document.getElementById("videoIMG_x").style.marginTop='0px'


//document.getElementById("videoIMG_dec").src="/images/0.gif";


document.getElementById("video").width=x;
document.getElementById("video").height=y;

	set_declaration_fon();
	place_center_video();
document.getElementById("videoIMG_Name").style.width=x+"px";
document.getElementById("videoIMG_x").style.marginLeft=(x-1)+25+'px'


document.getElementById("videoIMG_Name").innerHTML=n;


	document.getElementById("declaration_fon").style.display="block";

	document.getElementById("video").style.display="block";




var s1 = new SWFObject("/services/p/player.swf","ply","720p","576","0","#FFFFFF");
		s1.addParam("allowfullscreen","true");

		s1.addParam("allowscriptaccess","always");

		s1.addParam("flashvars","image="+im+"&file="+f);

		s1.write("tableT");










}


function set_declaration_fon()
{
	document.getElementById("declaration_fon").style.height=getDocumentHeight()+"px";
	//document.getElementById("declaration_fon").style.width=document.documentElement.scrollWidth+"px";
}
function place_center()
{
	var width=document.getElementById("declaration").width;


	var height=document.getElementById("declaration").height;
    var left = getBodyScrollLeft() + (getDocumentWidth() - width )/2 ;
    var top = getBodyScrollTop() + (screen.height - height)/2 - 100;

	document.getElementById("declaration").style.marginLeft = Math.max(0,left) + 'px';
    document.getElementById("declaration").style.marginTop  = Math.max(getBodyScrollTop(),top) + 'px';

}



function place_center_video()
{
	var width=document.getElementById("video").width;


	var height=document.getElementById("video").height;
    var left = getBodyScrollLeft() + (getDocumentWidth() - width )/2 ;
    var top = getBodyScrollTop() + (screen.height - height)/2 - 100;

	document.getElementById("video").style.marginLeft = Math.max(0,left) + 'px';
    document.getElementById("video").style.marginTop  = Math.max(getBodyScrollTop(),top) + 'px';

}






function photo_change(img, n,x,y)
{
document.getElementById("IMG_Name").innerHTML='';
document.getElementById("declaration").style.display="none";
document.getElementById("declaration").width='0px';
document.getElementById("declaration").height='0px';
document.getElementById("declaration").style.marginLeft='0px';
document.getElementById("declaration").style.marginTop='0px'


document.getElementById("IMG_x").style.marginLeft='0px';
document.getElementById("IMG_x").style.marginTop='0px'


document.getElementById("IMG_dec").src="/images/0.gif";


document.getElementById("declaration").width=x;
document.getElementById("declaration").height=y;

	set_declaration_fon();
	place_center();
document.getElementById("IMG_Name").style.width=x+"px";
document.getElementById("IMG_x").style.marginLeft=(x-1)+25+'px'

document.getElementById("IMG_dec").src=img;
document.getElementById("IMG_Name").innerHTML=n;


	document.getElementById("declaration_fon").style.display="block";

	document.getElementById("declaration").style.display="block";


}






function photo_changePN(i)
{

i=i-0;
document.getElementById("IMG_Name").innerHTML='';
document.getElementById("declaration").style.display="none";
document.getElementById("declaration").width='0px';
document.getElementById("declaration").height='0px';
document.getElementById("declaration").style.marginLeft='0px';
document.getElementById("declaration").style.marginTop='0px'


document.getElementById("IMG_x").style.marginLeft='0px';
document.getElementById("IMG_x").style.marginTop='0px'


document.getElementById("IMG_dec").src="/images/0.gif";



document.getElementById("declaration").width=iMx[i];
document.getElementById("declaration").height=iMy[i];



	set_declaration_fon();
	place_center();
document.getElementById("IMG_Name").style.width=iMx[i]+"px";


document.getElementById("IMG_PN").style.width=(iMx[i]-1)+30+"px";

if(i!=1)
{
PN='<img src="/images/ll1.png" width="27" height="42" onMouseOver="this.src=\'/images/l.png\'" onMouseOut="this.src=\'/images/ll1.png\'"  align="absmiddle" class="PN"  alt="Предыдущая" border="0" onClick="photo_changePN('+(i-1)+');">';
}
else
{
PN='<img src="/images/0.gif" width="27" height="42" alt="" border="0">';
}

PN=PN+'<img src="/images/0.gif" width="27" height="42" alt="" border="0">';

maxI=iM.length-1;
if(i<maxI)
{
PN=PN+'<img src="/images/rr1.png" width="27" height="42"onMouseOver="this.src=\'/images/r.png\'" onMouseOut="this.src=\'/images/rr1.png\'" align="absmiddle" class="PN"  alt="Следующая" border="0" onClick="photo_changePN('+(i+1)+');">';
}
else
{
PN=PN+'<img src="/images/0.gif" width="27" height="42" alt="" border="0">';
}



//alert(PN);

document.getElementById("IMG_PN").innerHTML=PN;






document.getElementById("IMG_x").style.marginLeft=(iMx[i]-1)+25+'px'

document.getElementById("IMG_dec").style.width=iMx[i]+"px";
document.getElementById("IMG_dec").style.height=iMy[i]+"px";


document.getElementById("IMG_dec").src='/images/'+iM[i];
document.getElementById("IMG_Name").innerHTML='<b>'+iMn[i]+'</b> ('+i+' из ' + maxI + ')';


	document.getElementById("declaration_fon").style.display="block";

	document.getElementById("declaration").style.display="block";


}
















function hide_declaration()
{
  	document.getElementById("declaration_fon").style.display="none";
	document.getElementById("declaration").style.display="none";
document.getElementById("declaration_fon").style.display="none";
	document.getElementById("video").style.display="none";
document.getElementById("tableT").innerHTML="";
}


function hide_video()
{
  	document.getElementById("declaration_fon").style.display="none";
	document.getElementById("video").style.display="none";

document.getElementById("tableT").innerHTML="";

}




function getBodyScrollTop()
{
  return self.pageYOffset || 
    (document.documentElement && document.documentElement.scrollTop) || 
    (document.body && document.body.scrollTop);
}

function getBodyScrollLeft()
{
  return self.pageXOffset || 
    (document.documentElement && document.documentElement.scrollLeft) || 
    (document.body && document.body.scrollLeft);
}


function getBodyScrollTop()
{
  return self.pageYOffset || 
    (document.documentElement && document.documentElement.scrollTop) || 
    (document.body && document.body.scrollTop);
}

function getBodyScrollLeft()
{
  return self.pageXOffset || 
    (document.documentElement && document.documentElement.scrollLeft) || 
    (document.body && document.body.scrollLeft);
}


//Размер документа по вертикали
function getDocumentHeight()
{
  return (document.body.scrollHeight > document.body.offsetHeight)?
    document.body.scrollHeight:
    document.body.offsetHeight;
}

//Размер документа по горизонтали
function getDocumentWidth()
{
  return (document.body.scrollWidth > document.body.offsetWidth)?
    document.body.scrollWidth:
    document.body.offsetWidth;
}



			







