
/*
	Triggered from flash when user clicks the share button.
	No need to tell flash anything here ( just a button )
*/
function sharePage(pageId)
{
	alert("sharePage("+pageId+")");
}

function sendSMS(number, pageid)
{
	alert("addToCart("+number+","+pageid+")");
	var flashObj = document.getElementById("colorguide"); //the flashobject
	flashObj.sendSMSCallback(); //let flash know we are done here.
}

/*
	Triggered from flash when user clicks the print button.
	Needs a callback to close properly.
*/
function printPage(pageid)
{
	alert("printPage("+pageid+")");
	var flashObj = document.getElementById("colorguide"); //the flashobject
	flashObj.printPageCallback(); //let flash know we are done here.
	return true;
}

/*
	Triggered from flash when user clicks the addtocart button.
	Needs a callback to close properly.
*/
function addToCart(pageId, container)
{
	var flashObj = document.getElementById("colorguide"); //the flashobject
	alert("addToCart("+pageId+","+container+") " + flashObj);
	flashObj.addToCartCallback(); //let flash know we are done here.
}

/*
	Triggered from flash when user clicks the removefromcart button.
	Needs a callback to close properly.
*/
function removeFromCart(pageId, container)
{
	alert("removeFromCart("+pageId+","+container+")");
	var flashObj = document.getElementById("colorguide"); //the flashobject
	flashObj.removeFromCartCallback(); //let flash know we are done here
}

/*
	Triggered from flash when user clicks the send mail button.
	Needs a callback to close properly.
*/
function sendMail(pageid, senderName, mailAddress)
{
	var flashObj = document.getElementById("colorguide"); //the flashobject
	alert("sendMail("+pageid+","+senderName+","+mailAddress+") " + flashObj);
	flashObj.sendMailCallback();
}

/*
	Triggered when user clicks the fullscreen button in flash
	Needs callback to know this has happened.
*/
function fullScreen() 
{
	var obj = document.getElementById("colorguide"); //the flashobject
	
	if (navigator.appName.indexOf("Microsoft")!=-1) {
		var winW = document.body.offsetWidth;
		var winH = document.body.offsetHeight;
	} else {
		var winW = window.innerWidth;
		var winH = window.innerHeight;
	}
	obj.style.width = winW + "px";
	obj.style.height = winH + "px";
	alert("fullscreen obj: " + obj + " h: "+ winH + " w: " + winW);
	
	obj.fullscreenChangedCallback();
	return true;
}

/*
	Triggered by flash when the user clicks the fullscreenbutton in fullscreen mode
	needs a callback to know it has returned.
*/
function defaultScreen() 
{
	var obj = document.getElementById("colorguide"); //the flashobject
	alert("defaultScreenfull obj: " + obj);
	obj.style.position = "";
	obj.style.top = "";
	obj.style.left = "";
	obj.style.width = "711px";
	obj.style.height = "499px";
	
	obj.fullscreenChangedCallback();
	return true;
}