var message="";

function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")

var ns6=document.getElementById&&!document.all?1:0
var head="display:''"
var folder=''

function expandit(curobj){
folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style
if (folder.display=="none")
folder.display=""
else
folder.display="none"
}

//configure the two variables below to match yoursite's own info
var bookmarkurl="http://www.embassyshirts.com"
function addbookmark(lg)
{
var bookmarktitle="";
if(lg==1)
{
	bookmarktitle="Tailor made Shirts Trousers and Overcoats for men"
}


//else
//{
//	bookmarktitle="Hemden, Hosen, Anzuege und Maentel fuer Maenner nach Mass"
//}
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}

function notYet()
{
	alert("Sorry this item is not available yet!");
}

function printThis()
{
if (window.print != null) 
{ window.print(); }
 else
 { alert('Unfortunately, your browser does not support this shortcut. Please select Print from the File menu.'); }
}

function WholeNumberOnly(opt,msg)
{
	var pos=opt.value.indexOf(".")
	if  (pos>0)
	  {
		alert("The "+msg+" can only be whole numbers!"); 
		opt.value=opt.value.substr(0,opt.value.length-1);
		opt.focus();
	  }	 
	if  (isNaN(opt.value))
	  {
		alert("The "+msg+" can only be whole numbers!"); 
		opt.value=opt.value.substr(0,opt.value.length-1);
		opt.focus();
	  }
}

function WholeNumberOnlyEmpty(opt,msg)
{
	var pos=opt.value.indexOf(".")
	if  (pos>0)
	  {
		alert("The "+msg+" can only be whole numbers!"); 
		opt.value="";
		opt.focus();
	  }	 
	if  (isNaN(opt.value))
	  {
		alert("The "+msg+" can only be whole numbers!"); 
		opt.value="";
		opt.focus();
	  }
}

function TinyIntOnly(opt,msg)
{
	if(opt.value>255)
	{
		alert("The "+msg+" can not be greater than 255!");
		opt.value="";
		opt.focus();
	}
}

function NumericOnly(opt,msg)
{
	if  (isNaN(opt.value))
	  {
		alert("The "+msg+" can only be numbers!"); 
		opt.value=opt.value.substr(0,opt.value.length-1);
		opt.focus();
	  }
}

function NumericOnlyEmpty(opt,msg)
{
	if  (isNaN(opt.value))
	  {
		alert("The "+msg+" can only be numbers!"); 
		opt.value="";
		opt.focus();
	  }
}

function SetZero(opt)
{
	if  (opt.value=="")
	  {
		opt.value=0;
	  }
}

function SetBlank(opt)
{ 
	if  (opt.value=="0")
	  {
		opt.value="";
	  }
}

function isDate(DateToCheck)
{
if(DateToCheck==""){return true;}
var m_strDate = FormatDate(DateToCheck);
if(m_strDate==""){
return false;
}
var m_arrDate = m_strDate.split("/");
var m_DAY = m_arrDate[0];
var m_MONTH = m_arrDate[1];
var m_YEAR = m_arrDate[2];
if(m_YEAR.length > 4){;return false;}
m_strDate = m_MONTH + "/" + m_DAY + "/" + m_YEAR;
var testDate=new Date(m_strDate);
if(testDate.getMonth()+1==m_MONTH){;
return true;
} 
else{;
return false;
}
}//end function

function FormatDate(DateToFormat,FormatAs){

if(DateToFormat==""){return"";}
if(!FormatAs){FormatAs="dd/mm/yyyy";}
var strReturnDate;
FormatAs = FormatAs.toLowerCase();
DateToFormat = DateToFormat.toLowerCase();
var arrDate
var arrMonths = new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var strMONTH;
var Separator;

while(DateToFormat.indexOf("st")>-1){
DateToFormat = DateToFormat.replace("st","");
}

while(DateToFormat.indexOf("nd")>-1){
DateToFormat = DateToFormat.replace("nd","");
}

while(DateToFormat.indexOf("rd")>-1){
DateToFormat = DateToFormat.replace("rd","");
}

while(DateToFormat.indexOf("th")>-1){
DateToFormat = DateToFormat.replace("th","");
}

if(DateToFormat.indexOf(".")>-1){
Separator = ".";
}

if(DateToFormat.indexOf("-")>-1){
Separator = "-";
}


if(DateToFormat.indexOf("/")>-1){
Separator = "/";
}

if(DateToFormat.indexOf(" ")>-1){
Separator = " ";
}

arrDate = DateToFormat.split(Separator);
DateToFormat = "";
	for(var iSD = 0;iSD < arrDate.length;iSD++){
		if(arrDate[iSD]!=""){
		DateToFormat += arrDate[iSD] + Separator;
		}
	}
DateToFormat = DateToFormat.substring(0,DateToFormat.length-1);
arrDate = DateToFormat.split(Separator);

if(arrDate.length < 3){
return "";
}

var DAY = arrDate[0];
var MONTH = arrDate[1];
var YEAR = arrDate[2];




if(parseFloat(arrDate[1]) > 12){
DAY = arrDate[1];
MONTH = arrDate[0];
}

if(parseFloat(DAY) && DAY.toString().length==4){
YEAR = arrDate[0];
DAY = arrDate[2];
MONTH = arrDate[1];
}


for(var iSD = 0;iSD < arrMonths.length;iSD++){
var ShortMonth = arrMonths[iSD].substring(0,3).toLowerCase();
var MonthPosition = DateToFormat.indexOf(ShortMonth);
	if(MonthPosition > -1){
	MONTH = iSD + 1;
		if(MonthPosition == 0){
		DAY = arrDate[1];
		YEAR = arrDate[2];
		}
	break;
	}
}

var strTemp = YEAR.toString();
if(strTemp.length==2){

	if(parseFloat(YEAR)>40){
	YEAR = "19" + YEAR;
	}
	else{
	YEAR = "20" + YEAR;
	}

}


	if(parseInt(MONTH)< 10 && MONTH.toString().length < 2){
	MONTH = "0" + MONTH;
	}
	if(parseInt(DAY)< 10 && DAY.toString().length < 2){
	DAY = "0" + DAY;
	}
	switch (FormatAs){
	case "dd/mm/yyyy":
	return DAY + "/" + MONTH + "/" + YEAR;
	case "mm/dd/yyyy":
	return MONTH + "/" + DAY + "/" + YEAR;
	case "dd/mmm/yyyy":
	return DAY + " " + arrMonths[MONTH -1].substring(0,3) + " " + YEAR;
	case "mmm/dd/yyyy":
	return arrMonths[MONTH -1].substring(0,3) + " " + DAY + " " + YEAR;
	case "dd/mmmm/yyyy":
	return DAY + " " + arrMonths[MONTH -1] + " " + YEAR;	
	case "mmmm/dd/yyyy":
	return arrMonths[MONTH -1] + " " + DAY + " " + YEAR;
	}

return DAY + "/" + strMONTH + "/" + YEAR;;

}

function checkEmailValid(emailStr,msg)
{
	var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom=validChars + '+'
	var word="(" + atom + "|" + quotedUser + ")"
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	var errMsg="";   
	var matchArray=emailStr.match(emailPat)
	if (matchArray==null) 
	{
	   errMsg=errMsg+"The "+msg+"email address seems incorrect!";
	   return errMsg;
	}
	else
	{
	  var user=matchArray[1]
	  var domain=matchArray[2]
	  if (user.match(userPat)==null) 
	  {
		errMsg=errMsg+"The "+msg+"email address seems incorrect!";
		return errMsg;       
	  }
	  var IPArray=domain.match(ipDomainPat)
	  if (IPArray!=null) 
	  {
		  for (var i=1;i<=4;i++) 
			  {
			if (IPArray[i]>255) 
				{
				errMsg=errMsg+"The "+msg+"email address seems incorrect!";
				return errMsg;
				}//IF
			  }//for
	   }//IP Array
	   var domainArray=domain.match(domainPat)
	   if (domainArray==null) 
	   {
		 errMsg=errMsg+"The "+msg+"email address seems incorrect!";
		 return errMsg;
	   }
	   var atomPat=new RegExp(atom,"g")
	   var domArr=domain.match(atomPat)
	   var len=domArr.length
	   if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) 
	   {
		 errMsg=errMsg+"The "+msg+"email address seems incorrect!";
		 return errMsg;	
	   } 
	   if (len<2) 
	   {
		 errMsg=errMsg+"The "+msg+"email address seems incorrect!";
		 return errMsg;	 
	   } 
	 }//End  Match
	return "0";
}

