	
//status arrays for UI functions
var sm = new Array();  //move status



//hide and show functions... could be evoled to fade ins and outs but would need a que

function display(id){
	document.getElementById(id).style.display = "block";
	}

function hide(id){
	document.getElementById(id).style.display = "none";
	}

//scoll stuff

function scroll(distance, thediv, duration){
			
			var curdis = parseInt(document.getElementById(thediv).style.top);
			var truheight = parseInt(document.getElementById(thediv).offsetHeight);
			var scrollheight = parseInt(document.getElementById(thediv).parentNode.offsetHeight);
			var curheight = scrollheight-truheight;
			
			if(isNaN(curdis)){curdis = 0;}

			newdis = distance+curdis;			
			
			if(newdis<=curheight){
				$("#"+thediv).animate({ 
    			    'top': curheight+"px",
    				  }, duration);
    			$("#slider").slider('value', 0);
			}else if(newdis>=0){
				$("#"+thediv).animate({ 
    			    'top': "0px",
    				  }, duration);
    			$("#slider").slider('value', 100);
            }else{
                $("#"+thediv).animate({ 
    			    'top': newdis+"px",
    				  }, duration);
    			$("#slider").slider('value', 100-(newdis/curheight)*100);
                
			};
			
			}
			
			
			
function sidescroll(distance, thediv, duration){
			
            var curdis = parseInt(document.getElementById(thediv).style.left);
			var truwidth  = parseInt(document.getElementById(thediv).offsetWidth);
			var scrollwidth = parseInt(document.getElementById(thediv).parentNode.offsetWidth);
			var curleft = scrollwidth-truwidth;
			
			if(isNaN(curdis)){curdis = 0;}

			newdis = distance+curdis;			
					
			if(newdis<=curleft){
				$("#"+thediv).animate({ 
    			    'left': curleft+"px",
    				  }, duration);
    			$("#slider").slider('value', 100);
			}else if(newdis>=0){
				$("#"+thediv).animate({ 
    			    'left': "0px",
    				  }, duration);
    			$("#slider").slider('value', 0);
            }else{
                $("#"+thediv).animate({ 
    			    'left': newdis+"px",
    				  }, duration);
    			$("#slider").slider('value', (newdis/curleft)*100);
                
			};
			
			}
		