﻿function GetComparison()
{
	 
	 inputs = document.getElementsByTagName('input'); 
	 var CheckCounter = 0;
	 var CodeList = '';
	 var Separator = '';

    //cycle trough the input fields 
    for(var i=0; i < inputs.length; i++) 
    { 
        //check if the input is a checkbox 
        if(inputs[i].getAttribute('type') == 'checkbox') 
        { 
             
            //create a new image 
           
             
            //check if the checkbox is checked 
            if(inputs[i].checked) 
            { 
              CheckCounter = CheckCounter + 1;
              
              CodeList =  CodeList + Separator + inputs[i].name.substring(22,34);
              Separator = ','
              
            } 
         }
    }
    if (CheckCounter > 3)
    window.alert('Compare only 3 ')
    else
    {
    //window.alert(CodeList);
    //document.getElementById('Text1').innerText = CodeList;
    //document.getElementById('HiddenField1').value = CodeList;
     setCookie("data",CodeList); 
     alert(getCookie("data"));
    }
   
}

