<!--
//Javascript for Gripper Selection 
//--------------------------------

// For Normal Quote Request Pages
function AddMsg(code,nm){
var cfm = "Do you wish to add Part # "+code +"   to your Quotation list?";

    if (confirm(cfm)) {
        // DO ADD TO QUOTE!
        var name=Gname[nm];
        ReadCookie('grpck'); 
        Insert(code,name); 
        setCookie(msg);
}   }

//For PartIndex Page
function AddPart(sr){
var code=Gcode[sr];
var name=Gname[sr];
var cfm = "Do you wish to add Part # "+code +"   to your Quotation list?";

    if (confirm(cfm)) {
        // DO ADD TO QUOTE!
      ReadCookie('grpck'); 
      Insert(code,name); 
      setCookie(msg);
 } }

function showquote(){
document.location.href="Gripper_quoteform.htm";
}

function setCookie(value){
 document.cookie = 'grpck' + "=" + escape(value)+"; path=/";
}

function ReadCookie(CookieName) {
  var SelectSize
  var ReturnValue = "";
  var CookieString = document.cookie;
  var CookieSet = CookieString.split (';');
  var SetSize = CookieSet.length;
    var CookiePieces
    var x = 0;
  for (x = 0; ((x < SetSize) && (ReturnValue == "")); x++) 
     {
    CookiePieces = CookieSet[x].split ('=');
    if (CookiePieces[0].substring (0,1) == ' ')
       {
      CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
       }
    if (CookiePieces[0] == CookieName)
       {
      ckvalue = unescape(CookiePieces[1]);
     
     } }
}


function Insert(code,name){    
var Fld='';
gg = new Array(10);

var SelectSize=0;
var FldSet='';
msg=ckvalue;
if (msg.length <  3) msg='';
if (msg.length > 2) 
{
FldSet = msg.split ('+');
SelectSize=FldSet.length;
for (i = 0; i < 10; i++)
{ gg[i]=""; }
if (SelectSize > 10 ) SelectSize=10;
  for (x = 0; x < SelectSize; x++)
{
  Fld = FldSet[x].split ('=');
  if (Fld[0]==code) return;
}
msg=msg + "+";
} 
msg = msg +code+"="+name; 

if (SelectSize == 9){
    var msg10='Max. of 10 Items allowed per request have been selected.\n';
    msg10=msg10+'Please proceed to Quote Request Form by clicking '+'"REVIEW QUOTE'+'" button.';
    alert(msg10);
   }

}


// -->