function GP_AdvOpenWindow(theURL,winName,features,popWidth,popHeight,winAlign,ignorelink,alwaysOnTop,autoCloseTime,borderless) { //v2.0
  var leftPos=0,topPos=0,autoCloseTimeoutHandle, ontopIntervalHandle, w = 480, h = 340;  
  if (popWidth > 0) features += (features.length > 0 ? ',' : '') + 'width=' + popWidth;
  if (popHeight > 0) features += (features.length > 0 ? ',' : '') + 'height=' + popHeight;
  if (winAlign && winAlign != "" && popWidth > 0 && popHeight > 0) {
    if (document.all || document.layers || document.getElementById) {w = screen.availWidth; h = screen.availHeight;}
		if (winAlign.indexOf("center") != -1) {topPos = (h-popHeight)/2;leftPos = (w-popWidth)/2;}
		if (winAlign.indexOf("bottom") != -1) topPos = h-popHeight; if (winAlign.indexOf("right") != -1) leftPos = w-popWidth; 
		if (winAlign.indexOf("left") != -1) leftPos = 0; if (winAlign.indexOf("top") != -1) topPos = 0; 						
    features += (features.length > 0 ? ',' : '') + 'top=' + topPos+',left='+leftPos;}
  if (document.all && borderless && borderless != "" && features.indexOf("fullscreen") != -1) features+=",fullscreen=1";
  if (window["popupWindow"] == null) window["popupWindow"] = new Array();
  var wp = popupWindow.length;
  popupWindow[wp] = window.open(theURL,winName,features);
  if (popupWindow[wp].opener == null) popupWindow[wp].opener = self;  
  if (document.all || document.layers || document.getElementById) {
    if (borderless && borderless != "") {popupWindow[wp].resizeTo(popWidth,popHeight); popupWindow[wp].moveTo(leftPos, topPos);}
    if (alwaysOnTop && alwaysOnTop != "") {
    	ontopIntervalHandle = popupWindow[wp].setInterval("window.focus();", 50);
    	popupWindow[wp].document.body.onload = function() {window.setInterval("window.focus();", 50);}; }
    if (autoCloseTime && autoCloseTime > 0) {
    	popupWindow[wp].document.body.onbeforeunload = function() {
  			if (autoCloseTimeoutHandle) window.clearInterval(autoCloseTimeoutHandle);
    		window.onbeforeunload = null;	}  
   		autoCloseTimeoutHandle = window.setTimeout("popupWindow["+wp+"].close()", autoCloseTime * 1000); }
  	window.onbeforeunload = function() {for (var i=0;i<popupWindow.length;i++) popupWindow[i].close();}; }   
  document.MM_returnValue = (ignorelink && ignorelink != "") ? false : true;
}
function showTodayDate()	//this function has to be on each page please do not move!
{
	var myDate=new Date();
	var monthName="";
	dayNum=myDate.getDate()/1;
	monthNum=myDate.getMonth()/1;
	yearNum=myDate.getFullYear();

	if(monthNum==0)
	{
		monthName='January'
	}
	else if(monthNum==1)
	{
		monthName='February'
	}
	else if(monthNum==2)
	{
		monthName='March'
	}
	else if(monthNum==3)
	{
		monthName='April'
	}
	else if(monthNum==4)
	{
		monthName='May'
	}
	else if(monthNum==5)
	{
		monthName='June'
	}
	else if(monthNum==6)
	{
		monthName='July'
	}
	else if(monthNum==7)
	{
		monthName='August'
	}
	else if(monthNum==8)
	{
		monthName='September'
	}
	else if(monthNum==9)
	{
		monthName='October'
	}
	else if(monthNum==10)
	{
		monthName='November'
	}
	else if(monthNum==11)
	{
		monthName='December'
	}
	if(dayNum<10)
	{
		dayNum="0"+dayNum;
	}
	myDate=dayNum+' '+monthName+' '+yearNum;
	document.all('strTodayDate').innerText ="  "+myDate;
}

function checkRegister()
{
	var fname=document.frmData.strFirstName.value;
	if (fname=="" || fname==" " || fname=="-" || fname=="_" || fname==".")
	{
		alert("Please enter your first name!");
		return false;
	}
	var lname=document.frmData.strLastName.value;
	if (lname=="" || lname==" " || lname=="-" || lname=="_" || lname==".")
	{
		alert("Please enter your last name!");
		return false;
	}
	
	var pw=document.frmData.strPassword.value;
	var cfpw=document.frmData.strConfPassword.value;
	var e=document.frmData.strEmail.value;
	if(e=="" || e==" ")
	{
		alert("Please enter your email address!");
		return false;
	}
	if (checkEmailValid(e)!="0") 
	{
		alert(checkEmailValid(e,'your'));
		return false;	
	}
	if((pw=="" || pw==" " || pw=="-" || pw=="_" || pw==".") && (pw=="" || pw==" " || pw=="-" || pw=="_" || pw=="."))
	{
		alert("Please enter your password!");
		return false;
	}
	if((cfpw=="" || cfpw==" " || cfpw=="-" || cfpw=="_" || cfpw==".") && (cfpw=="" || cfpw==" " || cfpw=="-" || cfpw=="_" || cfpw=="."))
	{
		alert("Please confirm your password!");
		return false;
	}
	if(pw!=cfpw)
	{
		alert("Your password and confirm password do not match!")
		return false;
	}

	
	var tel=document.frmData.strTelephone.value;
	if (tel=="" || tel==" " || tel=="-" || tel=="_" || tel==".")
	{
		alert("Please enter your telephone number!");
		return false;
	}
	var addr=document.frmData.strAddress.value;
	if (addr=="" || addr==" " || addr=="-" || addr=="_" || addr==".")
	{
		alert("Please enter your address!");
		return false;
	}
	if (addr.length > 512)
	{
		  alert("The maximum characters of the address is 512!");
		  return false;
	}
	var city=document.frmData.strCity.value;
	if (city=="" || city==" " || city=="-" || city=="_" || city==".")
	{
		alert("Please enter your city!");
		return false;
	}
	var zip=document.frmData.strPostal.value;
	if (zip=="" || zip==" " || zip=="-" || zip=="_" || zip==".")
	{
		alert("Please enter your zip/postal!");
		return false;
	}
	if(document.frmData.lngCountryId.value=="0")
	{
		alert("Please select a country!");
		return false;
	}
		
	var neck=document.frmData.strNeck.value;
	var chest=document.frmData.strChest.value;
	var waist=document.frmData.strWaist.value;
	var length=document.frmData.strLength.value;
	var hips=document.frmData.strHips.value;
	var shoulder=document.frmData.strShoulder.value;
	var sleeve=document.frmData.strSleeve.value;
	var biceps=document.frmData.strBiceps.value;
	var cuff=document.frmData.strCuff.value;
	
//put 0 Measure Preferred Shirt	
	var scollar=document.frmData.strSCollar.value;
	var schest=document.frmData.strSChest.value;
	var swaist=document.frmData.strSWaist.value;
	var sbottom=document.frmData.strSBottom.value;
	var slength=document.frmData.strSLength.value;
	var ssleeve=document.frmData.strSSleeve.value;
	var ssshort=document.frmData.strSShort.value;
	var sback=document.frmData.strSBack.value;
	var sarmpit=document.frmData.strSArmpit.value;
	var scuff=document.frmData.strSCuff.value;
	var sshortcuff=document.frmData.strSShortCuff.value;
	if(neck=="0" && chest=="0" && waist=="0" && length=="0" && hips=="0" && shoulder=="0" && sleeve=="0" && biceps=="0" && cuff=="0" && scollar=="0" && schest=="0" && swaist=="0" && sbottom=="0" && slength=="0" && ssleeve=="0" && ssshort=="0" && sback=="0" && sarmpit=="0" && scuff=="0" && sshortcuff=="0")
	{
		alert("Please enter your Measurements!");
		return false;
	}

	if(neck!="0" || chest!="0" || waist!="0" || length!="0" || hips!="0" || shoulder!="0" || sleeve!="0" || biceps!="0" || cuff!="0")
	{
		if (neck=="0")
		{
			alert("Please enter your Neck Size!");
			return false;
		}
		if (chest=="0")
		{
			alert("Please enter your Chest Size!");
			return false;
		}
		if (waist=="0")
		{
			alert("Please enter your Waist Size!");
			return false;
		}
		if (length=="0")
		{
			alert("Please enter your Length Size!");
			return false;
		}
		if (hips=="0")
		{
			alert("Please enter your Hips Size!");
			return false;
		}
		if (shoulder=="0")
		{
			alert("Please enter your Shoulder Size!");
			return false;
		}
		if (sleeve=="0")
		{
			alert("Please enter your Sleeve Size!");
			return false;
		}
		if (biceps=="0")
		{
			alert("Please enter your Biceps Size!");
			return false;
		}
		if (cuff=="0")
		{
			alert("Please enter your Cuff Size!");
			return false;
		}
		
	}
	if(scollar!="0" && schest!="0" && swaist!="0" && sbottom!="0" && slength!="0" && ssleeve!="0" && ssshort!="0" && sback!="0" && sarmpit!="0" && scuff!="0" && sshortcuff!="0")
	{
		if (scollar=="0")
		{
			alert("Please enter your Collar Size!");
			return false;
		}
		if (schest=="0")
		{
			alert("Please enter your Chest Size!");
			return false;
		}
		if (swaist=="0")
		{
			alert("Please enter your Waist Size!");
			return false;
		}
		if (sbottom=="0")
		{
			alert("Please enter your Bottom Size!");
			return false;
		}
		if (slength=="0")
		{
			alert("Please enter your Shirt Length Size!");
			return false;
		}
		if (ssleeve=="0")
		{
			alert("Please enter your Sleeve Length Size!");
			return false;
		}
		if (ssshort=="0")
		{
			alert("Please enter your Short Sleeve Length Size!");
			return false;
		}
		if (sback=="0")
		{
			alert("Please enter your Back Size!");
			return false;
		}
		if (sarmpit=="0")
		{
			alert("Please enter your Armpit Size!");
			return false;
		}
		if (scuff=="0")
		{
			alert("Please enter your Cuff Size!");
			return false;
		}
		if (sshortcuff=="0")
		{
			alert("Please enter your Short Sleeve Size!");
			return false;
		}
	}
	return true;
}
function checkProductSearch()
{
	var wkey=document.frmData.strWordKey.value;
	if (wkey=="" || wkey==" " || wkey=="-" || wkey=="_" || wkey==".")
	{
		alert("Please enter your key word!");
		return false;
	}
	return true;
}
function checkCustomerSign()
{
	var e=document.frmData.strUserName.value;
	if(e=="" || e==" ")
	{
		alert("Please enter your email address!");
		return false;
	}
	else
	{
		if (checkEmailValid(e)!="0")
		{
			alert(checkEmailValid(e,''));
			return false;	
		} 
	}
	if(document.frmData.strPassword.value=="")
	{
		alert("Please enter your password!");
		return false;
	}
	return true;
}
function checkForgotpwd()
{
	var e=document.frmData.strEmail.value;
	if(e=="" || e==" ")
	{
		alert("Please enter your email address!");
		return false;
	}
	else
	{
		if (checkEmailValid(e)!="0")
		{
			alert(checkEmailValid(e,''));
			return false;	
		} 
	}
	return true;
}

