function ValidateEmb(form) {
	embtxt1=document.getElementById('TabStrip1_txtEmbLine1').value;
	embtxt2=document.getElementById('TabStrip1_txtEmbLine2').value;
    embtxt3=document.getElementById('TabStrip1_txtEmbLine3').value;
    embfont=document.getElementById('TabStrip1_ddlFontName').value;
    embcolor=document.getElementById('TabStrip1_ddlThreadColor').value;
    emblocation=document.getElementById('TabStrip1_ddlFontLocation').value;
    embfont2=document.getElementById('TabStrip1_ddlFontName2').value;
    embcolor2=document.getElementById('TabStrip1_ddlThreadColor2').value;
    emblocation2=document.getElementById('TabStrip1_ddlFontLocation2').value;
    embfont3=document.getElementById('TabStrip1_ddlFontName3').value;
    embcolor3=document.getElementById('TabStrip1_ddlThreadColor3').value;
    emblocation3=document.getElementById('TabStrip1_ddlFontLocation3').value;
    logostyle=document.getElementById('TabStrip1_ddlLogo').value;
    //logocolor=document.getElementById('TabStrip1_ddlLogoThreadColor').value;
    logolocation=document.getElementById('TabStrip1_ddlLogoLocation').value;
    logostyle2=document.getElementById('TabStrip1_ddlLogo2').value;
    //logocolor2=document.getElementById('TabStrip1_ddlLogoThreadColor2').value;
    logolocation2=document.getElementById('TabStrip1_ddlLogoLocation2').value;

//if (embtxt1=='' && embtxt2=='' && embtxt3=='' && embcolor=='' && embfont=='' && emblocation=='' && logostyle=='' && logocolor=='' && logolocation=='') {
//alert("Please make selection first");
//return false;
//}
Color=document.getElementById('TabStrip1_ddlColor');
if (Color != null)
{
    if (Color.value=='' || Color.value =='0')
    {   
         alert("Please Select Color");
         document.getElementById('TabStrip1_ddlColor').focus(); 
         return false;
    }
}
Size=document.getElementById('TabStrip1_ddlSize');
if (Size != null)
{
    if (Size.value=='' || Size.value=='0')
    {   
         alert("Please Select Size");
         document.getElementById('TabStrip1_ddlSize').focus(); 
         return false;
    }
}
Qty=document.getElementById('txtQty').value;
if (Qty=='' || Qty =='0')
{   
     alert("Please Enter Quantity");
     document.getElementById("txtQty").value='';
     document.getElementById('txtQty').focus(); 
     return false;
}
if (isInteger(document.getElementById("txtQty").value)== false)
{
	alert("Please Enter Only Digits in Quantity");
	document.getElementById("txtQty").value='';
	document.getElementById("txtQty").focus();
	return false;
}
    
 if (embtxt1=='' && embcolor !='0') {
  alert("First Line is Necessary for Emb");
//TabStrip1.SelectTabById('zero');
  PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
  document.getElementById('TabStrip1_txtEmbLine1').focus(); 
  document.getElementById('TabStrip1_txtEmbLine2').value=""
  document.getElementById('TabStrip1_txtEmbLine3').value=""
  return false;
  }
   
 if (embtxt1=='' && emblocation !='0') {
  alert("First Line is Necessary for Emb1");
 //TabStrip1.SelectTabById('zero');
 PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
  document.getElementById('TabStrip1_txtEmbLine1').focus(); 
  document.getElementById('TabStrip1_txtEmbLine2').value=""
  document.getElementById('TabStrip1_txtEmbLine3').value=""
   return false;
   }
if (embtxt1 != '' && embfont =='0') {
       alert("Select Font First");
       //TabStrip1.SelectTabById('zero');
       PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
		document.getElementById('TabStrip1_ddlFontName').focus();      
   		return false;
       }
       
       
 if (embtxt1 != '' && embcolor =='0') {
       alert("Select Color"); 
       //TabStrip1.SelectTabById('zero');
       PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
       document.getElementById('TabStrip1_ddlThreadColor').focus();
         return false;
       }
       
 if (embtxt1 != '' && emblocation =='0') {
 alert("Select Location");
 //TabStrip1.SelectTabById('zero');
 PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
     document.getElementById('TabStrip1_ddlFontLocation').focus();
     return false;
       }

 if (embtxt1=='' && embfont !='0') {
		alert("First Line is Necessary for Emb");
		//TabStrip1.SelectTabById('zero');
		PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
		document.getElementById('TabStrip1_txtEmbLine1').focus(); 
		document.getElementById('TabStrip1_txtEmbLine2').value=""
		document.getElementById('TabStrip1_txtEmbLine3').value=""
  		 return false;
   		}
   
if (embtxt1=='' && embtxt2 !='') {
	alert("First Line is Necessary for Emb");
	//TabStrip1.SelectTabById('zero');
	PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
  document.getElementById('TabStrip1_txtEmbLine1').focus(); 
  document.getElementById('TabStrip1_txtEmbLine2').value=""
  document.getElementById('TabStrip1_txtEmbLine3').value=""
	return false;
   }
   
if (embtxt1=='' && embtxt3 !='') {
 alert("First Line is Necessary for Emb");
 //TabStrip1.SelectTabById('zero');
 PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
  document.getElementById('TabStrip1_txtEmbLine1').focus(); 
  document.getElementById('TabStrip1_txtEmbLine2').value=""
  document.getElementById('TabStrip1_txtEmbLine3').value=""
return false;
}

if (embtxt1 !='' && embtxt3 !='' && embtxt2 =='') {
  alert("Enter 2nd Line");
  //TabStrip1.SelectTabById('zero');
  PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
  document.getElementById('TabStrip1_txtEmbLine2').focus();
  document.getElementById('TabStrip1_txtEmbLine3').value=""
  return false;
  }

  
  //For Emb 2

 if (embtxt2=='' && embcolor2 !='0') {
  alert("Second Line is Necessary for Emb");
  //TabStrip1.SelectTabById('zero');
  PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
  document.getElementById('TabStrip1_txtEmbLine2').focus();
  document.getElementById('TabStrip1_txtEmbLine2').value='';
  document.getElementById('TabStrip1_txtEmbLine3').value='';
  return false;
  }
   
 if (embtxt2=='' && emblocation2 !='0') {
  alert("Second Line is Necessary for Emb");
  //TabStrip1.SelectTabById('zero');
  PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
  document.getElementById('TabStrip1_txtEmbLine2').focus();
  document.getElementById('TabStrip1_txtEmbLine2').value='';
  document.getElementById('TabStrip1_txtEmbLine3').value='';
   return false;
   }
if (embtxt2 != '' && embfont2 =='0') {
       alert("Select Font First");
       //TabStrip1.SelectTabById('zero');
       PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
		document.getElementById('TabStrip1_ddlFontName2').focus();      
   		return false;
       }
       
       
 if (embtxt2 != '' && embcolor2 =='0') {
       alert("Select Color"); 
       //TabStrip1.SelectTabById('zero');
       PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
       document.getElementById('TabStrip1_ddlThreadColor2').focus();
         return false;
       }
 if (embtxt2 != '' && emblocation2 =='0') {
 alert("Select Location");
 //TabStrip1.SelectTabById('zero');
 PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
     document.getElementById('TabStrip1_ddlFontLocation2').focus();
     return false;
       }

 if (embtxt2=='' && embfont2 !='0') {
		alert("Second Line is Necessary for Emb");
		//TabStrip1.SelectTabById('zero');
		PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
		document.getElementById('TabStrip1_txtEmbLine2').focus();
  		document.getElementById('TabStrip1_txtEmbLine2').value='';
  		document.getElementById('TabStrip1_txtEmbLine3').value='';
  		 return false;
   		}
   


//FOR EMB 3
 if (embtxt3=='' && embcolor3 !='0') {
  alert("Third Line is Necessary for Emb");
  //TabStrip1.SelectTabById('zero');
  PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
  document.getElementById('TabStrip1_txtEmbLine3').focus();
  return false;
  }
   
 if (embtxt3=='' && emblocation3 !='0') {
  alert("Third Line is Necessary for Emb");
  //TabStrip1.SelectTabById('zero');
  PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
  document.getElementById('TabStrip1_txtEmbLine3').focus();
  return false;
   }
if (embtxt3 != '' && embfont3 =='0') {
       alert("Select Font First");
       //TabStrip1.SelectTabById('zero');
       PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
		document.getElementById('TabStrip1_ddlFontName3').focus();      
   		return false;
       }
       
       
 if (embtxt3 != '' && embcolor3 =='0') {
       alert("Select Color"); 
       //TabStrip1.SelectTabById('zero');
       PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
       document.getElementById('TabStrip1_ddlThreadColor3').focus();
         return false;
       }
 if (embtxt3 != '' && emblocation3 =='0') {
 alert("Select Location");
 //TabStrip1.SelectTabById('zero');
 PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
     document.getElementById('TabStrip1_ddlFontLocation3').focus();
     return false;
       }

 if (embtxt3=='' && embfont3 !='0') {
		alert("Third Line is Necessary for Emb");
		//TabStrip1.SelectTabById('zero');
		PageControl.SetActiveTab(PageControl.GetTabByName('Embroidery'));
		document.getElementById('TabStrip1_txtEmbLine3').focus();
        return false;
   		}
   		

		  //if (logostyle !='0' && logocolor =='0' ) {
		  //alert("Select Logo Color");
		  //TabStrip1.SelectTabById('one');
		  //PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		  //document.getElementById('TabStrip1_ddlLogoThreadColor').focus();
		  //return false;
		  // }
    
   
		  if (logostyle !='0' && logolocation =='0' ) {
		  alert("Select Logo Location");
		  //TabStrip1.SelectTabById('one');
		  
		  	  PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		  document.getElementById('TabStrip1_ddlLogoLocation').focus();
		  return false;
		   }
		   
 
		  //if (logocolor !='0' && logostyle =='0' ) {
		  //alert("Select Logo Style");
		  //TabStrip1.SelectTabById('one');
		  //  PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		  //document.getElementById('TabStrip1_ddlLogo').focus();
		 // return false;
		  // }

          //if (logocolor !='0' && logolocation =='0' ) {
		  //alert("Select Logo Location");
		  //TabStrip1.SelectTabById('one');
		  //  PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		  //document.getElementById('TabStrip1_ddlLogoLocation').focus();
		  //return false;
		  // }
		   
		  if (logolocation !='0' && logostyle =='0' ) {
		  alert("Select Logo Style");
		  //TabStrip1.SelectTabById('one');
		    PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		  document.getElementById('TabStrip1_ddlLogo').focus();
		  return false;
		   }

        //  if (logolocation !='0' && logocolor =='0' ) {
		//  alert("Select Logo Color");
		  //TabStrip1.SelectTabById('one');
		//    PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		//  document.getElementById('TabStrip1_ddlLogoThreadColor').focus();
		//  return false;
		//   }
		   

		   
		 //if (logostyle2 !='0' && logocolor2 =='0' ) {
		 // alert("Select Logo Color");
		  //TabStrip1.SelectTabById('one');
		 //   PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		 // document.getElementById('TabStrip1_ddlLogoThreadColor2').focus();
		 // return false;
		 //  }
    
   
		  if (logostyle2 !='0' && logolocation2 =='0' ) {
		  alert("Select Logo Location");
		  //TabStrip1.SelectTabById('one');
		    PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		  document.getElementById('TabStrip1_ddlLogoLocation2').focus();
		  return false;
		   }
		   
 
		  //if (logocolor2 !='0' && logostyle2 =='0' ) {
		 // alert("Select Logo Style");
		  //TabStrip1.SelectTabById('one');
		 //   PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		 // document.getElementById('TabStrip1_ddlLogo2').focus();
		 // return false;
		 //  }

         // if (logocolor2 !='0' && logolocation2 =='0' ) {
		 // alert("Select Logo Location");
		  //TabStrip1.SelectTabById('one');
		 //   PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		 // document.getElementById('TabStrip1_ddlLogoLocation2').focus();
		 // return false;
		 //  }
		   
		  if (logolocation2 !='0' && logostyle2 =='0' ) {
		  alert("Select Logo Style");
		  //TabStrip1.SelectTabById('one');
		    PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		  document.getElementById('TabStrip1_ddlLogo2').focus();
		  return false;
		   }

        //  if (logolocation2 !='0' && logocolor2 =='0' ) {
		//  alert("Select Logo Color");
		//  //TabStrip1.SelectTabById('one');
		//    PageControl.SetActiveTab(PageControl.GetTabByName('Logo'));
		//  document.getElementById('TabStrip1_ddlLogoThreadColor2').focus();
		//  return false;
		//   }
   		
    
}

function ClickDetails()
{
  PageControl.SetActiveTab(PageControl.GetTabByName('Overview'));
}
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9")))
        return false;
    }
    // All characters are numbers.
    return true;
}
