// JavaScript Document
IdColorSave=0;
IdSizeSave=0;

function selfeature1(Feature1id,i,catalogid)
  {
      
      document.getElementById('Feature1').value=Feature1id;
      //alert("test"+IdColorSave);
        if (document.getElementById('IdColor'+i)) {document.getElementById('IdColor'+i).className ='ColorBorder';}
        if (document.getElementById('IdColor'+IdColorSave)) {
              if (document.getElementById('IdColor'+IdColorSave)!=document.getElementById('IdColor'+i)){document.getElementById('IdColor'+IdColorSave).className ='ColorBorderLess';}
            }
        else
        {
          if (document.getElementById('IdColor'+i)) {document.getElementById('IdColor'+i).className ='ColorBorder';}
        }
        IdColorSave=i;
        
        
         var xhr_object = null; 
		
    		if(window.XMLHttpRequest) // Firefox 
		      xhr_object = new XMLHttpRequest(); 
		    else if(window.ActiveXObject) // Internet Explorer 
		      xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
		          else { // XMLHttpRequest non supporté par le navigateur 
		            alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		          return; 
		          } 
		    var sQry =  "Gerbefeatures.asp?catalogid="+catalogid+"&feature1=" + Feature1id
		    xhr_object.open("GET", sQry, true); 
		 		xhr_object.onreadystatechange = function() 
		    { 
		    if(xhr_object.readyState == 4) 
		   	 {
	      		//alert("Requête executée avec succès"); 
		   	 }
		    } 
		     xhr_object.send(null); 
            
  }
function selfeature2(Feature2id,catalogid) //'stockage de la taille cliquée de la page produit encours'
  {
      //alert("feature2:"+Feature2id)
         var xhr_object = null; 
		
    		if(window.XMLHttpRequest) // Firefox 
		      xhr_object = new XMLHttpRequest(); 
		    else if(window.ActiveXObject) // Internet Explorer 
		      xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
		          else { // XMLHttpRequest non supporté par le navigateur 
		            alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		          return; 
		          } 
		    var sQry =  "Gerbefeatures.asp?catalogid="+catalogid+"&feature2=" + Feature2id
		    //alert(sQry)
		    xhr_object.open("GET", sQry, true); 
		 		xhr_object.onreadystatechange = function() 
		    { 
		    if(xhr_object.readyState == 4) 
		   	 {
	     // alert("Requête executée avec succès"); 
		   	 }
		    } 
		     xhr_object.send(null); 
            
  }
  function selfeatureSizeColor(Feature1id,i,catalogid) //'selection du coloristaille dans le hors collection'
  {
      
      if (document.getElementById('IdColor'+i)) {document.getElementById('IdColor'+i).className ='ColorBorder';}
      if (document.getElementById('IdColor'+IdColorSave)) {
          if (document.getElementById('IdColor'+IdColorSave)!=document.getElementById('IdColor'+i)){document.getElementById('IdColor'+IdColorSave).className ='ColorBorderLess';}
          }
          else
        {
        if (document.getElementById('IdColor'+i)) {document.getElementById('IdColor'+i).className ='ColorBorder';}
        }
        IdColorSave=i;
        
        document.getElementById('Feature1').value=Feature1id;
         
        /*if (document.getElementById('IdSize'+i)) {document.getElementById('IdSize'+i).src ='rond_coche.png';}*/
        if (document.getElementById('IdSize'+IdSizeSave)) {
               
              if (document.getElementById('IdSize'+IdSizeSave)!=document.getElementById('IdSize'+i)){document.getElementById('IdSize'+IdSizeSave).src ='rond.png';}
            }
        else
        {
          if (document.getElementById('IdSize'+i)) {document.getElementById('IdSize'+i).src ='rond_coche.png';}
        }
        IdSizeSave=Feature1id;
      
        
        
         var xhr_object = null; 
		
    		if(window.XMLHttpRequest) // Firefox 
		      xhr_object = new XMLHttpRequest(); 
		    else if(window.ActiveXObject) // Internet Explorer 
		      xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
		          else { // XMLHttpRequest non supporté par le navigateur 
		            alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		          return; 
		          } 
		    //var sQry =  "Gerbefeatures.asp?catalogid="+catalogid+"&feature1=" + Feature1id
		    var sQry =  "Gerbefeatures.asp?catalogid="+catalogid+"&feature1="+Feature1id+"&FeatureColor=0"
		    xhr_object.open("GET", sQry, true); 
		 		xhr_object.onreadystatechange = function() 
		    { 
		    if(xhr_object.readyState == 4) 
		   	 {
	      		//alert("valeurs envoyees : catalogid:"+catalogid+"   feature1:"+Feature1id); 
		   	 }
		    } 
		     xhr_object.send(null);
        
        
        
  }
