<!--

var ReturnValue ='';
var SelectSize=0;
var msg
function setCookie(value)
{
document.cookie = 'grpck' + "=" + escape(value)+"; path=/";

}


function ReadCookie (CookieName) 
{
  SelectSize=0;
  var CookieString = document.cookie;

   var CookieSet = CookieString.split (';');
 
 var SetSize = CookieSet.length;
  var CookiePieces=''
   SelectSize=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)
       {
      ReturnValue = unescape(CookiePieces[1]);
      if (ReturnValue.length < 4 ) ReturnValue='';
       }
     }
 }
 
function ShowList()
{    
var Fld='';
gg = new Array(10);
var gr="Type: Techno-Sommer RFQ Quote Request \n\n";
 gr= gr + "Items:  ";

SelectSize=0;
var FldSet='';
if (ReturnValue.length > 1) 
{
FldSet = ReturnValue.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 ('=');
document.Form1.gripper[x].text=Fld[0] + "     " + Fld[1];
document.Form1.gripper[x].value=Fld[0];
gr=gr+Fld[0]+", ";
gg[x]=Fld[0];
} 
gr=gr+"\n";
document.Form2.Glist.value=gr;
document.Form2.Item_1.value=gg[0];
document.Form2.Item_2.value=gg[1];
document.Form2.Item_3.value=gg[2];
document.Form2.Item_4.value=gg[3];
document.Form2.Item_5.value=gg[4];
document.Form2.Item_6.value=gg[5];
document.Form2.Item_7.value=gg[6];
document.Form2.Item_8.value=gg[7];
document.Form2.Item_9.value=gg[8];
document.Form2.Item_10.value=gg[9];
}
}

function ClearAll()
{
for ( x=0;  x < 10;  x++)
{
document.Form1.gripper[x].text="";
document.Form1.gripper[x].value="";
}
setCookie('=');
ReadCookie('grpck');
document.Form1.gripper[0].text=".              List of Selected Items             .";
ReturnValue='';
}

function Delete()
{
msg='';
ReadCookie('grpck');
if (ReturnValue.length > 5) 
{
var FldSet = ReturnValue.split ('+');
SelectSize=FldSet.length;
if (SelectSize >10 ) {SelectSize = 10; }
  for (x = 0;   x < SelectSize;   x++)
{
if (document.Form1.gripper.options[x].selected  ) continue;
if (msg.length > 1 ) msg=msg + "+";
 msg=msg + FldSet[x]; 
}

setCookie(msg);
for ( x=0;  x < 10;  x++)
{
document.Form1.gripper[x].text="";
document.Form1.gripper[x].value="";
}
ReturnValue = msg;
ShowList();
}
} 
 
   function Gripper_Check(){
                 var subStr = "";
                 var g1 = document.Form1.gripper[0].text
                      if (g1 == "No Item Selected"){
                      subStr =  "No Items Selected  "; 
                      alert(subStr);
                      return false;    
                      } 
       	
       	    		
                }
                
     

   function CheckForm(){
                var subStr = "";

                
                if (document.Form2.elements[0].value == ""){
                        subStr = subStr + "First Name, ";
                }

                if (document.Form2.elements[1].value == ""){
                        subStr = subStr + "Last Name, ";
                }

              if (document.Form2.elements[2].value == ""){
                        subStr = subStr + "Email, ";
                }
             if (document.Form2.elements[5].value == ""){
                        subStr = subStr + "Phone, ";
                }
                if (document.Form2.elements[7].value == ""){
                        subStr = subStr + "Address, ";
                }

                if (document.Form2.elements[8].value == ""){
                        subStr = subStr + "City, ";
                }

                if (document.Form2.elements[9].selectedIndex == 0){
                        if (document.Form2.elements[9].selectedIndex == 0){
                                subStr = subStr + "State, ";
                        }
                }

                if (document.Form2.elements[10].value == ""){
                        subStr = subStr + "Zip, ";
                }

                if (document.Form2.elements[11].value == ""){
                        subStr = subStr + "Country  ";
                }



		if (subStr != "") {

                        messStr="The following fields are required:\n ";
                        endStr="\n Please enter the requested information.";
                        alert(messStr + subStr + endStr);
                        return false;

		}
		
	          
                 if (document.Form2.Recipient.value == "")
		       { 
		          alert("Mail will not be sent ");
		          return false;
		           }
			return true;

                }

function badEmail(theEmail) 
{
 var sEmail = "" + theEmail;
 if (sEmail.indexOf('@') == -1) return true;
 if (sEmail.indexOf('.') == -1) return true; 
}

// -->




