<!--
var objBubble = new Image();
objBubble.src = "images/bubble.gif";

var iMermaidDelay = 5000;
var wHandle;
var iBubble = 500;
var iImageDelay = 3000;
var wImage;
var sCurImage = "";

var ns4=document.layers?1:0
var ns6=document.getElementById&&!document.all?1:0 
var ie=document.all?1:0

function fLoaded()
{
	fLoadBubbles();
	window.setTimeout("fPosBubbles(1)", iBubble);
	fShowMermaid();
	fPosPicture();
}

function fLoadBubbles()
{
	if (ie)
	{
		imgCenterBubble.src = objBubble.src;
		imgBubble.src = objBubble.src;
		imgBubble2.src = objBubble.src;
		imgBubble3.src = objBubble.src;
		imgBubble4.src = objBubble.src;
	}
	else
	{
		document.imgCenterBubble.src = objBubble.src;
		document.imgBubble.src = objBubble.src;
		document.imgBubble2.src = objBubble.src;
		document.imgBubble3.src = objBubble.src;
		document.imgBubble4.src = objBubble.src;
	}
}

function fPosBubbles(iIter)
{
	if (ie)
	{
		var objCenterBubble = imgCenterBubble;
		var objBubble = imBubble;
		var objBubble2 = imBubble2;
		var objBubble3 = imBubble3;
		var objBubble4 = imBubble4;
		var objBubble5 = imBubbleNew;
	}
	else
	{
		var objCenterBubble = document.imgCenterBubble;
		var objBubble = document.getElementById("imBubble");
		var objBubble2 = document.getElementById("imBubble2");
		var objBubble3 = document.getElementById("imBubble3");
		var objBubble4 = document.getElementById("imBubble4");
		var objBubble5 = document.getElementById("imBubbleNew");
	}

	if (iIter == 1 | iIter == 0)
	{
		objBubble3.style.display = "";
		if (ie)
		{
			objBubble3.style.posTop = document.body.offsetHeight - 180;
			objBubble3.style.posLeft = document.body.scrollWidth/2;
			objBubble3.style.zIndex = -1;
		}
		else
		{
			objBubble3.style.top = document.body.offsetHeight - 180;
			objBubble3.style.left = document.body.scrollWidth/2;
			objBubble3.style.zIndex = 0;
		}
		if (iIter > 0)
		{
			window.setTimeout("fPosBubbles(2)", iBubble);
			return;
		}
	}
	
	if (iIter == 2 | iIter == 0)
	{
		objBubble.style.display = "";
		if (ie)
		{
			objBubble.style.posTop = document.body.offsetHeight - 250;
			objBubble.style.posLeft = document.body.scrollWidth - 300;
			objBubble.style.zIndex = -1;
		}
		else
		{
			objBubble.style.top = document.body.offsetHeight - 250;
			objBubble.style.left = document.body.scrollWidth - 300;
			objBubble.style.zIndex = 0;
		}
		if (iIter > 0)
		{
			window.setTimeout("fPosBubbles(3)", iBubble);
			return;
		}
	}
	
	if (iIter == 3 | iIter == 0)
	{
		objCenterBubble.style.display = "";
		if (iIter > 0)
		{
			fCycleImages();
			window.setTimeout("fPosBubbles(4)", iBubble);
			return;
		}
	}
	
	if (iIter == 4 | iIter == 0)
	{
		objBubble4.style.display = "";
		if (ie)
		{
			objBubble4.style.posTop = 140;
			objBubble4.style.posLeft = 475;
			objBubble4.style.zIndex = -1;
		}
		else
		{
			objBubble4.style.top = 140;
			objBubble4.style.left = 490;
			objBubble4.style.zIndex = 0;
		}
		if (iIter > 0)
		{
			fCycleText();
			if (arrWhatsNew.length > 0)
			{	
				window.setTimeout("fPosBubbles(5)", iBubble);
			}
			else
			{
				window.setTimeout("fPosBubbles(6)", iBubble);
			}
			return;
		}
	}
	
	if (iIter == 5 | iIter == 0)
	{
		if (arrWhatsNew.length > 0)
		{
			objBubble5.style.display = "";
		}
		if (ie)
		{
			objBubble5.style.posTop = 200;
			objBubble5.style.posLeft = 170;
			objBubble5.style.zIndex = 9999;
		}
		else
		{
			objBubble5.style.top = 200;
			objBubble5.style.left = 150;
			//objBubble5.style.zIndex = 0;
		}
		if (iIter > 0)
		{
			fCycleWhatsNew();
			window.setTimeout("fPosBubbles(6)", iBubble);
			return;
		}
	}
	
	objBubble2.style.display = "";
	if (ie)
	{
		objBubble2.style.posTop = 50;
		objBubble2.style.posLeft = 600;
	}
	else
	{
		objBubble2.style.top = 50;
		objBubble2.style.left = document.body.scrollWidth - 240;
	}
}

