<!---------- Swap Image ---------->

function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v3.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}




var mycarousel_itemList = [
  {url: '<a href="prod02_01.html"><img src="images/hotpic01.jpg" width="228" height="141" id="img1" border="0" /></a>', title: 'Motion Sensor Emergency Light<br>(Model No. 2081)'}
  ,{url: '<a href="prod06_01.html"><img src="images/hotpic02.jpg" width="228" height="141" id="img2" border="0" /></a>', title: 'Easy light<br>(Model No. 2082)'}
  ,{url: '<a href="prod03_02.html"><img src="images/hotpic03.jpg" width="228" height="141" id="img3" border="0" /></a>', title: 'Clip Light w/mirror<br>(Model No. 307)'}
  ,{url: '<a href="prod04_02.html"><img src="images/hotpic04.jpg" width="228" height="141" id="img4" border="0" /></a>', title: 'Square shaped Mini Push Light<br>(Model No. 827S)'}
  ,{url: '<a href="prod02_03.html"><img src="images/hotpic05.jpg" width="228" height="141" id="img5" border="0" /></a>', title: 'Motion Sensor Light<br>(Model No. 305L)'}
];

function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
{
    // The index() method calculates the index from a
    // given index who is out of the actual item range.
    var idx = carousel.index(i, mycarousel_itemList.length);
    carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx - 1]));
};

function mycarousel_itemVisibleOutCallback(carousel, item, i, state, evt)
{
    carousel.remove(i);
};

/**
 * Item html creation helper.
 */
function mycarousel_getItemHTML(item)
{
    return item.url;
};

function callback2 (carousel, item, idx, state){
	var num = carousel.index(idx, mycarousel_itemList.length);
 	document.getElementById("display").innerHTML =  mycarousel_itemList[num-1]["title"];
	

};

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
	
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
	
	if(mycarousel_itemList.length<2){
		carousel.scroll(jQuery.jcarousel.intval(0));
		carousel.options.scroll=jQuery.jcarousel.intval(0);
		carousel.startAuto(0);
	}

};


jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
		scroll: 1,
		auto: 3,
        wrap: 'circular',
        itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
        itemVisibleOutCallback: {onAfterAnimation: mycarousel_itemVisibleOutCallback},
        itemFirstInCallback: {onAfterAnimation: callback2},
		initCallback: mycarousel_initCallback
    });
});

	
	
	
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}

function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=70
}

function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}


//for dropdown menu

function showMenu(obj1,obj2){ 

	var btn=document.getElementById(obj1);
	var obj=document.getElementById(obj2);	
	
	var h=btn.offsetHeight;
	var w=btn.offsetWidth;
	var x=getLeft(btn);
	var y=getTop(btn);
	
	obj.style.left=x+"px";
	obj.style.top=y+h-0+"px";
	
	obj.onmouseover =function(){
		showMenu(obj1,obj2);
	}
	obj.onmouseout =function(){
		hideMenu(obj2);
	}
	
	obj.style.visibility ="visible";
}
function hideMenu(obj) {
	document.getElementById(obj).style.visibility ="hidden";
}
function getLeft(e){
	var offset=e.offsetLeft;
	if(e.offsetParent!=null) offset+=getLeft(e.offsetParent);
	return offset;
}
function getTop(e){
	var offset=e.offsetTop;
	if(e.offsetParent!=null) offset+=getTop(e.offsetParent);
	return offset;
}





function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}

function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=50
}

function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}