function checkAddShirts()
{
	if(document.frmData.lngCollarId.value=="0")
	{
		alert("Please select a collar!");
		return false;
	}
	if(document.frmData.lngFrontStyleId.value=="0")
	{
		alert("Please select a front style!");
		return false;
	}
	if(document.frmData.lngBackStyleId.value=="0")
	{
		alert("Please select a back style!");
		return false;
	}
	if(document.frmData.lngCuffId.value=="0")
	{
		alert("Please select a cuff!");
		return false;
	}
	var mono=document.frmData.strMonogram.value;
	if (mono.length > 1)
	{
		if(document.frmData.lngMonogramId.value=="0")
		{
			alert("Please select a monogram!");
			return false;
		}
	}
	if(document.frmData.lngMonogramId.value!="0")
	{
		if (mono=="" || mono==" " || mono=="-" || mono=="_" || mono==".")
		{
			alert("Please enter your monogram!");
			return false;
		}
	}
	var ints=document.frmData.strInstruction.value;
	if (ints.length > 512)
	{
		  alert("The maximum characters of the address is 512!");
		  return false;
	}
	if(document.frmData.strQuantity.value=="0")
	{
		alert("Please select a quantity!");
		return false;
	}
	return true;
}

function checkQuantity()
{
	if(document.frmData.strQuantity.value=="0")
	{
		alert("Please select a quantity!");
		return false;
	}
	return true;
}
function checkCheckOut()
{
	var fname=document.frmData.strFirstName.value;
	if(fname=="" || fname==" " || fname=="-" || fname=="_" || fname==".")
	{
		alert("Please enter the ship first name!");
		return false;
	}
	var lname=document.frmData.strLastName.value;
	if(lname=="" || lname==" " || lname=="-" || fname=="_" || lname==".")
	{
		alert("Please enter the ship last name!");
		return false;
	}
	var e=document.frmData.strEmail.value;
	if(e=="" || e==" ")
	{
		alert("Please enter your ship email address!");
		return false;
	}
	if (checkEmailValid(e)!="0") 
	{
		alert(checkEmailValid(e,'ship'));
		return false;	
	}
	var stel=document.frmData.strTelephone.value;
	if(stel=="" || stel==" " || stel=="-" || stel=="_" || stel==".")
	{
		alert("Please enter the ship telephone!");
		return false;
	}
	var sadd=document.frmData.strAddress.value;
	if(sadd=="" || sadd==" " || sadd=="-" || sadd=="_" || sadd==".")
	{
		alert("Please enter the ship address!");
		return false;
	}
	if (sadd.length > 512)
	{
		  alert("The maximum characters of the ship address is 512!");
		  return false;
	}
	var scity=document.frmData.strCity.value;
	if(scity=="" || scity==" " || scity=="-" || scity=="_" || scity==".")
	{
		alert("Please enter the ship city!");
		return false;
	}
	if(document.frmData.lngCountryId.value=="0")
	{
		alert("Please select a ship country!");
		return false;
	}
	
	if(document.frmData.lngLengthId.value=="0")
	{
		alert("Please select a length size!");
		return false;
	}
	if(document.frmData.lngWaistId.value=="0")
	{
		alert("Please select a waist size!");
		return false;
	}
	if(document.frmData.lngShoulderId.value=="0")
	{
		alert("Please select a shoulder size!");
		return false;
	}
	if(document.frmData.lngNeckId.value=="0")
	{
		alert("Please select a neck size!");
		return false;
	}
	if(document.frmData.lngStandardSizeId.value=="0")
	{
		alert("Please select a standard size!");
		return false;
	}
	if(document.frmData.lngWeightId.value=="0")
	{
		alert("Please select a weight size!");
		return false;
	}
	if(document.frmData.lngChestId.value=="0")
	{
		alert("Please select a chest size!");
		return false;
	}
	if(document.frmData.lngHipsId.value=="0")
	{
		alert("Please select a hips size!");
		return false;
	}
	if(document.frmData.lngSleevesId.value=="0")
	{
		alert("Please select a sleeves size!");
		return false;
	}
	if(document.frmData.lngMeasureHowId.value=="0")
	{
		alert("Please select a measure how?!");
		return false;
	}
	if(document.frmData.lngHeightId.value=="0")
	{
		alert("Please select a height size!");
		return false;
	}
	if(document.frmData.lngTaperId.value=="0")
	{
		alert("Please select a taper!");
		return false;
	}

	return true;
}

function checkTellAFriend()
{
	var fName=document.frmData.strFriendName.value;
	var yName=document.frmData.strYourName.value;
	if (fName=="" || fName==" " || fName=="-" || fName=="_" || fName==".")
	{
		alert("Your Friend's Name is required!");
		return false;
	}
	var e=document.frmData.strFriendEmail.value;
	if(e.length==""||e.length==" ")
	{
		alert("Your Friend's Email Address is required!");
		return false;
	}
	if(e.length!=0)
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Friend '));
			return false;	
		}
	}	
	if (yName=="" || yName==" " || yName=="-" || yName=="_" || yName==".")
	{
		alert("Your Name is required!");
		return false;
	}
	var e=document.frmData.strEmail.value;
	if(e.length==""||e.length==" ")
	{
		alert("Your Email Address is required!");
		return false;
	}
	if(e.length!=0)
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'Your '));
			return false;	
		}
	}	
	return true;
}