function selfeatureColor(i,catalogid,CountSize) //'selection du colori cliqué de la page produit en cours'
  {
          
        var feature1=0;
        document.getElementById('Feature1').value='x';
        if (document.getElementById('IdColor'+i)) {document.getElementById('IdColor'+i).className ='ColorBorder';}
        if (document.getElementById('IdColor'+IdColorSave)) {
              if (document.getElementById('IdColor'+IdColorSave)!=document.getElementById('IdColor'+i))
                  {document.getElementById('IdColor'+IdColorSave).className ='ColorBorderLess';
                    if (document.getElementById('IdSize'+IdSizeSave)) {document.getElementById('IdSize'+IdSizeSave).src ='rond.png';}
                  }
            }
        else
        {
          if (document.getElementById('IdColor'+i)) {document.getElementById('IdColor'+i).className ='ColorBorder';}
        }
        IdColorSave=i;
        
        
        
        
        // Selection du seul colori
        if (CountSize==1) {
            
            document.getElementById('Feature2').checked ='true';
            feature1=document.getElementById('Feature2').value;
            //alert(feature1);
            
            }
        
                 var xhr_object = null; 
		
    		if(window.XMLHttpRequest) // Firefox 
		      xhr_object = new XMLHttpRequest(); 
		    else if(window.ActiveXObject) // Internet Explorer 
		      xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
		          else { // XMLHttpRequest non supporté par le navigateur 
		            alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		          return; 
		          }
          if (CountSize==1) {var sQry =  "Gerbefeatures.asp?catalogid="+catalogid+"&feature1="+feature1+"&FeatureColor="+i;}
          else{  		          
            var sQry =  "Gerbefeatures.asp?catalogid="+catalogid+"&feature1=0+&FeatureColor="+i;
           }
         
		    xhr_object.open("GET", sQry, true); 
		 		xhr_object.onreadystatechange = function() 
		    { 
		    if(xhr_object.readyState == 4) 
		   	 {
	          // alert("valeurs envoyees : FeatureColor:"+i); 
		   	 }
		    } 
		     xhr_object.send(null);
  }

function selfeaturesize2(Feature2id,i,catalogid)
  {
      
      document.getElementById('Feature2').value=Feature2id;
      
        if (document.getElementById('IdSize'+i)) {document.getElementById('IdSize'+i).src ='rond_coche.png';}
        if (document.getElementById('IdSize'+IdSizeSave)) {
              if (document.getElementById('IdSize'+IdSizeSave)!=document.getElementById('IdSize'+i)){document.getElementById('IdSize'+IdSizeSave).src ='rond.png';}
            }
        else
        {
          if (document.getElementById('IdSize'+i)) {document.getElementById('IdSize'+i).src ='rond_coche.png';}
        }
        IdSizeSave=i;
        
        
         var xhr_object = null; 
		
    		if(window.XMLHttpRequest) // Firefox 
		      xhr_object = new XMLHttpRequest(); 
		    else if(window.ActiveXObject) // Internet Explorer 
		      xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
		          else { // XMLHttpRequest non supporté par le navigateur 
		            alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		          return; 
		          } 
		    var sQry =  "Gerbefeatures.asp?catalogid="+catalogid+"&feature2=" + Feature2id
		    xhr_object.open("GET", sQry, true); 
		 		xhr_object.onreadystatechange = function() 
		    { 
		    if(xhr_object.readyState == 4) 
		   	 {
	      		//alert("Requête executée avec succès"); 
		   	 }
		    } 
		     xhr_object.send(null); 
            
  }


