function Shop_RollOver(targetImgId)
{
	$(targetImgId).hide();
	$(targetImgId + "Hover").show();
}
function Shop_RollOut(targetImgId)
{
	$(targetImgId).show();
	$(targetImgId + "Hover").hide();
}
function CustomDoodle_UploadPhoto()
{
	if( $('cd_Img').value.length == 0 )
	{
		alert("Please select the file");
		return null;
	}
	FormSetTarget("shop/custom-doodles/step2");
	DoAction("UploadPhoto");
}
function CustomDoodle_removePhoto(aKey)
{
	var url;
	
	url = "shop/custom-doodles/removephoto/"+aKey+"/";
	xmlHttpCat = ffwGetXmlHttpObject(CustomDoodle_removePhoto_Listener);
	xmlHttpCat.open("GET", url , true);
	xmlHttpCat.send(null);
	$('UploaderPhoto').removeChild($('UserPhoto_' + aKey));
}
function CustomDoodle_removePhoto_Listener()
{
	if (xmlHttpCat.readyState==4 || xmlHttpCat.readyState=="complete")
	{
		//alert(xmlHttpCat.responseText);
	}
}
function CustomDoodle_SecondStep()
{
	if( $('filebackup').value.length < 1 )
	{
		if( !confirm("Do you want to continue without uploading a photo?") )
		{
			return null;
		}
	}
	getSiteURI("shop/custom-doodles/step3/");
}
function CustomDoodle_ThirdStep()
{
	if( $('cd_ChildInfo').value.length < 5 )
	{
		if( !confirm("Do you want to continue without telling us some background info?") )
		{
			return null;
		}
	}
	FormSetTarget("shop/custom-doodles/step3");
	DoAction("SaveStep3");
}
function CustomDoodle_EndCustomDoodle()
{
	if(ProductIDList == null || ProductClothingIDList == null)
	{
		alert("Sorry, we found an error.");
		return null;
	}
	var i;
	var IsSelectedOneProduct;
	var IsValid;
	var lTotal;
	var lQty;
	
	IsSelectedOneProduct = false;
	IsValid = true;
	
	if(ffw_GetRadioButtonValue('doodle-type') == undefined )
	{
		alert("Please select a doodle type.");
		IsValid = false;
	}
	
	lTotal = ProductIDList.length;
	for(i=0; i<lTotal; i++)
	{
		if( $('cd_cb_' + ProductIDList[i]).getValue() != null)
		{
			IsSelectedOneProduct = true;
			lQty = Number( $('cd_ti_' + ProductIDList[i]).value );
			if( isNaN(lQty) || lQty < 1 )
			{
				alert("Please enter a quantity");
				IsValid = false;
			}
			
		}
	}
	lTotal = ProductClothingIDList.length;
	for(i=0; i<lTotal; i++)
	{
		if( $('cd_clothing_cb_' + ProductClothingIDList[i]).getValue() != null)
		{
			IsSelectedOneProduct = true;
			lQty = Number( $('cd_clothing_ti_' + ProductClothingIDList[i]).value );
			if( isNaN(lQty) || lQty < 1 )
			{
				alert("Please enter a quantity");
				IsValid = false;
			}
			
		}
	}
	
	if( IsSelectedOneProduct )
	{
		if( IsValid )
		{
			FormSetTarget("shop/custom-doodles/step1");
			DoAction("SaveStep1");
		}
	}
	else
	{
		alert("Please select a product");
	}
}
function CustomDoodle_AdditionalCustomDoodle()
{
	if(ProductClothingIDList == null)
	{
		alert("Sorry, we found an error.");
		return null;
	}
	var i;
	var IsSelectedOneProduct;
	var IsValid;
	var lTotal;
	var lQty;
	
	IsSelectedOneProduct = false;
	IsValid = true;
	
	lTotal = ProductClothingIDList.length;
	for(i=0; i<lTotal; i++)
	{
		if( $('cd_clothing_cb_' + ProductClothingIDList[i]).getValue() != null)
		{
			IsSelectedOneProduct = true;
			lQty = Number( $('cd_clothing_ti_' + ProductClothingIDList[i]).value );
			if( isNaN(lQty) || lQty < 1 )
			{
				alert("Please enter a quantity");
				IsValid = false;
			}
			
		}
	}
	
	if( IsSelectedOneProduct )
	{
		if( IsValid )
		{
			FormSetTarget("shop/custom-doodles/step1-3/");
			DoAction("SaveStep1_3");
		}
	}
	else
	{
		alert("Please select a product");
	}
}

