﻿function PTConfirmAction() {
    if (confirm('Are you sure?')==true) {
        return true;
    } else {
        return false;
    }
}

function PTShowHideItem(myItem) {
    if (myItem.style.visibility != 'hidden') {
		myItem.style.visibility = 'hidden';
		myItem.style.display = 'none';
    } else {
		myItem.style.visibility = 'visible';
		myItem.style.display = '';
    }
    return false;
}

function PTImgZoom(sPicURL) {
    window.open( "_ImgZoom.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}
var tid=0;
var cobj=null;
function flashlist(elem)
{
    var img = elem.getElementsByTagName('img');
    var uls = elem.parentNode.getElementsByTagName('ul');
    cobj=uls[0];
    var reg = new RegExp(/plus\.gif/);
    if(reg.test(img[0].src))
    {
        img[0].src='images/treeview_minus.gif';
        //tid = setInterval('animate(\'expand\');',10);
        cobj.style.display='';
    }
    else
    {
        img[0].src='images/treeview_plus.gif';
        //tid = setInterval('animate(\'collapse\');',10);
        cobj.style.display='none';
    }
}

function animate(act)
{
    //alert(parseInt(cobj.style.height));
    if(act=='expand')
    {
        if(parseInt(cobj.style.height) >= (cobj.getElementsByTagName('li').length * 25))
        {
            clearInterval(tid);
            cobj=null;
            return;
        }
        cobj.style.height = parseInt(cobj.style.height) + 10;
        cobj.style.display='';
    }
    else if(act=='collapse')
    {
        if(parseInt(cobj.style.height) <= 0)
        {
            clearInterval(tid);
            cobj.style.display='none';
            cobj=null;
            return;
        }
        cobj.style.height = parseInt(cobj.style.height) - 10;
    }
}
