﻿// JScript File

function WindowOpen(id){
    var Path="Photoshow.aspx?id="+id
    MyWin=window.open(Path,'Caterland',config='toolbar=no,menubar=no,location=no,directories=no,status=no,screenX=50,screenY=50,left=50,top=50');
    MyWin.focus();
}

function ChangeSize()
{
    var Cimage;
    Cimage=document.getElementById("MainImage");
    
    var Height=parseInt(Cimage.height)+200;
    var Width=parseInt(Cimage.width)+50;
    
    if (Width<300)
        Width=300;

    window.resizeTo(Width,Height);
    var OffsetX=Width/2;
    window.moveTo(screen.width/2-OffsetX,50);
}

function fixsizes(id1,id2,id3,id4,id5)
{
    pn1=document.getElementById(id1);
    pn2=document.getElementById(id2);
    pn3=document.getElementById(id3);
    pn4=document.getElementById(id4);
    pn5=document.getElementById(id5);
    var newHeight
    newHeight=FindMax(pn1.clientHeight,pn2.clientHeight,pn3.clientHeight,pn4.clientHeight,pn5.clientHeight);
    newHeight=newHeight-15;
    pn1.style.height=newHeight+"px";
    pn2.style.height=newHeight+"px";
    pn3.style.height=newHeight+"px";
    pn4.style.height=newHeight+"px";
    pn5.style.height=newHeight+"px";
}


function Offsetfixsizes(id1,id2,id3,id4,id5)
{
    pn1=document.getElementById(id1);
    pn2=document.getElementById(id2);
    pn3=document.getElementById(id3);
    pn4=document.getElementById(id4);
    pn5=document.getElementById(id5);
    var newHeight
    newHeight=FindMax(pn1.offsetHeight,pn2.offsetHeight,pn3.offsetHeight,pn4.offsetHeight,pn5.offsetHeight);
    newHeight=newHeight-20;
    pn1.style.height=newHeight+"px";
    pn2.style.height=newHeight+"px";
    pn3.style.height=newHeight+"px";
    pn4.style.height=newHeight+"px";
    pn5.style.height=newHeight+"px"; 
}


function FindMax(a,b,c,d,e){
    var ret;
    ret=a;
    if (b>ret)
        ret=b;
    if (c>ret)
        ret=c;
    if (d>ret)
        ret=d;
    if (e>ret)
        ret=e;
    return ret;
}