function CustomDoodle_MoreClothing()
{
	var IsValid = true;
	if(ffw_GetRadioButtonValue('more-clothing') == undefined )
	{
		alert("Please select answer the question(yes/no)");
		IsValid = false;
	}
	if( IsValid )
	{
		if(ffw_GetRadioButtonValue('more-clothing') == "no" )
		{
			getSiteURI("shop/custom-doodles/step2/");
		}
		else
		{
			getSiteURI("shop/custom-doodles/step1-3/");
		}
	}
}
function CustomDoodle_InitStep2()
{
	$('cd_ChildNamePrint_Label').observe('click', CustomDoodle_Step2_PrintName);
	CustomDoodle_Step2_PrintName();
}
function CustomDoodle_Step2_PrintName()
{
	if( ffw_GetRadioButtonValue('cd_ChildNamePrint') == "no" )
	{
		Effect.BlindUp('ChildNameBox', { duration: 0.6 });
	}
	else
	{
		Effect.BlindDown('ChildNameBox', { duration: 0.6 });
	}
}

function BabyAnnouncement_SecondStep()
{
	if( isNaN($('BabyAnnouncement_Quantity').value) )
	{
		alert("Please type a valid quantity");
		return null;
	}
	if( Number($('BabyAnnouncement_Quantity').value) < Number($('prod_minimumQty').value) )
	{
		alert("The quantity must be equal or greater than " + $('prod_minimumQty').value);
		return null;
	}
	FormSetTarget("shop/baby-announcements/step1/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep1");
}
function BabyAnnouncement_MoreBabies()
{
	BabyAnnouncement_ThirdStep(true);
}
function BabyAnnouncement_ThirdStep(AddBaby)
{
	var lSelectedDate;
	var lSelectedTime;
	
	if( AddBaby == null )
	{
		AddBaby = false;
	}
	
	if( String($('ba_Name').value).length < 2 )
	{
		alert("Please type the baby's name");
		return null;
	}
	lSelectedDate = $('ba_BirthDate_Month').value + "/" + $('ba_BirthDate_Day').value + "/" + $('ba_BirthDate_Year').value;
	if( !SingleDateField_isDate(lSelectedDate) )
	{
		alert("Please type a valid baby's birth date");
		return null;
	}

	if( $('ba_BirthTime_Hour').value.length == 0 || isNaN($('ba_BirthTime_Hour').value) || Number($('ba_BirthTime_Hour').value) < 1 || Number($('ba_BirthTime_Hour').value) > 12)
	{
		alert("Please type a valid hour(only numbers between 1 and 12)");
		return null;
	}
	if( $('ba_BirthTime_Minute').value.length == 0 || isNaN($('ba_BirthTime_Minute').value) || Number($('ba_BirthTime_Minute').value) < 0 || Number($('ba_BirthTime_Minute').value) > 59)
	{
		alert("Please type a valid minute(only numbers between 1 and 59)");
		return null;
	}
	if( ffw_GetRadioButtonValue('ba_BirthTime_Type') == null)
	{
		alert("Please select the time, am/pm");
		return null;
	}

	if( $('ba_Pounds').value.length == 0 || isNaN(Number($('ba_Pounds').value)) )
	{
		alert("Please type a valid weight(only numbers)");
		return null;
	}
	if( $('ba_Ounces').value.length == 0 || isNaN(Number($('ba_Ounces').value)) )
	{
		alert("Please type a valid weight(only numbers)");
		return null;
	}
	if( Number($('ba_Ounces').value) < 0 || Number($('ba_Ounces').value) > 15 )
	{
		alert("Please type a valid ounces(a number between 0 and 15)");
		return null;
	}
	if( $('ba_Inches').value.length == 0 || isNaN(Number($('ba_Inches').value)) )
	{
		alert("Please type a valid length(only numbers)");
		return null;
	}
	FormSetTarget("shop/baby-announcements/step2/"+$('ba_ProductID').value+"/");
	if( AddBaby )
	{
		DoAction("SaveStep2AndAddBaby");
	}
	else
	{
		DoAction("SaveStep2");
	}
}
function BabyAnnouncement_ReturnNewBaby(ProductID,BabyID)
{
	if(BabyID > 2 )
	{
		getURI($('SiteBase').href + 'shop/baby-announcements/step2-new-baby/'+ProductID+'/'+(BabyID-1)+'/');
	}
	else
	{
		getURI($('SiteBase').href + 'shop/baby-announcements/step2/'+ProductID+'/');
	}
}
function BabyAnnouncement_ThirdStepForNewBaby(AddBaby, BabyID)
{
	var lSelectedTime;
	
	if( AddBaby == null )
	{
		AddBaby = false;
	}
	
	if( String($('ba_Name').value).length < 2 )
	{
		alert("Please type the baby's name");
		return null;
	}

	if( $('ba_BirthTime_Hour').value.length == 0 || isNaN($('ba_BirthTime_Hour').value) || Number($('ba_BirthTime_Hour').value) < 1 || Number($('ba_BirthTime_Hour').value) > 12)
	{
		alert("Please type a valid hour(only numbers between 1 and 12)");
		return null;
	}
	if( $('ba_BirthTime_Minute').value.length == 0 || isNaN($('ba_BirthTime_Minute').value) || Number($('ba_BirthTime_Minute').value) < 0 || Number($('ba_BirthTime_Minute').value) > 59)
	{
		alert("Please type a valid minute(only numbers between 1 and 59)");
		return null;
	}
	if( ffw_GetRadioButtonValue('ba_BirthTime_Type') == null)
	{
		alert("Please select the time, am/pm");
		return null;
	}

	if( $('ba_Pounds').value.length == 0 || isNaN(Number($('ba_Pounds').value)) )
	{
		alert("Please type a valid weight(only numbers)");
		return null;
	}
	if( $('ba_Ounces').value.length == 0 || isNaN(Number($('ba_Ounces').value)) )
	{
		alert("Please type a valid weight(only numbers)");
		return null;
	}
	if( Number($('ba_Ounces').value) < 1 || Number($('ba_Ounces').value) > 15 )
	{
		alert("Please type a valid ounces(a number between 1 and 15)");
		return null;
	}
	if( $('ba_Inches').value.length == 0 || isNaN(Number($('ba_Inches').value)) )
	{
		alert("Please type a valid length(only numbers)");
		return null;
	}
	FormSetTarget("shop/baby-announcements/step2-new-baby/"+$('ba_ProductID').value+"/"+BabyID+"/");
	if( AddBaby )
	{
		DoAction("SaveNewBabyAndAddBaby");
	}
	else
	{
		DoAction("SaveNewBaby");
	}
}

