imgArray=new Array();
imgArray[0]=new Image();
imgArray[0].src="images/productrange_icon_down.gif"
imgArray[1]=new Image();
imgArray[1].src="images/glassproduct_down.gif"
imgArray[2]=new Image();
imgArray[2].src="images/quality_icon_down.gif"
imgArray[3]=new Image();
imgArray[3].src="images/feedback_down.gif"

imgArray[4]=new Image();
imgArray[4].src="images/links_down.gif"
imgArray[5]=new Image();
imgArray[5].src="images/left_navigation_down.gif"
imgArray[6]=new Image();
imgArray[6].src="images/left_navigation_down.gif"
imgArray[7]=new Image();
imgArray[7].src="images/left_navigation_down.gif"
imgArray[8]=new Image();
imgArray[8].src="images/left_navigation_down.gif"

function chImg(id,j)
{ 
    orig=document.images[id].src;
    document.images[id].src=imgArray[j].src
}

function resImg(id)
{
    document.images[id].src=orig
}



var whitespace = " \t\n\r";

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

function isWhitespace (s)
{ var i;
   if (isEmpty(s)) return true;
   for (i = 0; i < s.length; i++)
    {
    var c = s.charAt(i);
   if (whitespace.indexOf(c) == -1) return false;
   }
  return true;
}

function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

function isInteger (s)

{   var i;

    if (isEmpty(s))
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);
    for (i = 0; i < s.length; i++)
    {
        var c = s.charAt(i);
        if (!isDigit(c)) return false;
    }
    return true;
}

function chkEmail()
{
    var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; //not valid
    var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; //valid
	 if (!reg1.test(document.frm.email.value) && reg2.test(document.frm.email.value))
	         {
	         return true;
	 		}
	         else
	         {
		return false;
	     }
}


function checkform()
{

if (isWhitespace(document.frm.coname.value) || isEmpty(document.frm.coname.value))
{
alert("Please Enter Company Name");
document.frm.coname.focus();
return false;
}

else if (isWhitespace(document.frm.fname.value) || isEmpty(document.frm.fname.value))
{
alert("Please Enter First Name");
document.frm.fname.focus();
return false;
}

else if(!chkEmail())
{
	alert("Please Enter Valid Email Id")
	document.frm.email.focus();
	return false;
}

else if (isWhitespace(document.frm.desig.value) || isEmpty(document.frm.desig.value))
{
alert("Please Enter Designation");
document.frm.desig.focus();
return false;
}

else if (isWhitespace(document.frm.capacity.value) || isEmpty(document.frm.capacity.value))
{
alert("Please Enter Capacity in ml");
document.frm.capacity.focus();
return false;
}

else if (isWhitespace(document.frm.neck.value) || isEmpty(document.frm.neck.value))
{
alert("Please Enter Neck");
document.frm.neck.focus();
return false;
}

else if (isWhitespace(document.frm.overflow.value) || isEmpty(document.frm.overflow.value))
{
alert("Please Enter Overflow");
document.frm.overflow.focus();
return false;
}

else if (isWhitespace(document.frm.comments.value) || isEmpty(document.frm.comments.value))
{
alert("Please Enter Interest");
document.frm.comments.focus();
return false;
}

else
return true;
}