function fPosPicture()
{
	if (ie)
	{
		var objCenterBubble = imgCenterBubble;
		var objContainer = oTransContainer;
	}
	else
	{
		var objCenterBubble = document.getElementById("imgCenterBubble");
		var objContainer = document.getElementById("oTransContainer");
	}
	var iTop = fGetTop(objCenterBubble) + (objCenterBubble.offsetHeight/2) - 80;
	var iLeft = fGetLeft(objCenterBubble)  + (objCenterBubble.offsetWidth/2) - 70;
	
	if (ie)
	{
		objContainer.style.posTop = iTop;
		objContainer.style.posLeft = iLeft;
	}
	else
	{
		objContainer.style.top = iTop;
		objContainer.style.left = iLeft;
	}
}

function fCycleImages()
{
	for (var i=0;i<arrImages.length;i++)
	{
		if (arrImages[i] == sCurImage)
		{
			break;
		}
	}
	i++;
	if (i >= arrImages.length)
	{
		i = 0;
	}
	sCurImage = arrImages[i];
		
	if (ie)
	{
		oTransContainer.filters[0].Apply();
		oTransContainer.style.display = "";
		clCycle.innerHTML = "<img style='border-width:1px;border-style:solid' id='imgMain' title='" + unescape(arrTitles[i]) + "'></img>";
		imgMain.src = arr_cycImages[i].src;
		fScale(imgMain);
		imgCaption.innerText = unescape(arrTitles[i]);
		fPosPicture();
		oTransContainer.filters[0].Play();
	}
	else
	{
		var objContainer = document.getElementById("oTransContainer");
		objContainer.style.display = "";
		var objDiv = document.getElementById("clCycle");
		objDiv.innerHTML = "<img style='border-width:1px;border-style:solid' id='imgMain' title='" + unescape(arrTitles[i]) + "'></img>";
		var objImg = document.getElementById("imgMain");
		objImg.src = arr_cycImages[i].src;
		fScale(objImg);
		var objCaption = document.getElementById("imgCaption");
		//objCaption.innerHTML = "<textarea class='divtext2' width='100%'>" + arrTitles[i] + "</textarea>";
		fPosPicture();
	}
	
	wImage = window.setTimeout("fCycleImages()", iImageDelay);
}

function fScale(imgMain)
{
	while (imgMain.width > 150)
	{
		imgMain.width = imgMain.width * .9;
		imgMain.height = imgMain.height * .9;
	}
}

function fGetTop(obj)
{
	if (obj.offsetParent != null)
	{
		return obj.offsetTop + fGetTop(obj.offsetParent);
	}
	else
	{
		return obj.offsetTop;
	}
}

function fGetLeft(obj)
{
	if (obj.offsetParent != null)
	{
		return obj.offsetLeft + fGetLeft(obj.offsetParent);
	}
	else
	{
		return obj.offsetLeft;
	}
}