function BabyAnnouncement_ThirdStepConfirmed()
{
	FormSetTarget("shop/baby-announcements/step2-1/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep2_1");

}
function BabyAnnouncement_FourStep()
{
	if( $('ba_InitialApprove').value.length == 0 )
	{
		alert("Please type the initial");
		return null;
	}
	FormSetTarget("shop/baby-announcements/step3/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep3");
}
function Product_UploadPhoto(aurl)
{
	if( $('ba_Img').value.length == 0 )
	{
		alert("Please select the file");
		return null;
	}
	FormSetTarget(aurl+$('ba_ProductID').value+"/");
	DoAction("UploadPhoto");
}
function Product_FifthStep(aurl,aaction)
{
	if( $('filebackup').value.length < 1 )
	{
		if( !confirm("Do you want to continue without uploading a photo?") )
		{
			return null;
		}
	}
	FormSetTarget(aurl+$('ba_ProductID').value+"/");
	DoAction(aaction);

}
function BabyAnnouncement_EndProcess()
{
	FormSetTarget("shop/baby-announcements/step5/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep5");
}
function BabyAnnouncement_UploadMore()
{
	new Effect.toggle('UploaderForm','blind',{duration: 1})
}
function BabyAnnouncements_PageChange(Target, Page)
{
	var url;
	url = $('SiteBase').href + "shop/baby-announcements/";
	url += $('CurrentCategory').value + "/page/" + Page + "/";
	getURI(url);
}
function Product_removeUserPhoto(aKey, aSession, aTypeID)
{
	var url;
	
	url = "shop/removephoto/"+aKey+"/"+aSession+"/"+aTypeID+"/";
	xmlHttpCat = ffwGetXmlHttpObject(Product_removeUserPhoto_Listener);
	xmlHttpCat.open("GET", url , true);
	xmlHttpCat.send(null);
	$('UploaderMorePhotos').removeChild($('UserPhoto_' + aKey));
}
function Product_removeUserPhoto_Listener()
{
	if (xmlHttpCat.readyState==4 || xmlHttpCat.readyState=="complete")
	{
		//alert(xmlHttpCat.responseText);
	}
}
function ShoppingCart_removeItem(ItemId)
{
	$('ItemId').value = ItemId;
	DoAction('RemoveItem');
} 
function BabyShower_SecondStep()
{
	if( isNaN($('BabyShower_Quantity').value) )
	{
		alert("Please type a valid quantity");
		return null;
	}
	if( Number($('BabyShower_Quantity').value) < Number($('prod_minimumQty').value) )
	{
		alert("The quantity must be equal or greater than " + $('prod_minimumQty').value);
		return null;
	}
	FormSetTarget("shop/baby-shower/step1/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep1");
}
function PartyInvitations_PageChange(Target, Page)
{
	var url;
	url = $('SiteBase').href + "shop/party-invitations/";
	url += $('CurrentCategory').value + "/page/" + Page + "/";
	getURI(url);
}
function Press_PageChange(Target, Page)
{
	var url;
	url = $('SiteBase').href + "press-new/";
	url += Page + "/";
	getURI(url);
}
function BabyShower_ThirdStep()
{
	var lEventDate;
	var lRsvpDate;
	var lSelectedTime;
	if( String($('bs_Recipient').value).length < 2 )
	{
		alert("Please type the baby shower recipient(s)");
		return null;
	}
	lEventDate = $('bs_EventDate_Month').value + "/" + $('bs_EventDate_Day').value + "/" + $('bs_EventDate_Year').value;
	if( !SingleDateField_isDate(lEventDate) )
	{
		alert("Please type a valid event date");
		return null;
	}

	if( $('bs_StartTimeHour').value.length == 0 || isNaN($('bs_StartTimeHour').value) || Number($('bs_StartTimeHour').value) < 1 || Number($('bs_StartTimeHour').value) > 12)
	{
		alert("Please enter a valid time.");
		return null;
	}
	if( $('bs_StartTimeMinute').value.length > 0 && (isNaN($('bs_StartTimeMinute').value) || Number($('bs_StartTimeMinute').value) < 0 || Number($('bs_StartTimeMinute').value) > 59))		
	{
		alert("Please enter a valid time.");
		return null;
	}
	else
	{
		if( $('bs_StartTimeMinute').value.length == 0)
			$('bs_StartTimeMinute').value = '00';
	}
	if( $('bs_EndTimeHour').value.length > 0 && (isNaN($('bs_EndTimeHour').value) || Number($('bs_EndTimeHour').value) < 1 || Number($('bs_EndTimeHour').value) > 12))
	{
		alert("Please type a valid hour for end time(only numbers between 1 and 12)");
		return null;
	}
	if( $('bs_EndTimeMinute').value.length > 0 && (isNaN($('bs_EndTimeMinute').value) || Number($('bs_EndTimeMinute').value) < 0 || Number($('bs_EndTimeMinute').value) > 59))
	{
		alert("Please type a valid minute for end time(only numbers between 1 and 59)");
		return null;
	}
	else
	{
		if( $('bs_EndTimeHour').value.length > 0 && $('bs_EndTimeMinute').value.length == 0)
			$('bs_EndTimeMinute').value = '00';
	}	

	/*
	if( $('bs_Location').value.length < 2 ) 
	{
		alert("Please type a valid Location");
		return null;
	}
	*/
	if( $('bs_Address').value.length < 6 )
	{
		alert("Please type a valid address");
		return null;
	}
	if( $('bs_City').value.length < 3 )
	{
		alert("Please type a valid city");
		return null;
	}
	if( $('bs_ZipCode').value.length < 4 || isNaN(Number($('bs_ZipCode').value)) )
	{
		alert("Please type a valid Zip Code(only numbers)");
		return null;
	}
	if( $('bs_Hosts').value.length < 2 )
	{
		alert("Please type a valid host(s)");
		return null;
	}
	if( $('bs_ContactInfo').value.length < 3 )
	{
		alert("Please type a rsvp contact info");
		return null;
	}
	/*
	if( $('bs_RegisteredAt').value.length < 3 )
	{
		alert("Please type a valid registered");
		return null;
	}
	*/
	lRsvpDate = $('bs_RsvpDate_Month').value + "/" + $('bs_RsvpDate_Day').value + "/" + $('bs_RsvpDate_Year').value;
	if( !SingleDateField_isDate(lRsvpDate) )
	{
		alert("Please type a valid rsvp date");
		return null;
	}	
	
	FormSetTarget("shop/baby-shower/step2/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep2");

}
function BabyShower_ThirdStepConfirmed()
{
	FormSetTarget("shop/baby-shower/step2-1/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep2_1");

}
function BabyShower_FourStep()
{
	if( $('bs_InitialApprove').value.length == 0 )
	{
		alert("Please type the initial");
		return null;
	}
	FormSetTarget("shop/baby-shower/step3/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep3");
}
function BabyShower_EndProcess()
{
	FormSetTarget("shop/baby-shower/step5/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep5");
}
function BirthdayParty_SecondStep()
{
	if( isNaN($('BirthdayParty_Quantity').value) )
	{
		alert("Please type a valid quantity");
		return null;
	}
	if( Number($('BirthdayParty_Quantity').value) < Number($('prod_minimumQty').value) )
	{
		alert("The quantity must be equal or greater than " + $('prod_minimumQty').value);
		return null;
	}
	FormSetTarget("shop/birthday-party/step1/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep1");
}
function BirthdayParty_ThirdStep()
{
	var lEventDate;
	var lRsvpDate;
	var lSelectedTime;
	if( String($('bpi_ChildName').value).length < 2 )
	{
		alert("Please type the child's name");
		return null;
	}
	if( isNaN( Number($('bpi_Age').value) ) ||  Number($('bpi_Age').value) < 1 || Number($('bpi_Age').value) > 150)
	{
		alert("Please type a valid age");
		return null;
	}
	lEventDate = $('bpi_EventDate_Month').value + "/" + $('bpi_EventDate_Day').value + "/" + $('bpi_EventDate_Year').value;
	if( !SingleDateField_isDate(lEventDate) )
	{
		alert("Please type a valid event date");
		return null;
	}

	if( $('bpi_StartTimeHour').value.length == 0 || isNaN($('bpi_StartTimeHour').value) || Number($('bpi_StartTimeHour').value) < 1 || Number($('bpi_StartTimeHour').value) > 12)
	{
		alert("Please enter a valid time.");
		return null;
	}
	if( $('bpi_StartTimeMinute').value.length > 0 && (isNaN($('bpi_StartTimeMinute').value) || Number($('bpi_StartTimeMinute').value) < 0 || Number($('bpi_StartTimeMinute').value) > 59))
	{
		alert("Please enter a valid time.");
		return null;
	}
	else
	{
		if( $('bpi_StartTimeMinute').value.length == 0)
			$('bpi_StartTimeMinute').value = '00';
	}
	
	if( $('bpi_EndTimeHour').value.length > 0 && (isNaN($('bpi_EndTimeHour').value) || Number($('bpi_EndTimeHour').value) < 1 || Number($('bpi_EndTimeHour').value) > 12))
	{
		alert("Please type a valid hour for end time(only numbers between 1 and 12)");
		return null;
	}
	if( $('bpi_EndTimeMinute').value.length > 0 && (isNaN($('bpi_EndTimeMinute').value) || Number($('bpi_EndTimeMinute').value) < 0 || Number($('bpi_EndTimeMinute').value) > 59))
	{
		alert("Please type a valid minute for end time(only numbers between 1 and 59)");
		return null;
	}
	else
	{
		if( $('bpi_EndTimeHour').value.length > 0 && $('bpi_EndTimeMinute').value.length == 0)
			$('bpi_EndTimeMinute').value = '00';
	}
	
	
	/*
	if( $('bpi_Location').value.length < 2 ) 
	{
		alert("Please type a valid Location");
		return null;
	}
	*/
	if( $('bpi_Address').value.length < 6 )
	{
		alert("Please type a valid address");
		return null;
	}
	if( $('bpi_City').value.length < 3 )
	{
		alert("Please type a valid city");
		return null;
	}
	if( $('bpi_ZipCode').value.length < 4 || isNaN(Number($('bpi_ZipCode').value)) )
	{
		alert("Please type a valid Zip Code(only numbers)");
		return null;
	}
	if( $('bpi_ContactInfo').value.length < 3 )
	{
		alert("Please type a rsvp contact info");
		return null;
	}
	lRsvpDate = $('bpi_RsvpDate_Month').value + "/" + $('bpi_RsvpDate_Day').value + "/" + $('bpi_RsvpDate_Year').value;
	if( !SingleDateField_isDate(lRsvpDate) )
	{
		alert("Please type a valid rsvp date");
		return null;
	}	
	
	FormSetTarget("shop/birthday-party/step2/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep2");

}
function BirthdayParty_ThirdStepConfirmed()
{
	FormSetTarget("shop/birthday-party/step2-1/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep2_1");

}
function BirthdayParty_FourStep()
{
	if( $('bpi_InitialApprove').value.length == 0 )
	{
		alert("Please type the initial");
		return null;
	}
	FormSetTarget("shop/birthday-party/step3/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep3");
}
function BirthdayParty_EndProcess()
{
	FormSetTarget("shop/birthday-party/step5/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep5");
}
function Prints_SecondStep()
{
	if( isNaN($('Prints_Quantity').value) )
	{
		alert("Please type a valid quantity");
		return null;
	}
	/*
	if( Number($('Prints_Quantity').value) < Number($('prod_minimumQty').value) )
	{
		alert("The quantity must be equal or greater than " + $('prod_minimumQty').value);
		return null;
	}*/
	FormSetTarget("shop/prints/step1/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep1");
}
function PayOrder()
{
	if( validatePaymentForm() )
	{
		FormSetTarget("your-cart/checkout/");
		DoAction("ProcessPayment");
	}
}
function SaveShipping()
{
	FormSetTarget("your-cart/shipping/");
	DoAction("SaveShipping");
}
function SelectPayType(PayType)
{
	var url;
	switch(PayType)
	{
		case 'PayPal':
			FormSetTarget("your-cart/paywithpaypal/");
			DoAction("PayWithPayPal");
			break;
		case 'CreditCard':
			url = $('SiteBase').href + "your-cart/checkout/";
			getURI(url);	
			break;
	}
}
function HolidayCards_PageChange(Target, Page)
{
	var url;
	url = $('SiteBase').href + "shop/holiday-cards/";
	url += $('CurrentCategory').value + "/page/" + Page + "/";
	getURI(url);
}