function checkCartCheckOut()
{
	if(document.frmData.lngShippingMethodId.value=="0")
	{
		alert("Please select a ship via!");
		return false;
	}
	if(document.frmData.lngPaymentOptionId.value=="0")
	{
		alert("Please select a pay with!");
		return false;
	}
	return true;
}


//****************************************************************************************************************************************************
//****************************************************************************************************************************************************
//****************************************************************************************************************************************************
//****************************************************************************************************************************************************
//****************************************************************************************************************************************************
//****************************************************************************************************************************************************
function checkTempContact()
{
	if (document.frmData.strContactName.value=="" || document.frmData.strContactName.value==" " || document.frmData.strContactName.value=="-" || document.frmData.strContactName.value=="_" || document.frmData.strContactName.value==".")
	{
		alert("Please enter your name!");
		return false;
	}
	var e=document.frmData.strEmail.value;
	if(e=="" || e==" ")
	{
		alert("Please enter your email address!");
		return false;
	}
	if (checkEmailValid(e)!="0") 
	{
		alert(checkEmailValid(e,''));
		return false;	
	}
	if (document.frmData.strMessage.value=="" || document.frmData.strMessage.value==" " || document.frmData.strMessage.value=="-" || document.frmData.strMessage.value=="_" || document.frmData.strMessage.value==".")
	{
		alert("Please enter your message!");
		return false;
	}	
	return true;
}

function checkContactUs()
{
	if (document.frmData.strContactName.value=="" || document.frmData.strContactName.value==" " || document.frmData.strContactName.value=="-" || document.frmData.strContactName.value=="_" || document.frmData.strContactName.value==".")
	{
		alert("Please enter your contact name!");
		return false;
	}
	var e=document.frmData.strEmail.value;
	if(e=="" || e==" ")
	{
		alert("Please enter your email address!");
		return false;
	}
	if (checkEmailValid(e)!="0") 
	{
		alert(checkEmailValid(e,''));
		return false;	
	}
	if (document.frmData.strMessage.value=="" || document.frmData.strMessage.value==" " || document.frmData.strMessage.value=="-" || document.frmData.strMessage.value=="_" || document.frmData.strMessage.value==".")
	{
		alert("Please enter your message!");
		return false;
	}	
	return true;
}

function checkTellFriendEnglish()
{
	if (document.frmData.strFriendName.value=="" || document.frmData.strFriendName.value==" " || document.frmData.strFriendName.value=="-" || document.frmData.strFriendName.value=="_" || document.frmData.strFriendName.value==".")
	{
		alert("Please enter your friend's name!");
		return false;
	}
	var e=document.frmData.strFriendEmail.value;
	if(e.length==""||e.length==" ")
	{
		alert("Please enter your friend's email address!");
		return false;
	}
	if(e.length!=0)
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,'friend '));
			return false;	
		}
	}	
	if (document.frmData.strYourName.value=="" || document.frmData.strYourName.value==" " || document.frmData.strYourName.value=="-" || document.frmData.strYourName.value=="_" || document.frmData.strYourName.value==".")
	{
		alert("Please enter your name!");
		return false;
	}
	var e=document.frmData.strEmail.value;
	if(e.length==""||e.length==" ")
	{
		alert("Please enter your email address!");
		return false;
	}
	if(e.length!=0)
	{
		if (checkEmailValid(e)!="0") 
		{
			alert(checkEmailValid(e,''));
			return false;	
		}
	}	
	return true;
}
function checkMyProfile()
{
	var pw=document.frmProfile.strPassword.value;
	var cfpw=document.frmProfile.strConfPassword.value;
	
	if (document.frmProfile.strFirstName.value=="" || document.frmProfile.strFirstName.value==" " || document.frmProfile.strFirstName.value=="-" || document.frmProfile.strFirstName.value=="_" || document.frmProfile.strFirstName.value==".")
	{
		alert("Please enter your first name!");
		return false;
	}

	if(document.frmProfile.intDay.value=="0" && document.frmProfile.intMonth.value=="0" && document.frmProfile.intYear.value=="0")
	{
		//leave it
	}
	else
	{
		if(isDate(document.frmProfile.intDay.value+'/'+document.frmProfile.intMonth.value+'/'+document.frmProfile.intYear.value)==false)
		{
			alert("The date of birth does not appear to be a correct date!")
			return false;
		}
	}

	if(document.frmProfile.strEmail.value=="" || document.frmProfile.strEmail.value==" ")
	{
		alert("Please enter your email address!");
		return false;
	}
	var e=document.frmProfile.strEmail.value;
	if(e.length!=0)
	{
		if (checkEmailValid(e)!="0")
		{
			alert(checkEmailValid(e,''));
			return false;	
		}
	}		
	if((pw=="" || pw==" " || pw=="-" || pw=="_" || pw==".") && (pw=="" || pw==" " || pw=="-" || pw=="_" || pw=="."))
	{
		alert("Please enter your password!");
		return false;
	}
	if((cfpw=="" || cfpw==" " || cfpw=="-" || cfpw=="_" || cfpw==".") && (cfpw=="" || cfpw==" " || cfpw=="-" || cfpw=="_" || cfpw=="."))
	{
		alert("Please confirm your password!");
		return false;
	}
	if(pw!=cfpw)
	{
		alert("Your password and confirm password do not match!")
		return false;
	}

	if((document.frmProfile.strHomeNo.value=="" || document.frmProfile.strHomeNo.value==" ") && (document.frmProfile.strBusNo.value=="" || document.frmProfile.strBusNo.value==" ") && (document.frmProfile.strMobile.value=="" || document.frmProfile.strMobile.value==" "))
	{
		alert("Please supply at least one telephone number!");
		return false;
	}
	if (document.frmProfile.strAddress.value.length > 255)
	{
		  alert("The length of the address must be lesser than 255 characters!");
		  return false;
	}
	if(document.frmProfile.optSubscribe[0].checked==false && document.frmProfile.optSubscribe[1].checked==false)
	{
		alert("Would you like to subscribe to our newsletter?");
		return false;
	}
	if(document.frmProfile.optSubscribe[0].checked==true)
	{
		if(document.frmProfile.optStyle[0].checked==false && document.frmProfile.optStyle[1].checked==false)
		{
			alert("What type of media do you prefer?");
			return false;
		}
	}
	return true;
}



function checkNewCustomerAccount()
{
	var pw=document.frmData.strPassword.value;
	var cfpw=document.frmData.strConfPassword.value;
	
	if (document.frmData.strFirstName.value=="" || document.frmData.strFirstName.value==" " || document.frmData.strFirstName.value=="-" || document.frmData.strFirstName.value=="_" || document.frmData.strFirstName.value==".")
	{
		alert("Please enter your first name!");
		return false;
	}

	if(document.frmData.intDay.value=="0" && document.frmData.intMonth.value=="0" && document.frmData.intYear.value=="0")
	{
		//leave it
	}
	else
	{
		if(isDate(document.frmData.intDay.value+'/'+document.frmData.intMonth.value+'/'+document.frmData.intYear.value)==false)
		{
			alert("Ihr Geburtsdatum scheint falsch zu sein!")
			return false;
		}
	}

	if(document.frmData.strEmail.value=="" || document.frmData.strEmail.value==" ")
	{
		alert("Please enter your email address!");
		return false;
	}
	var e=document.frmData.strEmail.value;
	if(e.length!=0)
	{
		if (checkEmailValid(e)!="0")
		{
			alert(checkEmailValid(e,''));
			return false;	
		}
	}		
	if((pw=="" || pw==" " || pw=="-" || pw=="_" || pw==".") && (pw=="" || pw==" " || pw=="-" || pw=="_" || pw=="."))
	{
		alert("Please enter your password!");
		return false;
	}
	if((cfpw=="" || cfpw==" " || cfpw=="-" || cfpw=="_" || cfpw==".") && (cfpw=="" || cfpw==" " || cfpw=="-" || cfpw=="_" || cfpw=="."))
	{
		alert("Please confirm your password!");
		return false;
	}
	if(pw!=cfpw)
	{
		alert("Your password and confirm password do not match!")
		return false;
	}
	
	if((document.frmData.strHomeNo.value=="" || document.frmData.strHomeNo.value==" ") && (document.frmData.strBusNo.value=="" || document.frmData.strBusNo.value==" ") && (document.frmData.strMobile.value=="" || document.frmData.strMobile.value==" "))
	{
		alert("Please supply at least one telephone number!");
		return false;
	}
	if (document.frmData.strAddress.value.length > 255)
	{
		  alert("The length of the address must be lesser than 255 characters!");
		  return false;
	}
	if(document.frmData.optSubscribe[0].checked==false && document.frmData.optSubscribe[1].checked==false)
	{
		alert("Would you like to subscribe to our newsletter?");
		return false;
	}
	if(document.frmData.optSubscribe[0].checked==true)
	{
		if(document.frmData.optStyle[0].checked==false && document.frmData.optStyle[1].checked==false)
		{
			alert("Please select a style of our newsletter will be sent to you!");
			return false;
		}
	}
	return true;
}

