function ShowImage(img) {
                                           
	var bottom=document.getElementById("imgBottom");
	var top=document.getElementById("imgTop");     

	top.src=portfolioImgs[img];
	top.style.top=0;
	top.style.left="649px";
	slide('imgTop',0,0,5);	
}

/**************************************
 Moves an elements x/y coords
**************************************/
function increment(elm,x,y,i) {
    var e=document.getElementById(elm).style;
    var x2=parseInt(e.left)+x;
    var y2=parseInt(e.top)+y;    
    slide(elm,x2,y2,i);
    return true;
}

function setImages() {
	var bottom=document.getElementById("imgBottom");
	var top=document.getElementById("imgTop");     
	
	bottom.src=top.src;
	top.style.left="649px";
}

/*********************************************
 Moves element to x/y coord at set increments
**********************************************/
function slide(elm, x, y,i) {
    if (!document.getElementById) return false;
    
    var em=document.getElementById(elm)
    var e=document.getElementById(elm).style;
    var yPos=parseInt(e.top); //get top position (x)
    var xPos=parseInt(e.left); //get left position (y)
	
    if (em.sliding) clearTimeout(em.sliding); //clear the timout if it still remains
    
    if (yPos==y && xPos==x) {setImages(); return true;} // if we're at the correct spot then quit
    
    if (yPos>y) {    
        var moveY = Math.ceil((yPos-y)/i); 
        e.top=(yPos-moveY)+"px";
    }
        
    if (yPos<y) {
        var moveY = Math.ceil((y-yPos)/i); 
        e.top=(yPos+moveY)+"px";
    }
        
    if (xPos>x){
        var moveX = Math.ceil((xPos-x)/i);
        e.left=(xPos-moveX)+"px";
    }
            
    if (xPos<x) {
        var moveX = Math.ceil((x-xPos)/i);    
        e.left=(xPos+moveX)+"px";
    }        
	
    var toStr="slide('"+elm+"',"+x+","+y+","+i+")";        	
    em.sliding=setTimeout(toStr,10);          
    return false;

}

/**********************************************
 Selects client name in ID field clientName
***********************************************/ 
function selectClient(c) {
	if (!document.getElementById) return false;
	var e=document.getElementById("clientName");
	e.firstChild.nodeValue=c;
	return true;
}