function HolidayCards_SecondStep()
{
	if( isNaN($('HolidayCards_Quantity').value) )
	{
		alert("Please type a valid quantity");
		return null;
	}
	if( Number($('HolidayCards_Quantity').value) < Number($('prod_minimumQty').value) )
	{
		alert("The quantity must be equal or greater than " + $('prod_minimumQty').value);
		return null;
	}
	FormSetTarget("shop/holiday-cards/step1/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep1");
}

function HolidayCards_ThirdStep()
{
	if( $('hc_card_details').value.length === 0 )
	{
		alert("Please type your holiday text");
		return null;
	}
	FormSetTarget("shop/holiday-cards/step2/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep2");
}
function HolidayCards_FourStep()
{
	if( $('hc_InitialApprove').value.length == 0 )
	{
		alert("Please type the initial");
		return null;
	}
	FormSetTarget("shop/holiday-cards/step3/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep3");
}
function HolidayCards_EndProcess()
{
	FormSetTarget("shop/holiday-cards/step5/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep5");
}


function Stationery_PageChange(Target, Page)
{
	var url;
	url = $('SiteBase').href + "shop/stationery/";
	url += $('CurrentCategory').value + "/page/" + Page + "/";
	getURI(url);
}

function Stationery_SecondStep()
{
	if( isNaN($('Stationery_Quantity').value) )
	{
		alert("Please type a valid quantity");
		return null;
	}
	if( Number($('Stationery_Quantity').value) < Number($('prod_minimumQty').value) )
	{
		alert("The quantity must be equal or greater than " + $('prod_minimumQty').value);
		return null;
	}
	FormSetTarget("shop/stationery/step1/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep1");
}