function checkNewMeasurementSetEnglish()
{
	var sn=document.frmData.strSetName.value;
	if(sn=="" || sn==" " || sn=="-" || sn=="_" || sn==".")
	{
		alert("Please enter the measurement set name!");
		return false;
	}
	return true;
}

function checkBodyDetails()
{
	var sn=document.frmBody.strSetName.value;
	if(sn=="" || sn==" " || sn=="-" || sn=="_" || sn==".")
	{
		alert("Please enter the measurement set name!");
		return false;
	}

	if(document.frmBody.strWeight.value>0 && document.frmBody.bWUnit.value=="true")
	{
		var ctrl=document.frmBody.optWeight;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Please select the unit of the weight!");
			return false;
		}
	}
	
	if(document.frmBody.strHeight.value>0 && document.frmBody.bHUnit.value=="true")
	{
		var ctrl=document.frmBody.optHeight;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Please select the unit of the height!");
			return false;
		}
	}
	
	if(document.frmBody.bSkill.value=="true")
	{
		var ctrl=document.frmBody.optSkill;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Please select the measurement skill!");
			return false;
		}
	}
	
	if(document.frmBody.bFit.value=="true")
	{
		var ctrl=document.frmBody.optFit;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Please select the fit type!");
			return false;
		}
	}
	
	if(document.frmBody.bTrouser.value=="true")
	{
		var ctrl=document.frmBody.optTrouser;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Please select the trouser fit type!");
			return false;
		}
	}
	return true;
}

function checkMeasurement()
{
	if(document.frmSet.bMUnit.value=="true")
	{
		var ctrl=document.frmSet.optMeasUnit;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Please select the measurement unit!");
			return false;
		}
	}
	return true;
}

function checkMeasurementGerman()
{
	if(document.frmData.bMUnit.value=="true")
	{
		var ctrl=document.frmData.optMeasUnit;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Please select the measurement unit!");
			return false;
		}
	}
	return true;
}

function checkWizardStep1()
{
	var ctrl=document.frmData.optGarmentType;
	var ctrl2=document.frmData.optAccType;
	var cnt=document.frmData.intRecCount.value/1;
	var cnt2=document.frmData.intAccCount.value/1;
	var i=0;
	var id=0;

	if(cnt>0)
	{
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
	}
	
	if(cnt2>0)
	{
		for(i=0; i<ctrl2.length; i++)
		{
			if(ctrl2[i].checked==true)
			{
				id=ctrl2[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl2.checked==true)
			{
				id=ctrl2.value;
			}
		}
	}

	if(id==0)
	{
		alert("What would you like to order?");
		return false;
	}
	return true;
}

function checkGermanWizardStep1()
{
	var ctrl=document.frmData.optGarmentType;
	var i=0;
	var id=0;
	for(i=0; i<ctrl.length; i++)
	{
		if(ctrl[i].checked==true)
		{
			id=ctrl[i].value;
		}
	}
	if(id==0)
	{
		if(ctrl.checked==true)
		{
			id=ctrl.value;
		}
	}
	if(id==0)
	{
		alert("Bitte wählen Sie ein Model!");
		return false;
	}
	return true;
}

function checkWizardStep2()
{
	if((document.frmData.intRecCount.value/1)>0)
	{
		var ctrl=document.frmData.optFabric;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Please select a fabric!");
			return false;
		}
	}
	else
	{
		alert("Please select a fabric!");
		return false;
	}
	return true;
}

function checkGermanWizardStep2()
{
	if((document.frmData.intRecCount.value/1)>0)
	{
		var ctrl=document.frmData.optFabric;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Bitte wählen Sie einen Stoff!");
			return false;
		}
	}
	else
	{
		alert("Bitte wählen Sie einen Stoff!");
		return false;
	}
	return true;
}

function checkAddFabricToOrder()
{
	var ctrl=document.frmData.optFabric;
	var i=0;
	var id=0;
	for(i=0; i<ctrl.length; i++)
	{
		if(ctrl[i].checked==true)
		{
			id=ctrl[i].value;
		}
	}
	if(id==0)
	{
		if(ctrl.checked==true)
		{
			id=ctrl.value;
		}
	}
	if(id==0)
	{
		alert("Please select a fabric!");
		return false;
	}
	return true;
}

function checkShirtWizardStep3()
{
	var no=(document.frmData.intGroupCount.value/1)+1;
	var bk=document.frmData.isBack.value;
	if(bk=="false")
	{
		var bDone=true;
		var i=0;
		for(i=1; i<no; i++)
		{
			var para=document.frmData.myStyle;
			if(para[i].value=="0")
			{
				bDone=false;
			}
		}
	
		if(bDone==false)
		{
			alert("Please complete styles of your shirt!")
			return false;
		}
	}
	if(document.frmData.optMonogram[1].checked==true || document.frmData.optMonogram[2].checked==true)
	{
		if(document.frmData.strMonogramText.value=="" || document.frmData.strMonogramText.value==" " || document.frmData.strMonogramText.value=="." || document.frmData.strMonogramText.value=="-" || document.frmData.strMonogramText.value=="_")
		{
			alert("Please enter the text for monogram!");
			return false;
		}
	}
	return true;
}

function checkGermanShirtWizardStep3()
{
	var no=(document.frmData.intGroupCount.value/1)+1;
	var bk=document.frmData.isBack.value;
	if(bk=="false")
	{
		var bDone=true;
		var i=0;
		for(i=1; i<no; i++)
		{
			var para=document.frmData.myStyle;
			if(para[i].value=="0")
			{
				bDone=false;
			}
		}
	
		if(bDone==false)
		{
			alert("Please complete styles of your shirt!")
			return false;
		}
	}
	if(document.frmData.optMonogram[1].checked==true || document.frmData.optMonogram[2].checked==true)
	{
		if(document.frmData.strMonogramText.value=="" || document.frmData.strMonogramText.value==" " || document.frmData.strMonogramText.value=="." || document.frmData.strMonogramText.value=="-" || document.frmData.strMonogramText.value=="_")
		{
			alert("Please enter the text for monogram!");
			return false;
		}
	}
	return true;
}

function checkWizardStep3()
{
	if((document.frmData.intRecCount.value/1)>0)
	{
		var ctrl=document.frmData.optStyle;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Please select a style!");
			return false;
		}
	}
	else
	{
		alert("Please specify style!");
		return false;
	}
	return true;
}

function checkAddStyleToOrder()
{
	var ctrl=document.frmData.optStyle;
	var i=0;
	var id=0;
	for(i=0; i<ctrl.length; i++)
	{
		if(ctrl[i].checked==true)
		{
			id=ctrl[i].value;
		}
	}
	if(id==0)
	{
		if(ctrl.checked==true)
		{
			id=ctrl.value;
		}
	}
	if(id==0)
	{
		alert("Please select a style!");
		return false;
	}
	return true;
}

function checkIndividualStyle(txt)
{
	if((document.frmData.intRecCount.value/1)>0)
	{
		var ctrl=document.frmData.optStyle;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Please select a "+txt+" style!");
			return false;
		}
	}
	else
	{
		alert("Please select a "+txt+" style!");
		return false;
	}
	return true;
}

