	/*******************************************************
	* return a working call for the flash object
	*/
	function flashAccess(id) {
		if(navigator.appName.indexOf("Microsoft") != -1) {
			flash = window.eval(id);
		}else {
			flash = window.document.eval(id);
		}
		return flash;	
	}
	
	function loadCMS(page,section,flashMov,width,height,style) {
		//alert(pages[page][section]);		
		flashMov.loadFlashCMS(pages[page][section],section,width,height,style);
	}
	
	function swapFlashImg(img, area, way,width,height,style) {
		if(way == 'area') {
			mainf = window.flashAccess('flash_mainContent'); // main content holder for flash;
			mainf.getArea(area);
		}else if(way == 'img') {
			bf = flashAccess('flash_background'); // background_flash is bf
			bf.swapFlashImg(img);
		}else if(way == 'cms') {
			mainf = window.flashAccess('flash_mainContent'); // main content holder for flash;
			loadCMS(img,area,mainf,width,height,style);
		}
	}
	/*********************************************************
	* Begins the Catalog Build
	*/
	function buildStoreFromXML() {
		if(is.ie) {
			flashShop = flashAccess(flash_mainContent);
		}else {
			//try {
				flashShop = flashAccess(window.document.flash_mainContent);
			//}catch(e) {
			//	flashShop = flashAccess(flash_mainContent);
			//}
		}
		flashShop.getXML(); // in catalog.as
	}
	
	
	/*******************************************************
	* We use javascript to send data from php to the flash player
	* so update the global array "cart" with the new info from the handleLoad Iframe.
	* The flash player will call back down to retrieve the cart info
	*/
	////////////////////////////////////////////////////////////////////////// 
		var cart = new Array();	// holds the cart items						//											//																//
	//////////////////////////////////////////////////////////////////////////
	
	function updateJSCart(newcart) {
		cart['ids'] = newcart['ids'].join(",");
		cart['quan'] = newcart['quan'].join(",");
		cart['cost'] = newcart['cost'].join(",");
		cart['thumbs'] = newcart['thumbs'].join(",");
		cart['itemname'] = newcart['itemname'].join(",");
					
		if(cart['ids']) {// if items exist in the shopping cart... show them
			changePage('cart');
			// now we wait for the flash player to pull information			
		}else {			// otherwise, show the product list
			alert('You have no items in your shopping cart');
			changePage('catalog'); // take to the catalog list
		}
	}

	/*********************************************************
	* Begins the Cart Build (Called from cart.swf);
	*/
	function buildCartFromJAVA() {

		if(is.ie) {
			flashCart = flashAccess(flash_mainContent);
		}else {
			flashCart = flashAccess(window.document.flash_mainContent);
		}

		flashCart.loadShoppingCart(cart['ids'],cart['quan'],cart['cost'], cart['thumbs'], cart['itemname']);
		
		loadCMS('cart','policy',flashCart);
		loadCMS('cart','shipping',flashCart);
	}
	 
	
	/*********************************************************
	* 
	*/
	function addtoCart(prodid) {
		iframe = document.getElementById('content');
		newsrc = 'iframe.php?area=cart&mode=add&item=' + prodid
		iframe.src = newsrc;
	}
	
	function gotoCart() {
		//alert('go to cart');
		iframe = document.getElementById('content');
		newsrc = 'iframe.php?area=cart';
		iframe.src = newsrc;
		//window.content.location = newsrc;
	}
	
	
	/*********************************************************
	* 
	*/
	function removeFromCart(prodid,quan) {
		iframe = document.getElementById('content');
		newsrc = 'iframe.php?area=cart&mode=update&item=' + prodid + '&quan=' + quan;
		iframe.src = newsrc;
	}
	