//Define AJAX class
Test = {}
Test.SendToPhoneBubble_Class = function() {
	this.SendEmail = function() {
		var _WebServiceAPI = new  Core.WebServiceAPI_Class();
		_WebServiceAPI.EmailAFriend('-', '-', fromEmail, '', toEmail, false, ProductCode, true, 'SendToPhoneTemplate_Variant.xml', 'text', this.OnCompleteRequest);
		
		if ($get(this.Phone_SaveProfileID).checked) {
			_WebServiceAPI.UpdatePhoneInformation("phoneExt", CurrentCustomerID, $get(this.PhoneExt_1ID).value, $get(this.PhoneExt_2ID).value, $get(this.PhoneExt_3ID).value, "-", this.SaveProfileOnCompleteRequest);
		}
	}

	this.OnCompleteRequest=function(result){
		if (result!=null) {
			if(result == "true") {
 			} else {
			} 
		} else { 
		}
	}

    this.SaveProfileOnCompleteRequest=function(result){
		if (result!=null) {
		}else { 
		}
	}
}

if (IsTypeDefined) {Test.SendToPhoneBubble_Class.registerClass('Test.SendToPhoneBubble_Class');}

var _SendToPhoneBubble_Class = new Test.SendToPhoneBubble_Class ();

/**
 * Personaility JS wrapper on Maybelline functionality
 */
var Personaility = {
	sendToPhone: function(number, productName, productID) {
		var _WebServiceAPI = new  Core.WebServiceAPI_Class();
		_WebServiceAPI.EmailAFriend('-', '-', '-', '-', number, 'false', productID, 'true', 'SendToPhoneTemplate_Variant.xml', 'text', this.onCompleteRequest);
	},

	sendToFriend: function(fromName, fromEmail, toName, toEmail, fromMsg, profile) {
		if(!IsAjaxLoaded()) {return false;}
		
		if(fromMsg == undefined) { fromMsg = "" };
		
		try
		{
			Loreal.US.eCommerce.WS.Maybelline.AJAX_Project.CustomerWebService.SendPersonailityToAFriend(fromName, fromEmail, toName, toEmail, fromMsg, profile, this.OnCompleteRequest, this.onError, this.onTimeout);
		}
		catch(e)
		{
			DoDefault();
			window.status = e.message;
		}
	},

	sendToMe: function(email, profile, productID1, productID2, productID3) {
		if(!IsAjaxLoaded()) {return false;}
		
		try
		{
			Loreal.US.eCommerce.WS.Maybelline.AJAX_Project.CustomerWebService.SendPersonailityToMyself(email, profile, productID1, productID2, productID3, this.OnCompleteRequest, this.onError, this.onTimeout);
		}
		catch (e)
		{
			DoDefault();
			window.status = e.message;
		}
	},

	addToMakeupbag: function(productId) {
		_Maybelline_QuickShop_Class.AddToFavorites(true, productId);
	},

	showPrint: function(swatch1, swatch2, swatch3, which_personaility) {
		var url = "personaility_print.aspx";
		url += "?swatch1="+swatch1+"&swatch2="+swatch2+"&swatch3="+swatch3+"&whichPersonaility="+which_personaility;
		var width = 500;
		var height = 750;	 
		var width = 500;
		var height = 750;	 
		window.open(url, "personailityPrintWin", "width=580 , height=750, scrollbars");
	},

	onCompleteRequest: function() {},
	onError: function() {},
	onTimeout: function() {}
}