if (typeof(EXP) == 'undefined') {
	EXP		= {};
	EXP.UI	= {};
}

EXP.UI.Global	= function()
{
	var init	= function() {	  
		slidesIn();
	}
	
	var slidesIn = function() {
	
		var imagearray = new Array();
		//read in the xml.	
        //alert(xmlFile);			
		$.get(xmlFile,{},function(xml) { 
		    $('ITEM',xml).each(function() {
			    var img = {};
			    img.path = this.getAttribute('pic1');
			    img.path2 = this.getAttribute('pic2');			    
			    img.venueid=this.getAttribute('venueid'); 
			    img.link1=this.getAttribute('link1');
			    img.link2=this.getAttribute('link2');
			    imagearray[imagearray.length] = img;	
			    img.cur = false;
			    //alert(img.path);				
		    });
    		            
            var thisimage = false;
    	    //alert(imagearray.length);

            var h = $("#ctl00_Content1_divBanner").height();
            var w = $("#ctl00_Content1_divBanner").width();
	        
	        h=268;
	        
			$("#ctl00_Content1_divBanner").prepend('<div id="smokescreen" style="position: absolute; height: '+h+'px; width: '+w+'px; background-color: white;z-index:50"></div>');
				        
			if($.browser.msie && $.browser.version == '6.0') {			
				$("#ctl00_Content1_divBanner").css('position', 'relative').prepend('<div id="ie6mustdie" style="width:55px; overflow: hidden; height: '+(h-25)+'px; position: absolute; right:-3px; top: 0; z-index:101;"></div>');
			}
			
            var showSlide = function() {
            	            	
	            for(var i = 0; i < imagearray.length; i++) {
		            if(imagearray[i].cur == true) {
		                if(false && $.browser.msie && $.browser.version == '6.0') {
			                if(imagearray[0]) {
				                thisimage = imagearray[0];
				                imagearray[i].cur = false;
				                thisimage.cur = true;
			                }
			                break;
		                } else {
			                if(imagearray[i+1]) {
				                thisimage = imagearray[i+1];
				                imagearray[i].cur = false;
				                thisimage.cur = true;
			                } else {
				                imagearray[i].cur = false;
				                thisimage = imagearray[0];
				                imagearray[0].cur = true;							
			                }
			                break;
		                }
		            }
	            }
	            if(!thisimage) {
		            thisimage = imagearray[0];
		            imagearray[0].cur = true;
	            }
            	        

                $(document).ready(function(){   
                    $("#smokescreen").fadeIn(2000, function() {	
                        
                        // Banner Attributes
                        $("#imgBanner1").attr("src",thisimage.path);                          
                        $("#linkBanner1").attr("href",thisimage.link1)
                              	                    
	                    // Fade!	                    
                        $("#smokescreen").fadeOut(1500);
                        //$("#smokescreen").fadeTo(1500,.33);
                        
                        // Add 5sec Delay 
                        $("#smokescreen").animate({opacity: 1.0}, 5000)
                        
                        // Recursive call
                        showSlide();
                    });	                    
                }); // doc ready


            }; // slideIn
            
           showSlide();
                                    
		}); // xml
			
	}	    
	    
	return {
		init: init
	}
	
}();


jQuery(function($) { EXP.UI.Global.init(); });


