 /* AJAX Major Functions
    Author: GC Web Studio - Gustavo Campos me@guscampos.com
  */		
  			
			function windowsLoaderAdd(func) {
				windowsLoader[windowsLoader.length] = func;
			}
			function windowsLoadFunc() {
				for(i=0;i<windowsLoader.length;i++) {
					eval(windowsLoader[i]);
				}
			}
			function loadFunc() {
				window.onload = windowsLoadFunc;
			}
			windowsLoader = new Array();
			
			dom = {  
			  
			  currPanel : 1,
			  nextPanel : 1,			  
			  panelTimer : null,
			  panelDelay : 6,
			  panelSpeed : 10, 
			  panelButtons : true,
			  panelTotal : 0,
			  
			  blackOut: function(){
				//set blackout div width and height
				var winWidth = document.documentElement.offsetWidth;
				var winHeight = document.documentElement.scrollHeight;
				$('blackout').style.display = 'block';
				$('blackout').style.height = winHeight + 'px';
				$('blackout').style.width = winWidth + 'px';
			  },
			  
			  //Fade in/out scroller by Gustavo Campos - www.gcwebstudio.com
			  //requires prototype.js
			  //if no prototype is found, change $('panel-' + w) to document.getElementById('panel-' + w);
			  //free for everyone to use
			  
			  fadeIn: function(w,m) {
				  
				   var c;				   
				   var opacity = 0;
				   var timer = 0;
				   var speed = Math.round(500/100);
				   c = $('panel-' + w);
				   if(dom.panelButtons) {
					   b = $('panel-button-' + w);
				   }
				   
				   $('panel-' + dom.currPanel).hide();
				   if(dom.panelButtons) {
				       $('panel-button-' + dom.currPanel).removeClassName('ison');
				   }
				   c.style.opacity = opacity; 
				   c.style.MozOpacity = opacity; 
				   c.style.KhtmlOpacity = opacity; 
				   c.style.filter = "alpha(opacity="+opacity+")"; 
				   c.show();
				   if(dom.panelButtons) {
					   b.addClassName('ison');
				   }
				  			   
				   for(i=0;i<=100;i++) {
					   setTimeout("dom.showIt("+i+","+w+")",(timer*speed));
					   timer++;
				   }
				  
				  dom.currPanel = w;				  
				  if(m == 1) {
					  clearInterval(dom.panelTimer);
					  dom.initFades();
				  }
				 
			  },
			
			  showIt : function(o,w) {	
			    var c;
				c = $('panel-' + w);
				c.style.opacity = (o / 100); 
				c.style.MozOpacity = (o / 100); 
				c.style.KhtmlOpacity = (o / 100); 
				c.style.filter = "alpha(opacity=" + o + ")"; 
			  },
			  
			  rotateFades: function() {
				var total = dom.panelTotal;
				if(total == 1) { return false; }
				if(dom.nextPanel == total) {
					dom.nextPanel = 1;
				} else {
					dom.nextPanel = dom.currPanel + 1;
				}
				dom.fadeIn(dom.nextPanel,2);
			
			  },
			  
			  initFades: function() {
				  dom.panelTimer = setInterval("dom.rotateFades()",(dom.panelDelay*1000));
			  }

	
			}
			
			