var move=230;
var show_height=520;
var thebtn_mup1="/templates/pshow_temp/images/temp_picview/move_up1.jpg";
var thebtn_mup2="/templates/pshow_temp/images/temp_picview/move_up2.jpg";
var thebtn_mdown1="/templates/pshow_temp/images/temp_picview/move_down1.jpg";
var thebtn_mdown2="/templates/pshow_temp/images/temp_picview/move_down2.jpg";
function init_leftbutton(){
    var menubar_obj=document.getElementById('menubar_left');
    var buttontop_obj=document.getElementById('buttonleft_top');
    var buttonbottom_obj=document.getElementById('buttonleft_bottom');
    var moveobj_height=parseInt(menubar_obj.offsetHeight);
    if(moveobj_height<=show_height)
    {
        buttonbottom_obj.style.background="url(" + thebtn_mdown2 + ") no-repeat center center";
        buttonbottom_obj.style.cursor="normal";
    }
}
window.attachEvent('onload',init_leftbutton);
function movetop(){
    var menubar_obj=document.getElementById('menubar_left');
    var buttontop_obj=document.getElementById('buttonleft_top');
    var buttonbottom_obj=document.getElementById('buttonleft_bottom');
    var movenow=parseInt(menubar_obj.style.top);
    var moveobj_height=parseInt(menubar_obj.offsetHeight);
    var other_height=parseInt(moveobj_height + movenow);
    if(moveobj_height<=show_height)
    {
        menubar_obj.style.top=0;
        buttonbottom_obj.style.background="url(" + thebtn_mdown2 + ") no-repeat center center";
        buttonbottom_obj.style.cursor="normal";
        return false;
    }
    else{
        if(other_height<=show_height)
        {
            return false;
        }
        if(parseInt(moveobj_height-parseInt(move-movenow))<0)
        {
            menubar_obj.style.top=movenow;
            buttonbottom_obj.style.background="url(" + thebtn_mdown2 + ") no-repeat center center";
            buttonbottom_obj.style.cursor="normal";
        }
        else
        {
            menubar_obj.style.top=parseInt(movenow-move);
            buttontop_obj.style.background="url(" + thebtn_mup1 + ") no-repeat center center";
            buttonbottom_obj.style.background="url(" + thebtn_mdown1 + ") no-repeat center center";
            buttontop_obj.style.cursor="pointer";
            buttonbottom_obj.style.cursor="pointer";
        }
        var new_movenew=parseInt(menubar_obj.style.top);
        other_height=parseInt(moveobj_height + new_movenew);
        if(other_height<=show_height)
        {
            buttonbottom_obj.style.background="url(" + thebtn_mdown2 + ") no-repeat center center";
            buttonbottom_obj.style.cursor="normal";
            return false;
        }
    }
}
function movebottom(){
    var menubar_obj=document.getElementById('menubar_left');
    var buttontop_obj=document.getElementById('buttonleft_top');
    var buttonbottom_obj=document.getElementById('buttonleft_bottom');
    var movenow=parseInt(menubar_obj.style.top);
    var moveobj_height=parseInt(menubar_obj.offsetHeight);
    if (parseInt(move+movenow)>=0){
        menubar_obj.style.top=0;
        buttontop_obj.style.background="url(" + thebtn_mup2 + ") no-repeat center center";
        buttontop_obj.style.cursor="normal";
        if(moveobj_height>show_height)
        {
            buttonbottom_obj.style.background="url(" + thebtn_mdown1 + ") no-repeat center center";
            buttonbottom_obj.style.cursor="pointer";
        }
    }
    else{
        menubar_obj.style.top=parseInt(movenow+move);
        buttontop_obj.style.background="url(" + thebtn_mup1 + ") no-repeat center center";
        buttonbottom_obj.style.background="url(" + thebtn_mdown1 + ") no-repeat center center";
        buttontop_obj.style.cursor="pointer";
        buttonbottom_obj.style.cursor="pointer";
    }
}
function chgbig_imgsrc(opobj_val,new_obj)
{
    if(document.getElementById(new_obj))
    {
        var newObj=document.getElementById(new_obj);
        newObj.src=opobj_val;
    }
}
function chang_linksrc(link_url,new_obj)
{
    if(document.getElementById(new_obj))
    {
        var newObj=document.getElementById(new_obj);
        newObj.href=link_url;
    }
}
var open_winobj;
function open_newwindow(url_var,win_name)
{
    var win_width=screen.width;
    var win_height=screen.height;
    if (open_winobj)
    {
        open_winobj.close();
        open_winobj=null;
        open_winobj=window.open(url_var,win_name,"width=" + win_width + ",height=" + win_height + ",top=0,left=0,scrollbars=1, resizable=yes");
    }
    else
    {
        open_winobj=window.open(url_var,win_name,"width=" + win_width + ",height=" + win_height + ",top=0,left=0,scrollbars=1, resizable=yes");
    }
}