function fShowMermaid()
{
	if (ie)
	{
		var objTail = mmTail;
	}
	else
	{
		var objTail = document.mmTail;
	}
	var iTop = Number(document.body.scrollHeight) - 56;
	var iLeft = Math.round(Math.random()* (Number(document.body.scrollWidth) - 140));
	
	if (ie)
	{
		objTail.style.posTop = iTop;
		objTail.style.posLeft = iLeft;
	}
	else
	{
		objTail.style.top = iTop;
		objTail.style.left = iLeft;
	}
	
	
	objTail.style.clip = "rect(0 40 44 0)";
	objTail.style.display = "";
	iClip = 0;
	fTailUp();
}

var iClip = 0;

function fTailDown()
{
	if (ie)
	{
		var objTail = mmTail;
		objTail.style.posTop = objTail.style.posTop + 1;
	}
	else
	{
		var objTail = document.mmTail;
		objTail.style.top = fGetMozTop(objTail.style.top) + 1;
	}
	iClip--;
	objTail.style.clip = "rect(0 40 " + iClip + " 0)";
	if (iClip > 0)
	{
		wHandle = window.setTimeout("fTailDown()", 25);
	}
	else
	{
		wHandle = window.setTimeout("fShowMermaid()", iMermaidDelay);
	}
}

function fTailUp()
{
	if (ie)
	{
		var objTail = mmTail;
		objTail.style.posTop = objTail.style.posTop - 1;
	}
	else
	{
		var objTail = document.mmTail;
		objTail.style.top = fGetMozTop(objTail.style.top) - 1;
	}
	
	iClip++;
	objTail.style.clip = "rect(0 40 " + iClip + " 0)";
	if (iClip < 44)
	{
		wHandle = window.setTimeout("fTailUp()", 25);
	}
	else
	{
		wHandle = window.setTimeout("fHideMermaid()", iMermaidDelay);
	}
}

function fGetMozTop(sTop)
{
	return Number(String(sTop).replace("px", ""));
}

function fHideMermaid()
{
	window.clearTimeout(wHandle);
	iClip = 44;
	fTailDown();
}

function fHideMermaidMS()
{
	if (ie)
	{
		var objTail = mmTail;
	}
	else
	{
		var objTail = document.mmTail;
	}
	window.clearTimeout(wHandle);
	objTail.style.display = "none";
	wHandle = window.setTimeout("fShowMermaid()", iMermaidDelay);
}

function fResize()
{
	fHideMermaidMS();
	fPosBubbles(0);
	fPosPicture();
}

var text=new Array("fully interfaced to maintain bag's shape", "sewn with heavy gauge thread ", 
	"fully scotch guard protected", "accessorized with bamboo handles secured with brass finished hardware",
	"protected by brass finished feet", "tied up with quality ribbons", "made using decorator quality fabrics with a coordinating liner");

var textfont="vardana"
var textfontcolor="black"
var textfontsize="xx-small"

var textwidtha=""
var textpause=3000

var textmessage=new Array()
var pause=30
var max_space=30
var space=" "

var i_text=-1
var i_space=max_space
var all_space=" "
var content=""
var maxwidth="1000"

var sCurText = "";

if (ie || ns6) 
{
	var fieldwidth=Math.floor(textwidtha/textfontsize*1.5);
}
if (ns4) 
{
	if (textfontsize<=13) 
	{
		var fieldwidth=Math.floor(textwidtha/15);
	}
	else if (textfontsize>13 && textfontsize<18) 
	{
		var fieldwidth=Math.floor(textwidtha/22);
	}
	else 
	{
		var fieldwidth=Math.floor(textwidtha/24)
	}
}
for (i=0;i<=text.length-1;i++) 
{
	textmessage[i]=" "+text[i];
}

function fDecrementSpace() 
{
	all_space=" ";
	for (i=0;i<i_space;i++) 
	{
		all_space+=" ";
	}
	for (i=0;i<sCurText.length-1;i++) 
	{
		var thisletter=sCurText.substring(i,i+1);
		thisletter=thisletter+all_space;
		content+=thisletter;
	}
	fDisplayText()
}