function checkShirtWizardStep4(csNum)
{
	var nm=document.frmData.strSetName.value;
	var id=0;
	if(document.frmData.bSetExists.value=="true")
	{
		var ctrl=document.frmData.optSet;
		var i=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
	}
	
	if((id==0) && (nm=="" || nm==" " || nm=="." || nm=="-" || nm=="_"))
	{
		alert("Please select a measurement set or add a new set!");
		return false;
	}
	if(id==0)
	{
		var sn=document.frmData.strSetName.value;
		if(sn=="" || sn==" " || sn=="-" || sn=="_" || sn==".")
		{
			alert("Please enter the measurement set name!");
			return false;
		}
	
		if(document.frmData.strWeight.value>0 && document.frmData.bWUnit.value=="true")
		{
			var ctrl=document.frmData.optWeight;
			var i=0;
			var id=0;
			for(i=0; i<ctrl.length; i++)
			{
				if(ctrl[i].checked==true)
				{
					id=ctrl[i].value;
				}
			}
			if(id==0)
			{
				if(ctrl.checked==true)
				{
					id=ctrl.value;
				}
			}
			if(id==0)
			{
				alert("Please select the unit of the weight!");
				return false;
			}
		}
		
		if(document.frmData.strHeight.value>0 && document.frmData.bHUnit.value=="true")
		{
			var ctrl=document.frmData.optHeight;
			var i=0;
			var id=0;
			for(i=0; i<ctrl.length; i++)
			{
				if(ctrl[i].checked==true)
				{
					id=ctrl[i].value;
				}
			}
			if(id==0)
			{
				if(ctrl.checked==true)
				{
					id=ctrl.value;
				}
			}
			if(id==0)
			{
				alert("Please select the unit of the height!");
				return false;
			}
		}
		
		if(document.frmData.bSkill.value=="true")
		{
			var ctrl=document.frmData.optSkill;
			var i=0;
			var id=0;
			for(i=0; i<ctrl.length; i++)
			{
				if(ctrl[i].checked==true)
				{
					id=ctrl[i].value;
				}
			}
			if(id==0)
			{
				if(ctrl.checked==true)
				{
					id=ctrl.value;
				}
			}
			if(id==0)
			{
				alert("Please select the measurement skill!");
				return false;
			}
		}
		
		if(document.frmData.bFit.value=="true")
		{
			var ctrl=document.frmData.optFit;
			var i=0;
			var id=0;
			for(i=0; i<ctrl.length; i++)
			{
				if(ctrl[i].checked==true)
				{
					id=ctrl[i].value;
				}
			}
			if(id==0)
			{
				if(ctrl.checked==true)
				{
					id=ctrl.value;
				}
			}
			if(id==0)
			{
				alert("Please select the fit type!");
				return false;
			}
		}
	
		if(document.frmData.bTrouser.value=="true")
		{
			var ctrl=document.frmData.optTrouser;
			var i=0;
			var id=0;
			for(i=0; i<ctrl.length; i++)
			{
				if(ctrl[i].checked==true)
				{
					id=ctrl[i].value;
				}
			}
			if(id==0)
			{
				if(ctrl.checked==true)
				{
					id=ctrl.value;
				}
			}
			if(id==0)
			{
				alert("Please select the trouser fit type!");
				return false;
			}
		}

		if(document.frmData.bMUnit.value=="true")
		{
			var ctrl=document.frmData.optMeasUnit;
			var i=0;
			var id=0;
			for(i=0; i<ctrl.length; i++)
			{
				if(ctrl[i].checked==true)
				{
					id=ctrl[i].value;
				}
			}
			if(id==0)
			{
				if(ctrl.checked==true)
				{
					id=ctrl.value;
				}
			}
			if(id==0)
			{
				alert("Please select the measurement unit in the Measurements part!");
				return false;
			}
		}
		
		var ctrl=document.frmData.strAmount;
		var i=0;
		var bFound=false;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].value=="" || ctrl[i].value==" " || ctrl[i].value=="." || ctrl[i].value=="_" || ctrl[i].value=="-")
			{
				bFound=true;
			}
		}
		if(bFound==false)
		{
			if(ctrl.value=="" || ctrl.value==" " || ctrl.value=="." || ctrl.value=="_" || ctrl.value=="-")
			{
				bFound=true;
			}
		}
		if(bFound==true)
		{
			alert("Please finish enter the Measurements for all the parts!");
			return false;
		}
	}
	
	if(id!=0)
	{
		var str=new String;
		str=id;
		var cs=str.substr(0,1);
		if(cs=="i")
		{
			if(csNum==1)
			{
				alert("Please complete measurements for the selected set by click on the [update] link!")
				return false;
			}
			else
			{
				alert("Bitte klicken Sie auf Update und vervollstaendigen Sie Ihren Maßsatz!")
				return false;
			}
		}
	}
	return true;
}

function checkCartCheckout()
{
	if(document.frmData.bShippingMet.value=="true")
	{
		var ctrl=document.frmData.optShipping;
		var i=0;
		var chk="";
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				chk=ctrl[i].value;
			}
		}
		if(chk=="")
		{
			if(ctrl.checked==true)
			{
				chk=ctrl.value;
			}
		}
		if(chk=="")
		{
			alert("Please select a shipping method!");
			return false;
		}
	}
	
	if (document.frmData.strFinalComment.value.length > 1024)
	{
		  alert("The length of the final comments for this order  must be lesser than 1024 characters!");
		  return false;
	}
	if(document.frmData.bPaymentMet.value=="true")
	{
		if(document.frmData.lngPaymentId.value=="0")
		{
			alert("Please select a payment method!");
			return false;
		}
	}
	return true;
}

function checkSuitWizardStep3()
{
	var ctrl=document.frmData.optStyle;
	var i=0;
	var chk="";
	for(i=0; i<ctrl.length; i++)
	{
		if(ctrl[i].checked==true)
		{
			chk=ctrl[i].value;
		}
	}
	if(chk=="")
	{
		if(ctrl.checked==true)
		{
			chk=ctrl.value;
		}
	}
	if(chk=="")
	{
		alert("Please select a suit jacket style!");
		return false;
	}
	if(document.frmData.optMonogram[1].checked==true || document.frmData.optMonogram[2].checked==true)
	{
		if(document.frmData.strMonogramText.value=="" || document.frmData.strMonogramText.value==" " || document.frmData.strMonogramText.value=="." || document.frmData.strMonogramText.value=="-" || document.frmData.strMonogramText.value=="_")
		{
			alert("Please enter the text for monogram!");
			return false;
		}
	}
	if(document.frmData.optLining[0].checked==false && document.frmData.optLining[1].checked==false)
	{
		alert("Please select the lining type!");
		return false;
	}
	else
	{
		if(document.frmData.optLining[1].checked==true)
		{
			if(document.frmData.strLiningColour.value=="" || document.frmData.strLiningColour.value==" " || document.frmData.strLiningColour.value=="." || document.frmData.strLiningColour.value=="-" || document.frmData.strLiningColour.value=="_")
			{
				alert("Please specify the colour of lining!");
				return false;
			}
		}
	}

	return true;
}

function checkGermanSuitWizardStep3()
{
	var ctrl=document.frmData.optStyle;
	var i=0;
	var chk="";
	for(i=0; i<ctrl.length; i++)
	{
		if(ctrl[i].checked==true)
		{
			chk=ctrl[i].value;
		}
	}
	if(chk=="")
	{
		if(ctrl.checked==true)
		{
			chk=ctrl.value;
		}
	}
	if(chk=="")
	{
		alert("Bitte wählen Sie ein Anzugmodel!");
		return false;
	}
	if(document.frmData.optMonogram[1].checked==true || document.frmData.optMonogram[2].checked==true)
	{
		if(document.frmData.strMonogramText.value=="" || document.frmData.strMonogramText.value==" " || document.frmData.strMonogramText.value=="." || document.frmData.strMonogramText.value=="-" || document.frmData.strMonogramText.value=="_")
		{
			alert("Bitte geben Sie den Text für das Monogram an!");
			return false;
		}
	}
	if(document.frmData.optLining[0].checked==false && document.frmData.optLining[1].checked==false)
	{
		alert("Bitte wählen Sie die bevorzugte Verarbeitung Ihres Innenfutters!");
		return false;
	}
	else
	{
		if(document.frmData.optLining[1].checked==true)
		{
			if(document.frmData.strLiningColour.value=="" || document.frmData.strLiningColour.value==" " || document.frmData.strLiningColour.value=="." || document.frmData.strLiningColour.value=="-" || document.frmData.strLiningColour.value=="_")
			{
				alert("Bitte geben Sie eine Farbe für das Innenfutter an!");
				return false;
			}
		}
	}
	
	return true;
}

