function CheckForm(ObjForm,mQty,iscolor,SizeAttribute,ISEmb)
{
if (iscolor == 1) 
{
if (ObjForm.color.value == 0) {
alert("Please Select Color");
myTabs.expandit(0);
//ObjForm.color.focus();
return false;
}
}

if (SizeAttribute == 'True') 
{
if (ObjForm.size.value == '0:0') {
alert("Please Select Size");
myTabs.expandit(0);
//ObjForm.size.focus();
return false;
}
}

if (ObjForm.qty.value == 0 || ObjForm.qty.value == '') {
alert("Please Enter Valid Quantity");
ObjForm.qty.value='';
//myTabs.expandit(0);
ObjForm.qty.focus();
return false;
}

if (ObjForm.qty.value > mQty) {
alert("This item is only available in " + mQty + " quantity(s)");
ObjForm.qty.value='1';
myTabs.expandit(0);
ObjForm.qty.focus();
return false;
}

if (isInteger(ObjForm.qty.value)== false)
		{
          alert("Please Enter Numeric Values");
			ObjForm.qty.value='';
			myTabs.expandit(0);
			ObjForm.qty.focus();
	    	return false;
		}
}



function CheckFormIn(ObjForm,mQty)
{
if (ObjForm.sizeoptions.value == 0) {
alert("Please Select Size Options");
ObjForm.sizeoptions.focus();
return false;
}

if (ObjForm.color.value == 0) {
alert("Please Select Color");
ObjForm.color.focus();
return false;
}

if (ObjForm.size.value == '0:0') {
alert("Please Select Size");
ObjForm.size.focus();
return false;
}


if (ObjForm.inseamid.value == '0:0') {
alert("Please Select Inseam");
ObjForm.inseamid.focus();
return false;
}


if (ObjForm.qty.value == 0 || ObjForm.qty.value == '' || ObjForm.qty.value > 1000) {
alert("Please Enter Valid Quantity");
ObjForm.qty.value='';
ObjForm.qty.focus();
return false;
}

if (isInteger(ObjForm.qty.value)== false)
		{
          alert("Please Enter Numeric Values");
			ObjForm.qty.value='';
			ObjForm.qty.focus();
	    	return false;
		}
		
}

function CalcPrice(IsEmb,IsSize)

{
Price=document.getElementById("Price").value

baseprice=parseFloat(Price.substring(1,Price.length));
//alert(Price.length);
var myqty=document.getElementById("txtQty").value;
//if (myqty>5 && myqty<11)
//{
//baseprice=baseprice-0.50;

//}

//if (myqty>10)
//{
//baseprice=baseprice-1;

//}
if (IsSize==1)
{
var sizevalue=document.getElementById('TabStrip1_ddlSize').value;
var mySplitSizePrice = sizevalue.split(":");
if (mySplitSizePrice[1]!=undefined)
{

sizeprice=parseInt(mySplitSizePrice[1]);
baseprice=baseprice+sizeprice;

}
}

if (IsEmb==1)
{
  var FreeEMB=document.getElementById('FreeEmb').value
  if (FreeEMB==1)
	{
	var embprice1='';
   	}
  else 
	{
    var embprice1=document.getElementById('TabStrip1_txtEmbLine1').value;
	}
	//var embprice1=document.getElementById('TabStrip1_txtEmbLine1').value;
    var embprice2=document.getElementById('TabStrip1_txtEmbLine2').value;    
    var embprice3=document.getElementById('TabStrip1_txtEmbLine3').value;
    
    if (embprice1!=undefined)
    {
    if (embprice1!='')
    {
   		baseprice=baseprice+3.99;
   	}
    }
    if (embprice2!=undefined)
    {
    if (embprice2!='')
    {
   		baseprice=baseprice+3.99;
   	}
    }   
    if (embprice3!=undefined)
    {
    if (embprice3!='')
    {
   		baseprice=baseprice+3.99;
   	}
    }  
   
	var logoprice= document.getElementById('TabStrip1_ddlLogo').value;
	
    if (logoprice!=undefined)
    {
       if (logoprice!=0)
    {
       		baseprice=baseprice+4.99;
   	}
    }	
   
   var logoprice2= document.getElementById('TabStrip1_ddlLogo2').value;
	
    if (logoprice2!=undefined)
    {
       if (logoprice2!=0)
    {
       		baseprice=baseprice+4.99;
   	}
    }	
   
}    
  //document.getElementById('spanshowprice').innerHTML='$'+Math.round(parseFloat(baseprice));
  var newnumber = Math.round(baseprice*Math.pow(10,2))/Math.pow(10,2);

if (myqty == 0 || myqty == '' || myqty > 1000)
{

}  
else
{
	if (isInteger(myqty)== true)
	{
	 
	  var itemtotal=newnumber*myqty
	  var myitemtotal = Math.round(itemtotal*Math.pow(10,2))/Math.pow(10,2);
	 document.getElementById('lblYourPrice').innerHTML='$'+myitemtotal;
	 
	 
}
  }
}

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;
}


function KeyPress() 
{
//alert(window.event.keyCode)
if (window.event.keyCode == 13){
window.event.keyCode =0;
}
}

function ShowSelectedColor()
{
var str=document.getElementById('color').value;
var mySplitResult = str.split(":");
if (mySplitResult[1]==undefined)
{
document.getElementById('selectedcolorcode').innerHTML='None';
}
else
{
document.getElementById('selectedcolorcode').innerHTML=mySplitResult[1];
}
selectedcolorpicture=new Image();
selectedcolorpicture.src="http://www.pulseuniform.com/ColorPicture/" + Left(document.getElementById('stylecode').value,2) + '-' + mySplitResult[1] + ".jpg";
document.images['yourselectedcolor'].src=selectedcolorpicture.src;
}



function ShowSelectedColorDefault(mycode)
{
var str=document.getElementById('color').value;
var mySplitResult = str.split(":");
if (mySplitResult[1]==undefined)
{
document.getElementById('selectedcolorcode').innerHTML='None';
}
else
{
document.getElementById('selectedcolorcode').innerHTML=mySplitResult[1];
}
selectedcolorpicture=new Image();
selectedcolorpicture.src="http://www.pulseuniform.com/ColorPicture/" + Left(mycode,2) + '-' + mySplitResult[1] + ".jpg";
document.images['yourselectedcolor'].src=selectedcolorpicture.src;
}


function SelectedColorOnComboSelect()
{
colorindex=document.shop1.color.selectedIndex;
colorindex='color'+colorindex;
document.getElementById(colorindex).click();
}


//function SelectedSize(sizeIndex,SizeName)
function SelectSize(index)
{
var size=document.getElementById('TabStrip1_ddlSize').options[index].text;
if (size != '--Select Size--') {
    size=size.split('(');
    size=size[0];
    size=size.toUpperCase();
    document.getElementById("txtSize").innerHTML=size.substring(0,4);
}
else {
    document.getElementById("txtSize").innerHTML= '';
}
//document.shop1.size.value=sizeIndex;
//document.getElementById('txtSize').innerHTML=SizeName;
}


function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}

function roll_over(img_name, img_src)
   {
   document[img_name].src = img_src;
   }						
									
									
function SelectTab(tab)
{
PageControl.SetActiveTab(PageControl.GetTabByName(tab));
return false;
}
