$(document).ready(function(){	
	
	$("#slidesContainer").easySlider({
		auto: true, 
		continuous: true,
		nextId: "rightControl",
		prevId: "leftControl"
	});
			
	function addMega(){
	$(this).addClass("hovering");
	}

	function removeMega(){
	$(this).removeClass("hovering");
	}

	var megaConfig = {
	interval: 1,
	sensitivity: 1,
	over: addMega,
	timeout: 1,
	out: removeMega
	};

	$("li.mega").hoverIntent(megaConfig)

});	

 var isStarted = 0;
 var iMenu1 = 0;
 var iMenu2 = 0;
 var iDelay = 5000;
 var arrMenu1 = new Array('Conducrete','Enviranode','Conducrete','specialist-earth-bars','rail-products','ese-devices');
 var arrMenu2 = new Array('britclips','ezifix','surge-protection','britclips','premium-range');
if (document.images)
{
  preload_image_object = new Image();

  var i = 0;
  for(i=0; i<arrMenu1.length; i++) 
  {
    preload_image_object.src = arrMenu1[i];
  }
  for(i=0; i<arrMenu2.length; i++) 
  {
    preload_image_object.src = arrMenu2[i];
  }  
}

function imageSwitch()
{
  if (isStarted == 0)
  {
    isStarted = 1;
    setTimeout('imageSwitch()',iDelay);
    
  }
  else
  {
    iMenu1 ++;
    iMenu2 ++;
    if (iMenu1 > (arrMenu1.length-1))
    {
      iMenu1 = 0;
    }
    if (iMenu2 > (arrMenu2.length-1))
    {
      iMenu2 = 0;
    }
    sDiv = document.getElementById('ul_menu2');
    sDiv.style.background = 'url(Images/Page/'+arrMenu1[iMenu1]+'.jpg) no-repeat';
    sDiv = document.getElementById('ul_menu3');
    sDiv.style.background = 'url(Images/Page/'+arrMenu2[iMenu2]+'.jpg) no-repeat';
    for (i=0;i<(arrMenu1.length);i++)
    {
      sDiv = document.getElementById('link_2_'+i);
      sDiv.style.textDecoration = 'none';
    }
    for (i=0;i<(arrMenu2.length);i++)
    {
      sDiv = document.getElementById('link_3_'+i);
      sDiv.style.textDecoration = 'none';
    }
    sDiv = document.getElementById('link_2_'+iMenu1);
    sDiv.style.textDecoration = 'underline';
    sDiv = document.getElementById('link_3_'+iMenu2);
    sDiv.style.textDecoration = 'underline';
    
    setTimeout('imageSwitch()',iDelay);    
  }
}

var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function JSFX_FloatDiv(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.top=y+px;};
 
	el.floatIt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.floatIt()", 40);
	}
	return el;
}
JSFX_FloatDiv("mlJoin",       '',   50).floatIt();
JSFX_FloatDiv("mlConfirm",       '',   50).floatIt();
 