function checkSuitWizardStep4()
{
	if(document.frmData.optWant[0].checked==false && document.frmData.optWant[1].checked==false)
	{
		alert("Would you like waistcoat with your suit?");
		return false;
	}
	if(document.frmData.optWant[0].checked==true)
	{
		var ctrl=document.frmData.optVest;
		var i=0;
		var chk="";
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				chk=ctrl[i].value;
			}
		}
		if(chk=="")
		{
			if(ctrl.checked==true)
			{
				chk=ctrl.value;
			}
		}
		if(chk=="")
		{
			alert("Please select a waistcoat style!");
			return false;
		}
		
		if(document.frmData.optLining[0].checked==false && document.frmData.optLining[1].checked==false)
		{
			alert("Please select a lining type!");
			return false;
		}
		else
		{
			if(document.frmData.optLining[1].checked==true)
			{
				if(document.frmData.strLiningColour.value=="" || document.frmData.strLiningColour.value==" " || document.frmData.strLiningColour.value=="." || document.frmData.strLiningColour.value=="-" || document.frmData.strLiningColour.value=="_")
				{
					alert("Please specify the colour of lining!");
					return false;
				}
			}
		}
	}
	return true;
}

function checkGermanSuitWizardStep4()
{
	if(document.frmData.optWant[0].checked==false && document.frmData.optWant[1].checked==false)
	{
		alert("Möchten Sie eine Weste zu Ihrem Anzug?");
		return false;
	}
	if(document.frmData.optWant[0].checked==true)
	{
		var ctrl=document.frmData.optVest;
		var i=0;
		var chk="";
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				chk=ctrl[i].value;
			}
		}
		if(chk=="")
		{
			if(ctrl.checked==true)
			{
				chk=ctrl.value;
			}
		}
		if(chk=="")
		{
			alert("Bitte wählen Sie eine Weste!");
			return false;
		}
		
		if(document.frmData.optLining[0].checked==false && document.frmData.optLining[1].checked==false)
		{
			alert("Bitte geben Sie an wie Sie das Innenfutter wünschen!");
			return false;
		}
		else
		{
			if(document.frmData.optLining[1].checked==true)
			{
				if(document.frmData.strLiningColour.value=="" || document.frmData.strLiningColour.value==" " || document.frmData.strLiningColour.value=="." || document.frmData.strLiningColour.value=="-" || document.frmData.strLiningColour.value=="_")
				{
					alert("Bitte geben Sie eine Farbe für das Innenfutter an!");
					return false;
				}
			}
		}
	}
	return true;
}

function checkSuitWizardStep5()
{
	if(document.frmData.chkSuspender[0].checked==false && document.frmData.chkSuspender[1].checked==false)
	{
		alert("Would you like a suspender buttons?");
		return false;
	}
	if(document.frmData.chkBeltLoops[0].checked==false && document.frmData.chkBeltLoops[1].checked==false)
	{
		alert("Would you like a belt loops?");
		return false;
	}
	if(document.frmData.chkFrontClosure[0].checked==false && document.frmData.chkFrontClosure[1].checked==false && document.frmData.chkFrontClosure[2].checked==false && document.frmData.chkFrontClosure[3].checked==false)
	{
		alert("Please select a front closure type!");
		return false;
	}
	if(document.frmData.chkPantLining[0].checked==false && document.frmData.chkPantLining[1].checked==false && document.frmData.chkPantLining[2].checked==false)
	{
		alert("Please select a pant lining type!");
		return false;
	}
	return true;
}

function checkGermanSuitWizardStep5()
{
	if(document.frmData.chkSuspender[0].checked==false && document.frmData.chkSuspender[1].checked==false)
	{
		alert("Möchten Sie extra Knöpfe für Hosenträger?");
		return false;
	}
	if(document.frmData.chkBeltLoops[0].checked==false && document.frmData.chkBeltLoops[1].checked==false)
	{
		alert("Möchten Sie Gürtelschlaufen?");
		return false;
	}
	if(document.frmData.chkFrontClosure[0].checked==false && document.frmData.chkFrontClosure[1].checked==false && document.frmData.chkFrontClosure[2].checked==false && document.frmData.chkFrontClosure[3].checked==false)
	{
		alert("Bitte wählen Sie Ihre bevorzugte Hosenverschlußart!");
		return false;
	}
	if(document.frmData.chkPantLining[0].checked==false && document.frmData.chkPantLining[1].checked==false && document.frmData.chkPantLining[2].checked==false)
	{
		alert("Bitte wählen Sie Ihre bevorzugte Fütterung der Hose!");
		return false;
	}
	return true;
}

function checkOvercoatWizardStep3()
{
	var ctrl=document.frmData.optStyle;
	var i=0;
	var chk="";
	for(i=0; i<ctrl.length; i++)
	{
		if(ctrl[i].checked==true)
		{
			chk=ctrl[i].value;
		}
	}
	if(chk=="")
	{
		if(ctrl.checked==true)
		{
			chk=ctrl.value;
		}
	}
	if(chk=="")
	{
		alert("Please select an overcoat style!");
		return false;
	}
	if(document.frmData.optLengthType[0].checked==false && document.frmData.optLengthType[1].checked==false)
	{
		alert("What overcoat length would you prefer?");
		return false;
	}
	if(document.frmData.optMonogram[1].checked==true || document.frmData.optMonogram[2].checked==true)
	{
		if(document.frmData.strMonogramText.value=="" || document.frmData.strMonogramText.value==" " || document.frmData.strMonogramText.value=="." || document.frmData.strMonogramText.value=="-" || document.frmData.strMonogramText.value=="_")
		{
			alert("Please enter the text for monogram!");
			return false;
		}
	}
	if(document.frmData.optLining[0].checked==false && document.frmData.optLining[1].checked==false)
	{
		alert("Please select a lining type!");
		return false;
	}
	else
	{
		if(document.frmData.optLining[1].checked==true)
		{
			if(document.frmData.strLiningColour.value=="" || document.frmData.strLiningColour.value==" " || document.frmData.strLiningColour.value=="." || document.frmData.strLiningColour.value=="-" || document.frmData.strLiningColour.value=="_")
			{
				alert("Please specify the colour of lining!");
				return false;
			}
		}
	}
	
	return true;
}

function checkGermanOvercoatWizardStep3()
{
	var ctrl=document.frmData.optStyle;
	var i=0;
	var chk="";
	for(i=0; i<ctrl.length; i++)
	{
		if(ctrl[i].checked==true)
		{
			chk=ctrl[i].value;
		}
	}
	if(chk=="")
	{
		if(ctrl.checked==true)
		{
			chk=ctrl.value;
		}
	}
	if(chk=="")
	{
		alert("Bitte wählen Sie einen Mantelschnitt!");
		return false;
	}
	if(document.frmData.optMonogram[1].checked==true || document.frmData.optMonogram[2].checked==true)
	{
		if(document.frmData.strMonogramText.value=="" || document.frmData.strMonogramText.value==" " || document.frmData.strMonogramText.value=="." || document.frmData.strMonogramText.value=="-" || document.frmData.strMonogramText.value=="_")
		{
			alert("Bitte geben Sie den Text für das Monogram an!");
			return false;
		}
	}
	if(document.frmData.optLining[0].checked==false && document.frmData.optLining[1].checked==false)
	{
		alert("Bitte geben Sie an wie Sie das Innenfutter wünschen!");
		return false;
	}
	else
	{
		if(document.frmData.optLining[1].checked==true)
		{
			if(document.frmData.strLiningColour.value=="" || document.frmData.strLiningColour.value==" " || document.frmData.strLiningColour.value=="." || document.frmData.strLiningColour.value=="-" || document.frmData.strLiningColour.value=="_")
			{
				alert("Bitte geben Sie eine Farbe für das Innenfutter an!");
				return false;
			}
		}
	}

	return true;
}

