function validFile4upload(f) 
{
	if (f.value.length != 0)
	{
		if ((f.value.substring(f.value.length-3, f.value.length).toLowerCase() == "eps") || (f.value.substring(f.value.length-3, f.value.length).toLowerCase() == "tif") || (f.value.substring(f.value.length-3, f.value.length).toLowerCase() == "gif") || (f.value.substring(f.value.length-3, f.value.length).toLowerCase() == "jpg") || (f.value.substring(f.value.length-3, f.value.length).toLowerCase() == "pdf") || (f.value.substring(f.value.length-3, f.value.length).toLowerCase() == ".ai") || (f.value.substring(f.value.length-3, f.value.length).toLowerCase() == "psd") || (f.value.substring(f.value.length-4, f.value.length).toLowerCase() == "indd") || (f.value.substring(f.value.length-3, f.value.length).toLowerCase() == "qxd")) 
		{
		}
		else
		{
			alert("wrong type of file has been selected !!!");
			f.focus();
			return false;
		}
	}
}


function onSubmitPGback(t) 
{
	if (!validFile4upload(t.F1))
	{
//		return false;
	}
	else
	{
		return false;
	}
		


	if (t.title.value == "") 
	{
		alert("You missed to enter a title ");
		t.title.focus();
		return false;
	}

//	return true;
}


function onSubmitForm3(t) 
{
	if (validFile4upload(t.F1))
		return false;

	if (validFile4upload(t.F2))
		return false;

	if (validFile4upload(t.F3))
		return false;

	return true;
}


function onSubmitForm(t) 
{
	if (validFile4upload(t.F1))
		return false;

	if (validFile4upload(t.F2))
		return false;

	if (validFile4upload(t.F3))
		return false;

	if (validFile4upload(t.F4))
		return false;

	if (validFile4upload(t.F5))
		return false;

	if (validFile4upload(t.F6))
		return false;

	if (validFile4upload(t.F7))
		return false;

	if (validFile4upload(t.F8))
		return false;

	if (validFile4upload(t.F9))
		return false;

	if (validFile4upload(t.F10))
		return false;


	if (!((t.F1.value == "") && (t.F2.value == "") && (t.F3.value == "") && (t.F4.value == "") && (t.F5.value == "") && (t.F6.value == "") && (t.F7.value == "") && (t.F8.value == "") && (t.F9.value == "") && (t.F10.value == "")) && !(t.chkImgQuality.checked))
	{
		alert("Please accept the image quality policy");
		t.chkImgQuality.focus();
		return false;
	}

	if (t.chkFinalArtwork.checked==true)
		{
			t.Azione.value="FinalizeCusDesign";
			t.Azione2.value="";
		}
	else
		{
			t.Azione.value=""
			t.Azione2.value="customizeDesign1";
		}

	t.submit();
	

}


function saveOrder() 
{
 if (confirm("Are you sure, you want to Save this order now?")) 
 { 
	window.location.href="checkout.asp?savefromcyd1=y";
 } 
 else
 { 
	return false; 
 } 
	
}



function onSubmitUpload(t) 
{
	if (validFile4upload(t.F1))
		return false;

	if (validFile4upload(t.F2))
		return false;

	if (validFile4upload(t.F3))
		return false;

	if (validFile4upload(t.F4))
		return false;

	if (validFile4upload(t.F5))
		return false;

	if (validFile4upload(t.F6))
		return false;

	if (validFile4upload(t.F7))
		return false;

	if (validFile4upload(t.F8))
		return false;

	if (validFile4upload(t.F9))
		return false;

	if (validFile4upload(t.F10))
		return false;


	if (!((t.F1.value == "") && (t.F2.value == "") && (t.F3.value == "") && (t.F4.value == "") && (t.F5.value == "") && (t.F6.value == "") && (t.F7.value == "") && (t.F8.value == "") && (t.F9.value == "") && (t.F10.value == "")) && !(t.chkImgQuality.checked))
	{
		alert("Please accept the image quality policy");
		t.chkImgQuality.focus();
		return false;
	}
	return true;

}


function AddItem() 
{
 if (confirm("You are going to Add More item to this order now. Are you sure you want to proceed ?")) 
 { 
	window.location.href="get-started.asp";
 } 
 else
 { 
	return false; 
 } 
	
}


function getPriceQuote(pIdCartRow)
{
	window.location.href = "contact.asp?w=cq&AzioneQ=getQuoteFromcyd1&getQuoteFromcyd1="+pIdCartRow;
}