/************************************
 *		Delete Product Section		*
 ************************************/
function confirmDelete(what, Name)
{

	var answer = confirm ("Are you sure you want to delete " + Name + " and all the products related to it")
	if (answer)
	{
		doRedirect('Sections_Delete.asp?SectionSeq='+what);
	}
}
/************************************
 *		Delete Look					*
 ************************************/
function confirmProductDelete(what, Name)
{

	var answer = confirm ("Are you sure you want to delete " + Name)
	if (answer)
	{
		doRedirect('products_Delete.asp?lSeq='+what);
	}
}
/************************************
 *		Delete Gift					*
 ************************************/
function confirmGiftDelete(what, Name)
{

	var answer = confirm ("Are you sure you want to delete " + Name)
	if (answer)
	{
		doRedirect('Gifts_Delete.asp?GiftSeq='+what);
	}
}
/************************************
 *		Delete Gift					*
 ************************************/
function confirmIPDelete(what, Name)
{

	var answer = confirm ("Are you sure you want to delete " + Name)
	if (answer)
	{
		doRedirect('irristibleProduct_delete.asp?Seq='+what);
	}
}

/************************************
 *		Delete Store					*
 ************************************/
function confirmDeleteStore(what, Name)
{

	var answer = confirm ("Are you sure you want to delete " + Name)
	if (answer)
	{
		doRedirect('StoreLocator_Delete.asp?StoreSeq='+what);
	}
}
/************************************
 *		Delete Promotional Item		*
 ************************************/
function  confirmPromoDelete(what, Name)
{

	var answer = confirm ("Are you sure you want to delete " + Name)
	if (answer)
	{
		doRedirect('promotions_Delete.asp?PromoSeq='+what);
	}
}
/*************************************
 *		Validate New / Edit Gift	 *
 *************************************/
function validateGift()
{
	tmpImage	= document.getElementById("GiftImg");
	tmpCode		= document.getElementById("style");
	tmpRange	= document.getElementById("PriceRange");
	

	if(tmpCode.value.length < 1)
	{
		alert("Please enter the style code for this gift");
		return false;
	}
	if(tmpRange.value == "")
	{
		alert("Please select the price range for this gift");
		return false;
	}
	return true;
}
/*************************************
 *	Validate New / Edit Promotion	 *
 *************************************/
function validatePromo()
{
	tmpCode		= document.getElementById("style");
	
	if(tmpCode.value.length < 1)
	{
		alert("Please enter the style code for this gift");
		return false;
	}

	return true;
}
 
 
/************************************
 *	Validate New / Edit Section		*
 ************************************/
function validateSectionDetails()
{
	tmpSection		= document.getElementById("SectionName");
	tmpDefaultImg	= document.getElementById("defaultImg");
	tmpRollImg		= document.getElementById("RollImg");
	tmpHeading		= document.getElementById("heading");
	tmpDescription	= document.getElementById("description");
	tmpBG			= document.getElementById("bgcolor");
	
	if(tmpSection.value == "")
	{
		alert("Please Enter the name of the section");
		return false;
	}
	if (tmpDefaultImg.value == "")
	{
		alert("Please select a default imageto be displayed in this section. \rPlease ensure it is the correct size or it will not display correctly");
		return false;
	}
	if(tmpRollImg.value == "")
	{
		alert("Please select a rollover imageto be displayed in this section. \rPlease ensure it is the correct size or it will not display correctly");
		return false;
	}
	if(tmpHeading.value == "")
	{
		alert("Please Enter the heading text for this secion");
		return false;
	}
	if(tmpDescription.value == "")
	{
		alert("Please Enter the description of the section");
		return false;
	}
	if(tmpBG.value.length < 7)
	{
		alert("Please Enter a background color for this section. \rFor white / blank please use '#ffffff'");
		return false;
	}
	return true;
	
}
function validateSTF()
{
    tmpSname    = document.getElementById("sName");
    tmpSemail   = document.getElementById("sEmail");
    tmpRname    = document.getElementById("rName");
    tmpRemail   = document.getElementById("rEmail");
    
    if (tmpSname == "")
    {
        alert("Please enter your name");
        return false;
    }
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(tmpSemail.value))
	{
	}
	else
	{
		alert("Please enter a valid email address");
		return false;
	}
	
	if (tmpRname == "")
    {
        alert("Please enter your friends name");
        return false;
    }
    if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(tmpRemail.value))
	{
	}
	else
	{
		alert("Please enter a valid email address for your friend");
		return false;
	}
}