function selnewsletter()
  {
      
      
        if (document.getElementById('newsletter').value) {
            if(document.getElementById('newsletter').value =='TRUE')
            {document.getElementById('newsletter').value ='FALSE';
            document.getElementById('Imgnewsletter').src ='imgcase.png';
            }else
            {document.getElementById('newsletter').value ='TRUE';
            document.getElementById('Imgnewsletter').src ='imgcase_cochee.png';
            }
            }
            
  }
  function sellicense()
  {
      
      
        if (document.getElementById('license').value) {
            if(document.getElementById('license').value =='TRUE')
            {document.getElementById('license').value ='FALSE';
            document.getElementById('Imglicense').src ='imgcase.png';
            }else
            {document.getElementById('license').value ='TRUE';
            document.getElementById('Imglicense').src ='imgcase_cochee.png';
            }
            }
            
  }


function selRemoveI(i)
  {
      
      
        if (document.getElementById('RemoveI'+i)) {
            
            if(document.getElementById('RemoveI'+i).value =='yes')
            {document.getElementById('RemoveI'+i).value ='';
            document.getElementById('ImgRemoveI'+i).src ='imgcase.png';
            }else
            {document.getElementById('RemoveI'+i).value ='yes';
            document.getElementById('ImgRemoveI'+i).src ='imgcase_cochee.png';
            }
            }
            
  }

