function showBubble1(str,dx,dy)
{
	//alert('here');
	var flashBubbleDiv1=getEl('flashBubbleDiv1');
	var flashBubble1=getFlashEl('flashBubble1');
	
	showBubbleCommon(str,flashBubbleDiv1,flashBubble1,dx,dy);

}
function hideBubble1(){
	var flashBubbleDiv1=getEl('flashBubbleDiv1');
	var flashBubble1=getFlashEl('flashBubble1');
	
	hideBubbleCommon(flashBubbleDiv1,flashBubble1);
}

function showBubble2(str,dx,dy){
	var flashBubbleDiv2=getEl('flashBubbleDiv2');
	var flashBubble2=getFlashEl('flashBubble2');
	
	showBubbleCommon(str,flashBubbleDiv2,flashBubble2,dx,dy);
}
function hideBubble2(){
	var flashBubbleDiv2=getEl('flashBubbleDiv2');
	var flashBubble2=getFlashEl('flashBubble2');
	
	hideBubbleCommon(flashBubbleDiv2,flashBubble2);
}


function showBubbleCommon(str,flashBubbleDiv,flashBubbleObj,dx,dy)
{
	var posA=gpos(getEl('tabContainer'));	
	
	var tt=Math.round(posA[0])+Math.round(dy);
	var ll=Math.round(posA[1])+Math.round(dx);

	flashBubbleDiv.style.display='';
	spos(flashBubbleDiv,tt,ll);
	
	setTimeout(function (){flashBubbleObj.SetVariable('command','say,'+str);},150);
	
}

function hideBubbleCommon(flashBubbleDiv,flashBubbleObj)
{
	//var posA=gpos(tobj);	
	flashBubbleDiv.style.display='none';
	//switchVis(flashBubbleDiv,0);
	//alert('flashBubbleDiv='+flashBubbleDiv);
	//alert('flashBubbleDiv.innerHTML='+flashBubbleDiv.innerHTML);
	//spos(flashBubbleDiv,-200,-200);
}




///////////////////
var bubbleOnLoadContainer=null;
function bubblePageLoad(func){
	
	func();
	if (bubbleOnLoadContainer) 
	{
		bubbleOnLoadContainer();
	}
}


function bubblesInit(){
	var locA=location.href.split('/');
	if (locA[locA.length-2]=='cart') //We are in Shopping cart
	{
		var actA=locA[locA.length-1].split('.');
		var act=actA[0];
		if (act=='order')
		{
			//bubbleOnLoadContainer=document.body.onload;
			//alert(document.body);
			//document.body.onload=function (){ bubblePageLoad(bubbleOrderPageLoad);}
			bubblePageLoad(bubbleOrderPageLoad);
		}
	}
	else //WE ARE NOT IN SHOPPING CART
	{ 
		var locA1=location.href.split('?');
		if (locA1[1])// IF This page has some parametrs
		{
			var locA2=locA1[1].split('&');
			var ll=locA2.length;
			for (var i=0;i<ll;i++)
			{
				var parA=locA2[i].split('=');
				if (parA[0]=='act')
				{
					var act=parA[1];
				}
				else if (parA[0]=='action')
				{
					var action=parA[1];
				}
			}
			//alert('act='+act);
			//alert('action='+action);
		}
	}
	
	//Other Inits
	if (window.vViewLoad)
	{
		vViewLoad();
	}
}



//bubblesInit();


///////////////////////////////////DIFFERENT PAGES START
function bubbleOrderPageLoad()
{
	setTimeout(bubbleOrderShow1,3000);//3000
}

//Order Bubble1
var isBubbleOrderShown1=0;
function bubbleOrderShow1()
{
	if (!isBubbleOrderShown1)
	{
		showBubble1('\nPlease select a product category',170,110);
		setTimeout(bubbleOrderShow2,15000);//15000
	}
}
function bubbleOrderHide1()
{
	if (!isBubbleOrderShown1)
	{
		isBubbleOrderShown1=1;
		hideBubble1();
		setTimeout(bubbleOrderShow2,3000);
	}
	bubbleOrderHide3();
	bubbleOrderHide4();
}

//Order Bubble2
var isBubbleOrderShown2=0;
function bubbleOrderShow2()
{
	//alert('here1');
	if (!isBubbleOrderShown2)
	{
		//alert('here2');
		isBubbleOrderShown1=1;
		showBubble1('\nSelect size & quantity',0,345);
		//setTimeout(bubbleOrderShow3,15000);
	}
}
function bubbleOrderHide2()
{
	//alert('here');
	if (!isBubbleOrderShown2)
	{
		isBubbleOrderShown2=1;
		hideBubble1();
		//
	}
	setTimeout(bubbleOrderShow3,10000);//10000
}

//Order Bubble3
var isBubbleOrderShown3=0;
var isBubbleOrderShownStart3=0;
function bubbleOrderShow3()
{
	//alert('here1');
	//alert(selectedID);
	//alert(pao[selectedID]+',,'+pao[selectedID].length);
	if ((!pao[selectedID]))//||(!pao[selectedID].length))
	{
		//alert('here');
		setTimeout(bubbleOrderShow4,3000);
		return;
	}
	if (!isBubbleOrderShown3)
	{
		//alert('here2');
		
		isBubbleOrderShown2=1;
		isBubbleOrderShownStart3=1;
		showBubble1('\nPlease select an option',500,460);
		//setTimeout(bubbleOrderShow3,15000);
	}
}
function bubbleOrderHide3()
{
	if ((!isBubbleOrderShown3)&&(isBubbleOrderShownStart3))
	{
		isBubbleOrderShown3=1;
		hideBubble1();
		setTimeout(bubbleOrderShow4,3000);
	}
}

//Order Bubble4
var isBubbleOrderShown4=0;
var isBubbleOrderShownStart4=0;
function bubbleOrderShow4()
{
	//alert('here1');
	if (!isBubbleOrderShown4)
	{
		//alert('here2');
		isBubbleOrderShown3=1;
		isBubbleOrderShownStart4=1;
		showBubble2('Please click here to add your product to the shopping cart',665,710);
	}
}
function bubbleOrderHide4()
{
	if ((!isBubbleOrderShown4)&&(isBubbleOrderShownStart4))
	{
		isBubbleOrderShown4=1;
		hideBubble2();
	}
}

///////////////////////////////////DIFFERENT PAGES END
