/*-----------------------------------------------------------------------
Created by: Ketan
Created date: 16 July 2007
File description: Shopping Cart Javascript Functions to Add/Update/Remove product from shopping cart
Special instructions-notes:Java script
Tables used: none
Stored procedures: none
Triggers used: none
-----------------------------------------------------------------------*/
var IE = document.all?true:false
if (!IE)
{
	document.captureEvents(Event.MOUSEMOVE)
}
function putIF( hldr, x, y, w, h, url, sc_alert_msg )      // description of the arguments below
{
	holder = document.getElementById(hldr); //wrap around div
	/*if (!IE)
	{
		holder.style.right = "565px";
		holder.style.top = "15px";
	}
	else
	{
		holder.style.right = "215px";
		holder.style.top = "15px";
	}*/
	if(navigator.appName == 'Microsoft Internet Explorer')
	{
		if(navigator.appVersion.indexOf('MSIE 6.0')>0){			
			holder.style.right = "235px";
		}else{			
			holder.style.right = "565px";
		}
	}else{		
		holder.style.right = "565px";		
	}
	holder.style.top = "15px";
	holder.style.visibility = 'visible';
	

	
	holder.style.visibility = 'visible';
	
	IF = document.createElement('div');
	/*
	IF.setAttribute('height', h);  // simple DOM methods
	IF.setAttribute('width', w);
	IF.setAttribute("src", url);
	*/
	IF.setAttribute("scrolling", 'no');
	holder.appendChild(IF); // now we add it to the div
	//holder.innerHTML+='<div id="div_tab" align="center" style="width: "+w+"px; float: left;"><img src="<?=$site_url?>images/basket_icon.jpg" alt="Basket"><br><span style="color: #192A6A; font-weight:bold; font-family: Arial, Helvetica, sans-serif;">'+sc_alert_msg+'</span><br><img src="<?=$site_url?>images/buttons/back_to_shop.gif" style="cursor:pointer;" alt="Continue shopping" onclick="closeIF()">&nbsp;<img src="<?=$site_url?>images/buttons/continue_checkout1.gif" style="cursor:pointer;" alt="Checkout" onclick="closeCO()"></div>';
	var tmp_rootpath_div = tmp_rootpath.replace("registration/","");

	holder.innerHTML = '<div id="div_tab" style="width:360px;"><div class="floatl" style="background-image:url('+tmp_rootpath_div+'images/Popup_Cart.gif); background-repeat:no-repeat; width:370px; height:192px;"><table width="300" border="0" cellspacing="0" cellpadding="0" id="popup" summary="" background="#00000;" align="left"><tr><td width="12" valign="top" >&nbsp;</td><td width="279" valign="top"><div align="right" class="text11grey padt8"><a href="javascript:closeIF();" class="botlink">Close</a><img src="'+tmp_rootpath_div+'images/tspacer.gif" height="1" width="3"/><a href="javascript:closeIF();"><img src="'+tmp_rootpath_div+'images/icon_close.gif" alt="Close" width="13" height="12" hspace="2" border="0" align="absmiddle" /></a></div><div align="center"></div><BR><BR><div align="center" class="text12 padt30">'+sc_alert_msg+'</div><div align="center" class="padt10"><img src="'+tmp_rootpath_div+'images/buttons/check_out.gif" alt="Checkout"  hspace="2" vspace="5" border="0" style="cursor:pointer;"  onclick="closeCO();" /><img src="'+tmp_rootpath_div+'images/tspacer.gif" height="1" width="5"/><img src="'+tmp_rootpath_div+'images/buttons/continue_shopping.gif" alt="Continue Shopping" hspace="2" vspace="5" border="0" style="cursor:pointer;" onclick="closeIF()" /></div></td><td width="9" align="right" valign="top" >&nbsp;</td></tr><tr><td colspan="3"  height="11">&nbsp;</td></tr> </table></div></div>';
// final step is to put in additional controls
}

function closeIF() // the close is simple we just clear out the div
{
	var obj = document.getElementById('bubble_div');
	obj.innerHTML='';
	//obj.style.display='none';
}

function closeCO() // the close is simple we just clear out the div
{

	if(tmp_rootpath.indexOf('registration')>0)
	{
		var tmp_rootpath_div = tmp_rootpath.replace("registration/","");
		PageFrom	= tmp_rootpath_div+"shopping_cart.php";
	}
	else
	{
		PageFrom	= tmp_rootpath+"shopping_cart.php";
	}
	var obj = document.getElementById('bubble_div');
	obj.innerHTML='';
	//obj.style.display='none';
	document.location.href = PageFrom;
}