// ------------------------------------------------------------------------
// MC_DEFAULT.JS
// Copyright: © 1998-2006 Maintenance Connection, Inc. All rights reserved.
// ------------------------------------------------------------------------

	if (self.location.href.indexOf('https:') != -1)
	{
		self.location.replace(self.location.href.replace('https:','http:'));
	}
	
	window.name = 'mcwelcome';
	
	if (self.expirestag)
	{ 
		document.writeln(self.expirestag);
	}
	
	var timeoutid = null;
	var loading = false;
	var mcappwindow = null;

	var SlideShowSpeed = 5000;
	var CrossFadeDuration = 3;

	var Picture = new Array(); // don't change this

	Picture[1]  = 'images/cmms_software_1.jpg';
	Picture[2]  = 'images/cmms_software_3.jpg';
	Picture[3]  = 'images/cmms_software_5.jpg';
	Picture[4]  = 'images/cmms_software_6.jpg';
	Picture[5]  = 'images/cmms_software_7.jpg';

	var preLoad = new Array();

	var tss;
	var iss;
	var jss = 1;
	var pss = Picture.length-1;

	function runSlideShow(){
	
		if (document.all){
		document.images.cmms_photo.style.filter="blendTrans(duration=2)";
		document.images.cmms_photo.style.filter="blendTrans(duration=CrossFadeDuration)";
		document.images.cmms_photo.filters.blendTrans.Apply();}
		document.images.cmms_photo.src = preLoad[jss].src;
		if (document.all) document.images.cmms_photo.filters.blendTrans.Play();
		jss = jss + 1;
		if (jss > (pss)) jss=1;
		tss = setTimeout('runSlideShow()', SlideShowSpeed);
		
	}
		
	function window_load()
	{
		if (window.screen.width < 1024)
		{
			//self.location.href = 'mc_notlargescreen.htm';  
			self.moveTo(0,0);
			self.resizeTo(screen.availWidth,screen.availHeight);
		}
		else
		{
			if (window.document.body.clientWidth < 850 && self.parent == null)  
			{
				self.moveTo(0,0);
				self.resizeTo(screen.availWidth,screen.availHeight);
			}				
		}

		if (self.location.href.toLowerCase().indexOf('connect.com') != -1)
		{
			self.location.href = self.location.href.toLowerCase().replace('connect.com','connection.com');
		}
	
		//for (iss = 1; iss < pss+1; iss++){
		//preLoad[iss] = new Image();
		//preLoad[iss].src = Picture[iss];}

		self.document.getElementById('initdiv').style.display = 'none';
		
		//runSlideShow();
		
		// if Session cookie is still around...kill it!
		try
		{
			deleteCookie('mcmain','/');
			deleteCookie('mcmainadmin','/');
			self.document.getElementById('logondiv').style.display = '';		
			preloadImages('images/mc_logonew_dark.jpg','images/loading4.gif');
			document.anchors('alogin').focus();
		}
		catch(e)
		{}
	}