function fDisplayText() 
{
	objCurBox.value=content;
	i_space--;
	if (i_space>=0) 
	{
		content="";
		var timer=setTimeout("fDecrementSpace()", pause);
	}
	else 
	{
		clearTimeout(timer);
		objCurBox.value=sCurText;
		i_space=max_space;
		var timer=setTimeout("fCycleText()", textpause);
	}
}

var iCurIndex = 0;
var objCurBox;

function fCycleText() 
{
	if (iCurIndex > 0)
	{
		sCurText = textmessage[i_text];
		sCurText = sCurText.substring(iCurIndex, sCurText.length);
	}
	else
	{
		i_text++;
		if (i_text>textmessage.length-1) 
		{
			i_text=0;
		}
		sCurText = textmessage[i_text];
		objCurBox = null;
		iCurIndex = 0;
	}
	fSetNextBox();
	textpause = 3000;
	if (sCurText.length > 22)
	{
		var iSpace = 0;
		var iStart = 15;

		iSpace = fGetIndex(sCurText, iStart); 
		while(iSpace > 22 & iSpace != -1)
		{
			iStart--;
			iSpace = fGetIndex(sCurText, iStart); 
		}
		
		iCurIndex += iSpace;
		
		if (iSpace < 0)
		{
			iSpace = sCurText.length;
		}
		else
		{
			textpause = pause;
		}

		sCurText = sCurText.substring(0, iSpace);
	}
	else
	{
		iCurIndex = 0;
	}
	
	content = "";
	fDecrementSpace();
}

function fSetNextBox()
{
	if (ie)
	{
		var objMsg1 = msgBubble;
		var objMsg2 = msgBubble2;
		var objMsg3 = msgBubble3;
		var objMsg4 = msgBubble4;
	}
	else
	{
		var objMsg1 = document.getElementById("msgBubble");
		var objMsg2 = document.getElementById("msgBubble2");
		var objMsg3 = document.getElementById("msgBubble3");
		var objMsg4 = document.getElementById("msgBubble4");
	}
	
	if (objCurBox == objMsg1)
	{
		objCurBox = objMsg2;
		return;
	}
	if (objCurBox == objMsg2)
	{
		objCurBox = objMsg3;
		return;
	}
	if (objCurBox == objMsg3)
	{
		objCurBox = objMsg4;
		return;
	}

	objCurBox = objMsg1;
	objMsg1.value = "";
	objMsg2.value = "";
	objMsg3.value = "";
	objMsg4.value = "";
}

function fGetIndex(sText, iStart)
{
	return sText.indexOf(" ", iStart);
}

function fPicMouseOver()
{
	window.clearTimeout(wImage);
}

function fPicMouseOut()
{
	wImage = window.setTimeout("fCycleImages()", iImageDelay);
}

function fPicClick()
{		
	window.clearTimeout(wImage);
	try
	{
		if (ie)
		{
			var objImg = imgMain;
		}
		else
		{
			var objImg = document.getElementById("imgMain");
		}
		var sLink = "search_bags.asp?SRCH_VALUE=" + escape(objImg.title) + "&SRCH_FLD=ITEM_NM";
		document.location.href = sLink;
	}
	catch(e)
	{}
}

var iWhatsNew = 0;
function fCycleWhatsNew()
{
	if (arrWhatsNew.length > 0)
	{
		var sHTML = "";
		for (var i=0;i<4;i++)
		{
			if (i < arrWhatsNew.length)
			{
				if (sHTML != "")
				{
					sHTML += "<br>";
				}
				sHTML += "<img src='images/bubble_small.gif'><label style='font-size:x-small'>" + arrWhatsNew[i] + "</label>";
			}
		}
		document.getElementById("lblWhatsNew").innerHTML = sHTML;
	}
}
//-->
