//RoMAN Zone PicSizer (rzPicSizer)
//RoMAN Zone JavaScripts
//(c) R.B. - RoMAN Zone 2008
var wnumber = 4; // Speed
var wtimer = 20; //Rate 10 

function zoomin(picid)
{
var newmaxw = (document.getElementById(picid+"_width").value / 100) * 120;
var newmaxh = (document.getElementById(picid+"_height").value / 100) * 120;
document.getElementById(picid+"_mode").value = 'zoomin';
if(document.getElementById(picid).width<newmaxw)
{
setTimeout("sizeupw('"+picid+"', '"+newmaxw+"', '"+newmaxh+"')", wtimer);
}
}
function zoomout(picid)
{
document.getElementById(picid+"_mode").value = 'zoomout';
if(document.getElementById(picid).width>document.getElementById(picid+"_width").value)
{
setTimeout("sizedownw('"+picid+"')", wtimer);
}
}



function sizeupw(picid, newmaxw, newmaxh)
{
var hnumber = newmaxh / newmaxw * wnumber;
Math.round(hnumber);
//alert(hnumber);
if(document.getElementById(picid+"_mode").value == 'zoomin')
{
document.getElementById(picid).width = document.getElementById(picid).width + wnumber;
document.getElementById(picid).height = document.getElementById(picid).height + hnumber;
if(document.getElementById(picid).width<newmaxw)
{
setTimeout("sizeupw('"+picid+"', '"+newmaxw+"', '"+newmaxh+"')", wtimer);
}
else
{
document.getElementById(picid).width = newmaxw;
document.getElementById(picid).height = newmaxh;
}
}
}

function sizedownw(picid)
{
var oldmaxw = document.getElementById(picid+"_width").value;
var oldmaxh = document.getElementById(picid+"_height").value;
var hnumber = oldmaxh / oldmaxw * wnumber;
Math.round(hnumber);
if(document.getElementById(picid+"_mode").value == 'zoomout')
{
document.getElementById(picid).width = document.getElementById(picid).width - wnumber;
document.getElementById(picid).height = document.getElementById(picid).height - hnumber;
if(document.getElementById(picid).width>document.getElementById(picid+"_width").value)
{
setTimeout("sizedownw('"+picid+"')", wtimer);
}
else
{
document.getElementById(picid).width = document.getElementById(picid+"_width").value;
document.getElementById(picid).height = document.getElementById(picid+"_height").value;
}
}
}