function Stationery_ThirdStep()
{
	if( $('hc_card_details').value.length === 0 )
	{
		if( !confirm("Do you want to continue without making any text changes?") )
		{
			return null;
		}
	}
	FormSetTarget("shop/stationery/step2/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep2");
}
function Stationery_FourStep()
{
	if( $('hc_InitialApprove').value.length == 0 )
	{
		alert("Please type the initial");
		return null;
	}
	FormSetTarget("shop/stationery/step3/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep3");
}
function Stationery_EndProcess()
{
	FormSetTarget("shop/stationery/step5/"+$('ba_ProductID').value+"/");
	DoAction("SaveStep5");
}
function Stationery_SuggestThankYouCard()
{
	if( ffw_GetRadioButtonValue('thank-you-option') != null)
		DoAction("ChooseThankYouCard");
	else
		alert('Please select if you want a related Thank You card or not.');
}
function Stuff_PageChange(Target, Page)
{
	var url;
	url = $('SiteBase').href + "stuff-we-like/";
	url += Page + "/";
	getURI(url);
}

function showSignUpWindow()
{
	document.getElementById('light').style.display='block';
	document.getElementById('fade').style.display='block';
}
function hideSignUpWindow()
{
	document.getElementById('light').style.display='none';
	document.getElementById('fade').style.display='none';
}
function add_suscriptor()
{
	if( $('suscriptorEmail').value.length == 0 )
	{
		alert('Please type an email');
		return ;
	}
	if( $('suscriptorEmail').value != $('suscriptorEmailConfirm').value )
	{
		alert('Please type the same email address in both inputs.');
		return ;
	}
	if( !ffw_validate_email( $('suscriptorEmail').value ) )
	{
		alert('Please type a valid email');
		return ;
	}

	var url="Application.php?Page=Suscriptors&View=AddSuscriptor&Email=" + $('suscriptorEmail').value;

	xmlHttp = ffwGetXmlHttpObject(add_suscriptor_listener);
	xmlHttp.open("GET", url , true);
	xmlHttp.send(null);
	alert('Thanks for signing up!');
	hideSignUpWindow();
}

function add_suscriptor_listener()
{
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	{
		var Answer = ffw_QueryStringToObject(xmlHttp.responseText);
		if(Answer.Result != "1")
		{
			alert( 'Error when try to add the suscriber' );
		}
	}
}



