if (typeof(MEET) == 'undefined') {
	MEET		= {};
	MEET.UI	= {};
}

MEET.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.cur = false;
			    img.venueid=this.getAttribute('venueid'); 
			    img.link1=this.getAttribute('link1');
			    img.link2=this.getAttribute('link2');
			    imagearray[imagearray.length] = img;	
			    //alert(img.path);				
		    });
    		            
            var thisimage = false;
    	    //alert(imagearray.length);

            var h = $("#ctl00_ContentPlaceHolder1_bannerMask").height();
            var w = $("#ctl00_ContentPlaceHolder1_bannerMask").width();
	        
			$("#ctl00_ContentPlaceHolder1_bannerMask").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_ContentPlaceHolder1_bannerMask").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;"><img src="" style="position: absolute; top: 0; right:0;" /></div>');
				$("#ctl00_ContentPlaceHolder1_bannerMask").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() {	
	                    $("#ctl00_ContentPlaceHolder1_bannerMask").css("background-image","url("+thisimage.path+")");
	                    $("#ctl00_ContentPlaceHolder1_maskBtm a").attr("href","venue.aspx?venueid="+thisimage.venueid);
                        $("#smokescreen").fadeOut(1500);
                        //$("#smokescreen").fadeTo(1500,.33);
                        $("#smokescreen").animate({opacity: 1.0}, 5000)
                        showSlide();
                    });	                    
                }); // doc ready


            }; // slideIn
            
           showSlide();
                                    
		}); // xml
			
	}	    
	    
	return {
		init: init
	}
	
}();


jQuery(function($) { MEET.UI.Global.init(); });


