/**************************************
 * Initall JS file                    *
 * for La Cave                        *
 * Init site functions                *
 * 2007 re-devel version:			  *
 * - Loaded by index.html             *
 * - Global availability              *
 * -to use Iframes					  *
 * -for Mozilla & IE                  *
 * ITMXJ 13/05/07                     *
 **************************************/ 
//
//-------------------------------------------------
// Date object used by footer
var today = new Date();
//
//-------------------------------------------------
// Retrieves specific cookie value.  Used by Cart and Iutils
function cookieVal(cname)
{
   if (document.cookie == "" ) 
   { 
   		//alert(" No Cookie Set!");
   		return false;
   }
   else
   {
   //alert(" There is a Cookie!");
	thisCookie = document.cookie.split("; ");
	for (var i = 0; i<thisCookie.length; i++)
	{
		if (cname == thisCookie[i].split("=")[0])
		{
			//alert (thisCookie[i].split("=")[1]);
			return thisCookie[i].split("=")[1];
		}
	}
   }
   //alert(' Value for Cookie '+cname+' Has Not Been Found!');
   return false;
}
//
//-------------------------------------------------
// Maximise browser on load (annoying, eh?)
function max()
{
	if (window.screen)
	{
		window.moveTo(0,0);
		window.outerHeight = screen.availHeight;
		window.outerWidth = screen.availWidth;
	}
}
//
 function fullScreen() // custom property for window object
{
	this.moveTo(0, 0);
	this.resizeTo(screen.availWidth,screen.availHeight);
} // end of fullScreen
//
//-------------------------------------------------
// Initialise site and Shopping Cart (set some cookies)
function initCart()
{   
	fullScreen(); //Max browser window
	//set product count and order total to 0 if no cookies present
	if (document.cookie == '')
	{
		document.cookie = 'prodcount=0';//;path=\"/\";';
		document.cookie = 'ordtotal=0';//;path=\"/\";';
		//alert('Cart Init');
	}
	return true;
}
//-------------------EOF----------------------