function checkItemAmount(num)
{
	var txt=document.frmData.strGarmentType.value;
	if(num==1)
	{
		if (document.frmData.strQty.value==0)
		{
			  alert("How many "+txt+" of this style with this fabric would you like to order?");
			  return false;
		}
		if (document.frmData.strItemComment.value.length > 1024)
		{
			  alert("The length of the comments for this item  must be lesser than 1024 characters!");
			  return false;
		}
	}
	else
	{
		if (document.frmData.strQty.value==0)
		{
			  alert("How many "+txt+" would you like to order?");
			  return false;
		}
	}
	return true;
}

function checkGermanItemAmount()
{
	var txt=document.frmData.strGarmentType.value;
	var msg="";
	if(txt.toUpperCase()=="SHIRTS")
	{
		msg="Wieviel Hemden in dem soeben gewählen Style und Stoff möchten Sie gern bestellen?";
	}
	else if(txt.toUpperCase()=="SUITS")
	{
		msg="Wieviel Anzüge in dem soeben gewählen Style und Stoff möchten Sie gern bestellen?";
	}
	else if(txt.toUpperCase()=="OVERCOATS")
	{
		msg="Wieviel Mäntel in dem soeben gewählen Style und Stoff möchten Sie gern bestellen?";
	}

	if (document.frmData.strQty.value==0)
	{
		  alert(msg);
		  return false;
	}
	if (document.frmData.strItemComment.value.length > 1024)
	{
		  alert("Bitte nicht mehr als 1024 Buchstaben angeben!");
		  return false;
	}
	return true;
}

function checkUpdMainMeasurement()
{
	if(document.frmData.bMUnit.value=="true")
	{
		var ctrl=document.frmData.optMeasUnit;
		var i=0;
		var id=0;
		for(i=0; i<ctrl.length; i++)
		{
			if(ctrl[i].checked==true)
			{
				id=ctrl[i].value;
			}
		}
		if(id==0)
		{
			if(ctrl.checked==true)
			{
				id=ctrl.value;
			}
		}
		if(id==0)
		{
			alert("Please select the measurement unit in the Measurements part!");
			return false;
		}
	}
	
	var ctrl=document.frmData.strAmount;
	var i=0;
	var bFound=false;
	for(i=0; i<ctrl.length; i++)
	{
		if(ctrl[i].value=="" || ctrl[i].value==" " || ctrl[i].value=="." || ctrl[i].value=="_" || ctrl[i].value=="-")
		{
			bFound=true;
		}
	}
	if(bFound==false)
	{
		if(ctrl.value=="" || ctrl.value==" " || ctrl.value=="." || ctrl.value=="_" || ctrl.value=="-")
		{
			bFound=true;
		}
	}
	if(bFound==true)
	{
		alert("Please finish enter the Measurements for all the parts!");
		return false;
	}
	return true;
}

function checkUploadFrontPic()
{
	var f=document.frmFront.fileFront.value;
	if(f=="" || f==" " || f=="." || f=="-" || f=="/" || f=="_")
	{
		alert("There is no picture to upload!");
		return false;
	}
	else
	{
		var str=new String(document.frmFront.fileFront.value.toUpperCase());
		var n=str.length;
		var i=n-1;
		var ext="";
		var h="";
		while((h!=".")&&(i>=0)&&(n!=0))
		  {
		h = str.substr(i,1);
		i--;
		  }
		  ext=str.substr(i+2,3);
		  ext2=str.substr(i+2,4);
		  if((ext!="JPG")&&(n!=0)&&(ext!="GIF")&&(ext2!="JPEG"))
		  {
			alert("Sorry, the picture file must be in jpg or gif format!");
			return false;
		  }
	 }
	return true;	
}

function checkUploadBackPic()
{
	var f=document.frmBack.fileBack.value;
	if(f=="" || f==" " || f=="." || f=="-" || f=="/" || f=="_")
	{
		alert("There is no picture to upload!");
		return false;
	}
	else
	{
		var str=new String(document.frmBack.fileBack.value.toUpperCase());
		var n=str.length;
		var i=n-1;
		var ext="";
		var h="";
		while((h!=".")&&(i>=0)&&(n!=0))
		  {
		h = str.substr(i,1);
		i--;
		  }
		  ext=str.substr(i+2,3);
		  ext2=str.substr(i+2,4);
		  if((ext!="JPG")&&(n!=0)&&(ext!="GIF")&&(ext2!="JPEG"))
		  {
			alert("Sorry, the picture file must be in jpg or gif format!");
			return false;
		  }
	 }
	return true;	
}

function checkUploadSidePic()
{
	var f=document.frmSide.fileSide.value;
	if(f=="" || f==" " || f=="." || f=="-" || f=="/" || f=="_")
	{
		alert("There is no picture to upload!");
		return false;
	}
	else
	{
		var str=new String(document.frmSide.fileSide.value.toUpperCase());
		var n=str.length;
		var i=n-1;
		var ext="";
		var h="";
		while((h!=".")&&(i>=0)&&(n!=0))
		  {
		h = str.substr(i,1);
		i--;
		  }
		  ext=str.substr(i+2,3);
		  ext2=str.substr(i+2,4);
		  if((ext!="JPG")&&(n!=0)&&(ext!="GIF")&&(ext2!="JPEG"))
		  {
			alert("Sorry, the picture file must be in jpg or gif format!");
			return false;
		  }
	 }
	return true;	
}

function showFlash()
{
	GP_AdvOpenWindow("garmentquality.asp","quality","fullscreen=no,toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no",520,445,"center","ignoreLink","",0,"");
}

function checkAccessoryStep2()
{
	var ctrl=document.frmData.optAccessory;
	var i=0;
	var chk="";
	for(i=0; i<ctrl.length; i++)
	{
		if(ctrl[i].checked==true)
		{
			chk=ctrl[i].value;
		}
	}
	if(chk=="")
	{
		if(ctrl.checked==true)
		{
			chk=ctrl.value;
		}
	}
	if(chk=="")
	{
		alert("Please select an item!");
		return false;
	}
	return true;
}

function checkSuitJacketStep3()
{
	var ctrl=document.frmData.optStyle;
	var i=0;
	var chk="";
	for(i=0; i<ctrl.length; i++)
	{
		if(ctrl[i].checked==true)
		{
			chk=ctrl[i].value;
		}
	}
	if(chk=="")
	{
		if(ctrl.checked==true)
		{
			chk=ctrl.value;
		}
	}
	if(chk=="")
	{
		alert("Please select a jacket style!");
		return false;
	}
	if(document.frmData.optMonogram[1].checked==true || document.frmData.optMonogram[2].checked==true)
	{
		if(document.frmData.strMonogramText.value=="" || document.frmData.strMonogramText.value==" " || document.frmData.strMonogramText.value=="." || document.frmData.strMonogramText.value=="-" || document.frmData.strMonogramText.value=="_")
		{
			alert("Please enter the text for monogram!");
			return false;
		}
	}
	if(document.frmData.optLining[0].checked==false && document.frmData.optLining[1].checked==false)
	{
		alert("Please select the lining type!");
		return false;
	}
	else
	{
		if(document.frmData.optLining[1].checked==true)
		{
			if(document.frmData.strLiningColour.value=="" || document.frmData.strLiningColour.value==" " || document.frmData.strLiningColour.value=="." || document.frmData.strLiningColour.value=="-" || document.frmData.strLiningColour.value=="_")
			{
				alert("Please specify the colour of lining!");
				return false;
			}
		}
	}

	return true;
}

function checkAgentSignIn()
{
	var un=document.frmData.strUserName.value;
	if(un=="" || un==" ")
	{
		alert("Please enter your login name!");
		return false;
	}
	if(document.frmData.strPassword.value=="")
	{
		alert("Please enter your password!");
		return false;
	}
	return true;
}

function checkAgentPayment()
{
	var ref=document.frmData.strRefNo.value;
	if(ref=="" || ref==" " || ref=="-" || ref=="_" || ref==".")
	{
		alert("Please enter the Payment Reference Number!");
		return false;
	}
	if(document.frmData.strAmount.value==0)
	{
		alert("Please enter the Amount Payment!");
		return false;
	}
	return true;
}


