var zoomfactor=0.3
function img_zoom_in(id,maxW,maxH,bigSrc,colPos,border){
    document.getElementById("o_"+id).style.zIndex=1;
    document.getElementById("i_"+id).style.zIndex=1; 
    document.getElementById("img_"+id).style.zIndex=1;
    document.getElementById("div_"+id).style.zIndex=1;
    
    if(colPos==0){
        document.getElementById("col3_content").style.zIndex=1; 
        document.getElementById("col2_content").style.zIndex=0;
        //document.getElementById("col1_content").style.zIndex=0;
        document.getElementById("col3").style.zIndex=1; 
        document.getElementById("col2").style.zIndex=0;
        //document.getElementById("col1").style.zIndex=0;                
    } else{
        document.getElementById("col3_content").style.zIndex=0; 
        document.getElementById("col2_content").style.zIndex=1;
        //document.getElementById("col1_content").style.zIndex=0;             
        document.getElementById("col3").style.zIndex=0; 
        document.getElementById("col2").style.zIndex=1;
        //document.getElementById("col1").style.zIndex=0;                
    }
    
    imgWidth=document.images["img_"+id].width;
    zoominterval=imgWidth<100?20:50;
    document.images["img_"+id].src=bigSrc;
    beginzoom=setInterval("zoomIn('"+id+"',"+maxW+","+maxH+",'"+bigSrc+"',"+border+")",zoominterval);            
}
                              
function zoomIn(id,maxW,maxH,bigSrc,border){
    if (document.images["img_"+id].width<maxW || document.images["img_"+id].height<maxH){
        imgWidth=document.images["img_"+id].width;
        imgHeight=document.images["img_"+id].height;
        newWidth=parseInt(imgWidth+imgWidth*zoomfactor);
        newHeight=parseInt(imgHeight+imgHeight*zoomfactor);
        width=newWidth<maxW?newWidth:maxW;
        height=newHeight<maxH?newHeight:maxH;
        document.images["img_"+id].width=width;
        document.images["img_"+id].height=height;
        
        newITop=parseInt(document.getElementById("i_"+id).style.top)-(height-imgHeight)/2+2;
        newILeft=parseInt(document.getElementById("i_"+id).style.left)-(width-imgWidth)/2+2;
                                                     
        document.getElementById("i_"+id).style.top=newITop+"px";
        document.getElementById("i_"+id).style.left=newILeft+"px";   
    } else{
        document.images["img_"+id].width=maxW;
        document.images["img_"+id].height=maxH; 
        if(border==1){
            document.getElementById("img_"+id).style.border="1px solid #918a7f";            
        }        
        clearInterval(beginzoom);
    }
}
                                
function restore(id,minW,minH,src){
    document.images["img_"+id].width=minW;
    document.images["img_"+id].height=minH;
    document.images["img_"+id].src=src;
                                                                         
    document.getElementById("i_"+id).style.top="0px";
    document.getElementById("i_"+id).style.left="0px";
    
    document.getElementById("o_"+id).style.zIndex=0;
    document.getElementById("i_"+id).style.zIndex=0;
    document.getElementById("img_"+id).style.zIndex=0;
    document.getElementById("div_"+id).style.zIndex=0;
    document.getElementById("img_"+id).style.border="0px";
    
    document.getElementById("col3_content").style.zIndex=0; 
    document.getElementById("col2_content").style.zIndex=0;
    document.getElementById("col3").style.zIndex=0; 
    document.getElementById("col2").style.zIndex=0;
    clearInterval(beginzoom); 
}