function  selectcountry(selection)
{
var CountrySel;
switch (selection)
{
case 'Afghanistan':
CountrySel='AF';       
break;    
case 'Albania':
CountrySel='AL';       
break;    
case 'Algeria':
CountrySel='DZ';      
break;    
case 'American Samoa':
CountrySel='AS';
break;    
case 'Andorra':
CountrySel='AD';       
break;    
case 'Angola':
CountrySel='AO';       
break;    
case 'Anguilla':
CountrySel='AI';       
break;    
case 'Antarctica':
CountrySel='AQ';       
break;    
case 'Antigua And Barbuda':
CountrySel='AG';       
break;    
case 'Argentina':
CountrySel='AR';       
break;    
case 'Armenia':
CountrySel='AM';       
break;    
case 'Aruba':
CountrySel='AW';       
break;    
case 'Australia':
CountrySel='AU';       
break;    
case 'Austria':
CountrySel='AT';       
break;    
case 'Azerbaijan':
CountrySel='AZ';       
break;    
case 'Bahamas':
CountrySel='BS';       
break;    
case 'Bahrain':
CountrySel='BH';       
break;    
case 'Bangladesh':
CountrySel='BD';       
break;    
case 'Barbados':
CountrySel='BB';       
break;    
case 'Belarus':
CountrySel='BY';       
break;    
case 'Belgium':
CountrySel='BE';       
break;    
case 'Belize':
CountrySel='BZ';       
break;    
case 'Benin':
CountrySel='BJ';       
break;    
case 'Bermuda':
CountrySel='BM';       
break;    
case 'Bhutan':
CountrySel='BT';       
break;    
case 'Bolivia':
CountrySel='BO';
break;    
case 'Bosnia And Herzegowina':
CountrySel='BA';       
break;    
case 'Botswana':
CountrySel='BW';       
break;    
case 'Bouvet Island':
CountrySel='BV';       
break;    
case 'Brazil':
CountrySel='BR';       
break;    
case 'Brunei Darussalam':
CountrySel='BN';       
break;    
case 'Bulgaria':
CountrySel='BG';       
break;    
case 'Burkina Faso':
CountrySel='BF';       
break;    
case 'Burundi':
CountrySel='BI';       
break;    
case 'Cambodia':
CountrySel='KH';       
break;    
case 'Cameroon':
CountrySel='CM';       
break;    
case 'Canada':
CountrySel='CA';       
break;    
case 'Cape Verde':
CountrySel='CV';       
break;    
case 'Cayman Islands':
CountrySel='KY';       
break;    
case 'Central African Rep':
CountrySel='CF';       
break;    
case 'Chad':
CountrySel='TD';       
break;    
case 'Chile':
CountrySel='CL';       
break;    
case 'China':
CountrySel='CN';       
break;    
case 'Christmas Island':
CountrySel='CX';       
break;    
case 'Cocos Islands':
CountrySel='CC';       
break;    
case 'Colombia':
CountrySel='CO';       
break;    
case 'Comoros':
CountrySel='KM';       
break;    
case 'Congo':
CountrySel='CG';       
break;    
case 'Cook Islands':
CountrySel='CK';       
break;    
case 'Costa Rica':
CountrySel='CR';       
break;    
case 'Cote D ivoire':
CountrySel='CI';       
break;    
case 'Croatia':
CountrySel='HR';       
break;    
case 'Cuba':
CountrySel='CU';       
break;    
case 'Cyprus':
CountrySel='CY';       
break;    
case 'Czech Republic':
CountrySel='CZ';       
break;    
case 'Denmark':
CountrySel='DK';       
break;    
case 'Djibouti':
CountrySel='DJ';       
break;    
case 'Dominica':
CountrySel='DM';       
break;    
case 'Dominican Republic':
CountrySel='DO';       
break;    
case 'East Timor':
CountrySel='TL';       
break;    
case 'Ecuador':
CountrySel='EC';       
break;    
case 'Egypt':
CountrySel='EG';       
break;    
case 'El Salvador':
CountrySel='SV';       
break;    
case 'Equatorial Guinea':
CountrySel='GQ';       
break;    
case 'Eritrea':
CountrySel='ER';       
break;    
case 'Estonia':
CountrySel='EE';       
break;    
case 'Ethiopia':
CountrySel='ET';       
break;    
case 'Falkland Islands (Malvinas)':
CountrySel='FK';       
break;    
case 'Faroe Islands':
CountrySel='FO';       
break;    
case 'Fiji':
CountrySel='FJ';       
break;    
case 'Finland':
CountrySel='FI';       
break;

case 'France métropolitaine':
CountrySel='FR';       
break;    
case 'French Guiana':
CountrySel='GF';       
break;    
case 'French Polynesia':
CountrySel='PF';       
break;    
case 'French S. Territories':
CountrySel='TF';       
break;    
case 'Gabon':
CountrySel='GA';       
break;    
case 'Gambia':
CountrySel='GM';       
break;    
case 'Georgia':
CountrySel='GE';       
break;    
case 'Germany':
CountrySel='DE';       
break;    
case 'Ghana':
CountrySel='GH';       
break;    
case 'Gibraltar':
CountrySel='GI';       
break;    
case 'Greece':
CountrySel='GR';       
break;    
case 'Greenland':
CountrySel='GL';       
break;    
case 'Grenada':
CountrySel='GD';       
break;    
case 'Guadeloupe':
CountrySel='GP';       
break;    
case 'Guam':
CountrySel='GU';       
break;    
case 'Guatemala':
CountrySel='GT';      
break;    
case 'Guinea':
CountrySel='GN';       
break;    
case 'Guinea-bissau':
CountrySel='GW';       
break;    
case 'Guyana':
CountrySel='GY';       
break;    
case 'Haiti':
CountrySel='HT';       
break;    
case 'Honduras':
CountrySel='HN';       
break;    
case 'Hong Kong':
CountrySel='HK';       
break;    
case 'Hungary':
CountrySel='HU';       
break;    
case 'Iceland':
CountrySel='IS';       
break;    
case 'India':
CountrySel='IN';       
break;    
case 'Indonesia':
CountrySel='ID';       
break;    
case 'Iran':
CountrySel='IR';       
break;    
case 'Iraq':
CountrySel='IQ';       
break;    
case 'Ireland':
CountrySel='IE';       
break;    
case 'Israel':
CountrySel='IL';       
break;    
case 'Italy':
CountrySel='IT';       
break;    
case 'Jamaica':
CountrySel='JM';       
break;    
case 'Japan':
CountrySel='JP';       
break;    
case 'Jersey Islands':
CountrySel='JE';       
break;                  
case 'Jordan':
CountrySel='JO';       
break;    
case 'Kazakhstan':
CountrySel='KZ';       
break;    
case 'Kenya':
CountrySel='KE';       
break;    
case 'Kiribati':
CountrySel='KI';       
break;    
case 'Korea (North)':
CountrySel='KP';       
break;    
case 'Korea (South)':
CountrySel='KR';       
break;    
case 'Kuwait':
CountrySel='KW';       
break;    
case 'Kyrgyzstan':
CountrySel='KG';       
break;    
case 'Laos':
CountrySel='LA';       
break;    
case 'Latvia':
CountrySel='LV';       
break;    
case 'Lebanon':
CountrySel='LB';       
break;    
case 'Lesotho':
CountrySel='LS';       
break;    
case 'Liberia':
CountrySel='LR';       
break;    
case 'Libya':
CountrySel='LY';       
break;    
case 'Liechtenstein':
CountrySel='LI';       
break;    
case 'Lithuania':
CountrySel='LT';       
break;    
case 'Luxembourg':
CountrySel='LU';       
break;    
case 'Macau':
CountrySel='MO';       
break;    
case 'Macedonia':
CountrySel='MK';       
break;    
case 'Madagascar':
CountrySel='MG';       
break;    
case 'Malawi':
CountrySel='MW';       
break;    
case 'Malaysia':
CountrySel='MY';       
break;    
case 'Maldives':
CountrySel='MV';       
break;    
case 'Mali':
CountrySel='ML';       
break;    
case 'Malta':
CountrySel='MT';       
break;    
case 'Marshall Islands':
CountrySel='MH';       
break;    
case 'Martinique':
CountrySel='MQ';       
break;    
case 'Mauritania':
CountrySel='MR';       
break;    
case 'Mauritius':
CountrySel='MU';       
break;    
case 'Mayotte':
CountrySel='YT';       
break;    
case 'Mexico':
CountrySel='MX';       
break;    
case 'Micronesia':
CountrySel='FM';       
break;    
case 'Moldova':
CountrySel='MD';       
break;    
case 'Monaco':
CountrySel='MC';       
break;    
case 'Mongolia':
CountrySel='MN';       
break;    
case 'Montserrat':
CountrySel='MS';       
break;    
case 'Morocco':
CountrySel='MA';       
break;    
case 'Mozambique':
CountrySel='MZ';       
break;    
case 'Myanmar':
CountrySel='MM';       
break;    
case 'Namibia':
CountrySel='NA';       
break;    
case 'Nauru':
CountrySel='NR';       
break;    
case 'Nepal':
CountrySel='NP';       
break;    
case 'Netherlands':
CountrySel='NL';       
break;
case 'Netherlands Antilles':
CountrySel='AN';       
break;    
case 'New Caledonia':
CountrySel='NC';       
break;    
case 'New Zealand':
CountrySel='NZ';       
break;    
case 'Nicaragua':
CountrySel='NI';       
break;    
case 'Niger':
CountrySel='NE';       
break;    
case 'Nigeria':
CountrySel='NG';       
break;    
case 'Niue':
CountrySel='NU';       
break;    
case 'Norfolk Island':
CountrySel='NF';       
break;    
case 'Northern Mariana Islands':
CountrySel='MP';       
break;    
case 'Norway':
CountrySel='NO';       
break;    
case 'Oman':
CountrySel='OM';       
break;    
case 'Pakistan':
CountrySel='PK';       
break;    
case 'Palau':
CountrySel='PW';       
break;    
case 'Panama':
CountrySel='PA';       
break;    
case 'Papua New Guinea':
CountrySel='PG';       
break;    
case 'Paraguay':
CountrySel='PY';       
break;    
case 'Peru':
CountrySel='PE';       
break;    
case 'Philippines':
CountrySel='PH';       
break;    
case 'Pitcairn':
CountrySel='PN';       
break;    
case 'Poland':
CountrySel='PL';       
break;    
case 'Portugal':
CountrySel='PT';       
break;    
case 'Puerto Rico':
CountrySel='PR';       
break;    
case 'Qatar':
CountrySel='QA';       
break;    
case 'Reunion':
CountrySel='RE';       
break;    
case 'Romania':
CountrySel='RO';       
break;    
case 'Russian Federation':
CountrySel='RU';       
break;    
case 'Rwanda':
CountrySel='RW';       
break;    
case 'Saint Kitts And Nevis':
CountrySel='KN';       
break;    
case 'Saint Lucia':
CountrySel='LC';       
break;    
case 'St Vincent/Grenadines':
CountrySel='VC';       
break;    
case 'Samoa':
CountrySel='WS';       
break;    
case 'San Marino':
CountrySel='SM';       
break;    
case 'Sao Tome':
CountrySel='ST';       
break;    
case 'Saudi Arabia':
CountrySel='SA';       
break;    
case 'Senegal':
CountrySel='SN';       
break;    
case 'Seychelles':
CountrySel='SC';       
break;    
case 'Sierra Leone':
CountrySel='SL';       
break;    
case 'Singapore':
CountrySel='SG';       
break;    
case 'Slovakia':
CountrySel='SK';       
break;    
case 'Slovenia':
CountrySel='SI';       
break;    
case 'Solomon Islands':
CountrySel='SB';       
break;    
case 'Somalia':
CountrySel='SO';       
break;    
case 'South Africa':
CountrySel='ZA';       
break;    
case 'Spain':
CountrySel='ES';       
break;    
case 'Sri Lanka':
CountrySel='LK';       
break;    
case 'St. Helena':
CountrySel='SH';       
break;    
case 'St.Pierre':
CountrySel='PM';       
break;    
case 'Sudan':
CountrySel='SD';       
break;    
case 'Suriname':
CountrySel='SR';       
break;    
case 'Swaziland':
CountrySel='SZ';       
break;    
case 'Sweden':
CountrySel='SE';       
break;    
case 'Switzerland':
CountrySel='CH';       
break;    
case 'Syrian Arab Republic':
CountrySel='SY';       
break;    
case 'Taiwan':
CountrySel='TW';       
break;    
case 'Tajikistan':
CountrySel='TJ';       
break;    
case 'Tanzania':
CountrySel='TZ';       
break;    
case 'Thailand':
CountrySel='TH';       
break;    
case 'Togo':
CountrySel='TG';       
break;    
case 'Tokelau':
CountrySel='TK';       
break;    
case 'Tonga':
CountrySel='TO';       
break;    
case 'Trinidad And Tobago':
CountrySel='TT';       
break;    
case 'Tunisia':
CountrySel='TN';       
break;    
case 'Turkey':
CountrySel='TR';       
break;    
case 'Turkmenistan':
CountrySel='TM';       
break;    
case 'Tuvalu':
CountrySel='TV';       
break;    
case 'Uganda':
CountrySel='UG';       
break;    
case 'Ukraine':
CountrySel='UA';       
break;    
case 'United Arab Emirates':
CountrySel='AE';       
break;    
case 'United Kingdom':
CountrySel='GB';       
break;    
case 'United States':
CountrySel='US';       
break;    
case 'Uruguay':
CountrySel='UY';       
break;    
case 'Uzbekistan':
CountrySel='UZ';       
break;    
case 'Vanuatu':
CountrySel='VU';       
break;    
case 'Vatican City State':
CountrySel='VA';       
break;    
case 'Venezuela':
CountrySel='VE';       
break;    
case 'Viet Nam':
CountrySel='VN';       
break;    
case 'Virgin Islands (British)':
CountrySel='VG';       
break;    
case 'Virgin Islands (U.S.)':
CountrySel='VI';       
break;    
case 'Western Sahara':
CountrySel='EH';       
break;    
case 'Yemen':
CountrySel='YE';       
break;    
case 'Zambia':
CountrySel='ZM';       
break;    
case 'Zimbabwe':
CountrySel='ZW';       
break;    
case 'Other': 
CountrySel='Other';       
break;    

}    
 return CountrySel;
}

function FermerMsgErreur() {
 GetId("MsgErreur").style.visibility="hidden";
 }
 

