$(document).ready(function(){
						
						widthcounter=0;  
						widthmax=980;
						splitmax=75; 
						splitmin=20;
						openpause=3500;
						loopcontent=$("#splitter").html();
						//alert(loopcontent);
						
						
						
						
						for (myloop=1;myloop<=50;myloop++){
							newwidth=(Math.floor(Math.random()*splitmax)+splitmin);
							if(widthcounter+newwidth>widthmax){
								newwidth=widthmax-widthcounter;
								
							}
							imageleft=0-widthcounter;
							splitleft=widthcounter;
							
							myloopcontent=loopcontent.replace("222",newwidth);
							myloopcontent=myloopcontent.replace("111",splitleft);
							myloopcontent=myloopcontent.replace("333",imageleft);
							//alert(myloopcontent);
							
							$("#splitter").append(myloopcontent);
							widthcounter=widthcounter+newwidth;
							if(widthcounter==widthmax){
								break;
							}
							
						}
					
						
					
					
					
					function doitnow(){
						$("#gallholder").css("top","0px");
						
						$(".split").animate({width: "0px","opacity":.5},{ queue:true, duration:4500});
						
					}
						
				
				
				$(".imageholder img").load(function(){
					
					
					$(".featureimage img").load(function(){
					
						
				starttimer=setTimeout(doitnow,openpause);
				
					});
				
				});
				
				
				fallback=setTimeout(saftrap,3000);
				
				
				
				function saftrap(){
					if ($(".featureimage img").width()>400 && $(".imageholder img").width()>400){
					
					starttimer=setTimeout(doitnow,openpause);
				}
					
				}
				
						
						
						
$(".splitters").each(function(){
	//this.css("width",(Math.floor(Math.random()*100)+50));
	
	
});
						   
						   
}); //end of jquery
