String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g,"");
}
String.prototype.ltrim = function() {                              
    return this.replace(/^\s+/,"");
}
String.prototype.rtrim = function() {
    return this.replace(/\s+$/,"");
}
function ltrim(str) { 
    for(var k = 0; k < str.length && isWhitespace(str.charAt(k)); k++);
    return str.substring(k, str.length);
}
function rtrim(str) {
    for(var j=str.length-1; j>=0 && isWhitespace(str.charAt(j)) ; j--) ;
    return str.substring(0,j+1);
}
function trim(str) {
    return ltrim(rtrim(str));
}
function isWhitespace(charToCheck) {
    var whitespaceChars = " \t\n\r\f";
    return (whitespaceChars.indexOf(charToCheck) != -1);
}

function update_cul1(str1)
{
   str1 = trim(str1);   
   var el = document.forms['cart_quantity'].elements;        
   if (str1=="CL01")  el['id[9]'].value = 11 ;
   if (str1=="CL103")  el['id[9]'].value = 13 ;
   if (str1=="CL105")  el['id[9]'].value = 14 ;
   if (str1=="CL12")  el['id[9]'].value = 15 ;
   if (str1=="CL23")  el['id[9]'].value = 16 ;
   if (str1=="CL41")  el['id[9]'].value = 18 ;
   if (str1=="CL42")  el['id[9]'].value = 19 ;
   if (str1=="CL97")  el['id[9]'].value = 21 ;
   if (str1=="CL98")  el['id[9]'].value = 22 ;
   if (str1=="CL99")  el['id[9]'].value = 23 ;
   if (str1=="CL40")  el['id[9]'].value = 17 ;
   if (str1=="CL46")  el['id[9]'].value = 20 ;
   if (str1=="CL08")  el['id[9]'].value = 12 ;

}

function update_cul2(str1)
{
   str1 = trim(str1);   
   var el = document.forms['cart_quantity'].elements;        
   if (str1=="CL01")  el['id[10]'].value = 11 ;
   if (str1=="CL103")  el['id[10]'].value = 13 ;
   if (str1=="CL105")  el['id[10]'].value = 14 ;
   if (str1=="CL12")  el['id[10]'].value = 15 ;
   if (str1=="CL23")  el['id[10]'].value = 16 ;
   if (str1=="CL41")  el['id[10]'].value = 18 ;
   if (str1=="CL42")  el['id[10]'].value = 19 ;
   if (str1=="CL97")  el['id[10]'].value = 21 ;
   if (str1=="CL98")  el['id[10]'].value = 22 ;
   if (str1=="CL99")  el['id[10]'].value = 23 ;
   if (str1=="CL40")  el['id[10]'].value = 17 ;
   if (str1=="CL46")  el['id[10]'].value = 20 ;
   if (str1=="CL08")  el['id[10]'].value = 12 ;

}


function update_cul3(str1)
{
   str1 = trim(str1);   
   var el = document.forms['cart_quantity'].elements;        
   if (str1=="CL01")  el['id[3]'].value = 11 ;
   if (str1=="CL103")  el['id[3]'].value = 13 ;
   if (str1=="CL105")  el['id[3]'].value = 14 ;
   if (str1=="CL12")  el['id[3]'].value = 15 ;
   if (str1=="CL23")  el['id[3]'].value = 16 ;
   if (str1=="CL41")  el['id[3]'].value = 18 ;
   if (str1=="CL42")  el['id[3]'].value = 19 ;
   if (str1=="CL97")  el['id[3]'].value = 21 ;
   if (str1=="CL98")  el['id[3]'].value = 22 ;
   if (str1=="CL99")  el['id[3]'].value = 23 ;
   if (str1=="CL40")  el['id[3]'].value = 17 ;
   if (str1=="CL46")  el['id[3]'].value = 20 ;
   if (str1=="CL08")  el['id[3]'].value = 12 ;

}


function update_cul4(str1)
{
   str1 = trim(str1);   
   var el = document.forms['cart_quantity'].elements;        
   if (str1=="CL01")  el['id[7]'].value = 11 ;
   if (str1=="CL103")  el['id[7]'].value = 13 ;
   if (str1=="CL12")  el['id[7]'].value = 15 ;   
   if (str1=="CL40")  el['id[7]'].value = 17 ;   
   if (str1=="CL98")  el['id[7]'].value = 22 ;    


}

function update_pipping(str1)
{
   str1 = trim(str1);   
   var el = document.forms['cart_quantity'].elements;  
   
   if (el['id[3]'].value!=42)
   el['id[3]'].value = 42;
   
   else if (el['id[3]'].value==42)   
   {
   if (str1=="CL01")  el['id[3]'].value = 11 ;    
   }

}


function update_logo(str1)
{
   str1 = trim(str1);   
   var el = document.forms['cart_quantity'].elements;  
   
   if (el['id[7]'].value!=42)
   el['id[7]'].value = 42;
   
   else if (el['id[7]'].value==42)   
   {
   if (str1=="CL01")  el['id[7]'].value = 11 ;    
   }

}

function update_perf(str1)

{
 var el = document.forms['cart_quantity'].elements;  
 
 if ( (el['id[11]'].value==42) || (el['id[11]'].value==38)  )  
 el['id[11]'].value = 37;
 else 
 el['id[11]'].value = 38; 

}


function update_custom_st()

{
 var el = document.forms['cart_quantity'].elements;  
 
 if ( (el['id[12]'].value==42) || (el['id[12]'].value==38)  )  
 el['id[12]'].value = 37;
 else 
 el['id[12]'].value = 38; 

}


function update_type(str1)

{
   str1 = trim(str1);   
   var el = document.forms['cart_quantity'].elements;        
   if (str1=="ONE TONE")  el['id[13]'].value = 44 ;
   if (str1=="BODY")  el['id[13]'].value = 45 ;
   if (str1=="CENTER")  el['id[13]'].value = 43 ;
   if (str1=="FACES")  el['id[13]'].value = 46 ;


}


