//for new raj
function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function getValidatePhone(obj)
{
	if(!isInteger(obj.value))
	{
		alert("Phone must be Number");
		obj.value="";
		obj.focus();
		return false;
	}
	else if(obj.value.length!=10)
	{
		alert("Phone must be 10 digits Number");
		obj.value="";
		obj.focus();
		return false;
	}
		else return true;
}
function IsEmail(obj, msgstr)
{
    if(obj.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)!= -1)
        return true;
    else
	{
		obj.focus();
        return false;
	}
}

function IsBlank(obj)
{
    if(Trim(obj.value)=="")
    {
        obj.focus();
        return false;
    }
    return true;
}
function Trim(str)
{
    return str.replace(/\s/g,"");
}
//end raj


// JavaScript Document
function category_edit(id)
{
	document.frm_category_mgmt.category_id.value=id;
	//alert(document.frm_user_mgmt.user_id.value);
	document.frm_category_mgmt.action = "category_add.php?category_id="+id;
	document.frm_category_mgmt.submit();
}
function category_delete(id)
{
	//document.frm_user_mgmt.user_id.value=id;
	document.frm_category_mgmt.action = "category_delete.php?category_id="+id;
	document.frm_category_mgmt.submit();
}
function user_edit(id)
{
	document.frm_user_mgmt.user_id.value=id;
	//alert(document.frm_user_mgmt.user_id.value);
	document.frm_user_mgmt.action = "user_add.php?user_id="+id;
	document.frm_user_mgmt.submit();
}
function product_delete(id)
{
	//document.frm_user_mgmt.user_id.value=id;
	document.frm_product_mgmt.action = "product_delete.php?product_id="+id;
	document.frm_product_mgmt.submit();
}
function photo_edit(id,id1)
{
	
	//alert(document.frm_user_mgmt.user_id.value);
	document.frm_photo_mgmt.action = "photo_add.php?photo_id="+id+"&product_id="+id1;
	document.frm_photo_mgmt.submit();
}
function photo_delete(id)
{
	//document.frm_user_mgmt.user_id.value=id;
	document.frm_photo_mgmt.action = "photo_delete.php?photo_id="+id;
	document.frm_photo_mgmt.submit();
}
function product_edit(id)
{
	document.frm_product_mgmt.product_id.value=id;
	//alert(document.frm_user_mgmt.user_id.value);
	document.frm_product_mgmt.action = "product_add.php?product_id="+id;
	document.frm_product_mgmt.submit();
}
function user_delete(id)
{
	//document.frm_user_mgmt.user_id.value=id;
	document.frm_user_mgmt.action = "user_delete.php?user_id="+id;
	document.frm_user_mgmt.submit();
}
function editPhoto(type,FrmPara)
{
	document.frmPhotoAdd.action =FrmPara;
	document.frmPhotoAdd.submit();
}

function edit_link(id)
{
	document.frm_homepage_link_mgmt.action ="edit_homepage_link.php?link_id="+id;
	document.frm_homepage_link_mgmt.submit();
}


function deletePhoto(id)
{
	
	var ans = confirm("Are you sure want to Delete Photo?");
	if(ans==true)
	{
		document.frmShowPhoto.action = "photo_mgmt.php?do=delete&id="+id;
		document.frmShowPhoto.submit();
	}
}
function deleteProductOption(FrmPara)
{
	//alert("hi");
	var ans = confirm(" Would you like to Delete Product Attribute Value?");
	if(ans==true)
	{
		document.frmAttributeValue.hidFrmVal.value = "Delete";
		document.frmAttributeValue.action = FrmPara;
		document.frmAttributeValue.submit();
	}
	else
	{
		document.frmAttributeValue.action = FrmPara;
	}
}

function product_attribute_delete(id)
{
	document.product_attribute_add.action ="product_attribute_delete.php?product_attribute_id="+id;
	document.product_attribute_add.submit();
}
function product_attribute_edit(id)
{
	//document.product_attribute_add.product_id.value=id;
	//alert(document.frm_user_mgmt.user_id.value);
	document.product_attribute_add.action = "product_attribute_edit.php?product_attribute_id="+id;
	document.product_attribute_add.submit();
}

function editattributeproduct(id)
{
	document.product_edit_attribute.action = "product_attribute_edit_save.php?product_attribute_id="+id;
	document.product_edit_attribute.submit();
}

function news_edit(id)
{
	document.frm_news_mgmt.action = "news_add.php?news_id="+id;
	document.frm_news_mgmt.submit();
}
function news_delete(id)
{
	document.frm_news_mgmt.action = "news_delete.php?news_id="+id;
	document.frm_news_mgmt.submit();
}
function product_attribute_add()
{
	alert("test");
	//document.product_attribute_add.action = "product_attribute_add.php";
	//document.product_attribute_add.submit();
}
function addattributeproduct()
{
	
	document.product_attribute.action = "product_option_add_save.php";
	document.product_attribute.submit();
}
function add_to_cart(id,cid)
{
	
	document.frm_product_detail.action="add_quote2.php?product_id="+id+"&category_id="+cid;
	document.frm_product_detail.submit();
}

function email_check(str) {

		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.indexOf(dot);
		if (str.indexOf(at)==-1){
		   
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    
		    return false;
		 }

 		 return true;					
	}
function IsNumericforReg(sText)
{   
   var ValidChars = "+0123456789 -()";
   var IsNumber=true;
   var Char;
 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
   { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
      {
	  		IsNumber = false;
	  }
   }
   return IsNumber;   
 }
function sendContact()
{
		if(document.frmContact.txt_fname.value == ""){
		alert('Please enter first name!!');
		document.frmContact.txt_fname.focus();
		return false;
		
		}
		if(document.frmContact.txt_lname.value == ""){
		alert('Please last name !!');
		document.frmContact.txt_lname.focus();
		return false;
		
		} 
		if(document.frmContact.txt_email.value == ""){
		alert('Please enter email address!!');
		document.frmContact.txt_email.focus();
		return false;
		
		} 
		if (email_check(document.frmContact.txt_email.value)==false){
		alert("Please enter valid email address");
		document.frmContact.txt_email.value.focus();
		return false
		}
		if(document.frmContact.txt_phone.value == ""){
		alert('Please enter phone number!!');
		document.frmContact.txt_phone.focus();
		return false;
		
		}
		if(!IsNumericforReg(document.frmContact.txt_phone.value))
		{
		alert("Please enter valid phone number");
		document.frmContact.txt_phone.focus();
		return false;
		}
		
		if(document.frmContact.txt_comment.value == ""){
		alert('Please enter comment!!');
		document.frmContact.txt_comment.focus();
		return false;
		
		}
//		document.frmContact.action = "contact_us.php";
		document.frmContact.submit();
	
	
	}
function addproduct()
{

		if(document.product_add.txt_product_name.value == ""){
		alert('Please Enter Product Name!!');
		document.product_add.txt_product_name.focus();
		return false;
		
		}
		if(document.product_add.selCategory.value == ""){
		alert('Please Select Category !!');
		document.product_add.selCategory.focus();
		return false;
		
		} 
		if(document.product_add.txt_product_qty.value == ""){
		alert('Please Enter Product Quantity!!');
		document.product_add.txt_product_qty.focus();
		return false;
		
		} 
		if(document.product_add.txt_product_desc.value == ""){
		alert('Please Enter Product Description!!');
		document.product_add.txt_product_desc.focus();
		return false;
		
		} 
		
	
	document.product_add.action = "product_add_save.php";
	document.product_add.submit();
}

function addCategory()
{
	
	
	if(document.category_add.txt_category_name.value == ""){
		alert('Please Enter Category Name!!');
		document.category_add.txt_category_name.focus();
		return false;
	}
	document.category_add.action = "category_add_save.php";
	document.category_add.submit();
}
function adduser()
{
		
		if(document.user_add.txt_user_name.value == ""){
		alert('Please Enter User Name!!');
		document.user_add.txt_user_name.focus();
		return false;
		
		}
		if(document.user_add.txt_user_pass.value == ""){
		alert('Please Enter Password!!');
		document.user_add.txt_user_pass.focus();
		return false;
		
		} 
		if(document.user_add.txt_user_fname.value == ""){
		alert('Please Enter User First Name!!');
		document.user_add.txt_user_fname.focus();
		return false;
		
		} 
		if(document.user_add.txt_user_lname.value == ""){
		alert('Please Enter User Last Name!!');
		document.user_add.txt_user_lname.focus();
		return false;
		
		} 
		if(document.user_add.txt_user_email_id.value == ""){
		alert('Please Enter Email Id!!');
		document.user_add.txt_user_email_id.focus();
		return false;
		
		} 
		if(document.user_add.txt_user_address.value == ""){
		alert('Please Enter Address!!');
		document.user_add.txt_user_address.focus();
		return false;
		
		} 
		if(document.user_add.txt_user_city.value == ""){
		alert('Please Enter City Name!!');
		document.user_add.txt_user_city.focus();
		return false;
		
		}
		if(document.user_add.txt_user_state.value == ""){
		alert('Please Enter State Name!!');
		document.user_add.txt_user_state.focus();
		return false;
		
		}
		if(document.user_add.txt_user_country.value == ""){
		alert('Please Enter Country Name!!');
		document.user_add.txt_user_country.focus();
		return false;
		
		}
		if(document.user_add.txt_user_zip_code.value == ""){
		alert('Please Enter Zipcode!!');
		document.user_add.txt_user_zip_code.focus();
		return false;
		
		}
		if(document.user_add.txt_user_phone.value == ""){
		alert('Please Enter Phone Number!!');
		document.user_add.txt_user_phone.focus();
		return false;
		
		}
		if(document.user_add.selType.value == ""){
		alert('Please Select User Type!!');
		document.user_add.selType.focus();
		return false;
		
		} 
		if(document.user_add.selStatus.value == ""){
		alert('Please Select User Status!!');
		document.user_add.selStatus.focus();
		return false;
		
		} 
	
	document.user_add.action ="user_add_save.php";
	document.user_add.submit();
}
function order_delete(id)
{
	//document.frm_user_mgmt.user_id.value=id;
	document.frm_order_mgmt.action = "order_delete.php?order_id="+id;
	document.frm_order_mgmt.submit();
}
function order_edit(id)
{
	document.frm_order_mgmt.order_id.value=id;
	//alert(document.frm_user_mgmt.user_id.value);
	document.frm_order_mgmt.action = "order_add.php?order_id="+id;
	document.frm_order_mgmt.submit();
}
// JavaScript Document
function page_edit(id)
{
	//document.frm_user_mgmt.user_id.value=id;
	//alert(document.frm_user_mgmt.user_id.value);
	document.frm_page_mgmt.action = "page.php?page_id="+id;
	document.frm_page_mgmt.submit();
}
function page_delete(id)
{
	//document.frm_user_mgmt.user_id.value=id;
	document.frm_page_mgmt.action = "page.php?user_id="+id;
	document.frm_page_mgmt.submit();
}
function InsertProductOptionvalue(FrmPara)
{
	document.frmProductAttribute.action = FrmPara;
	document.frmProductAttribute.submit();
}
function InsertProductOption(FrmPara)
{
	document.frmAttributeValue.action = FrmPara;
	document.frmAttributeValue.submit();
}

function chkProductAttributeValidation(FrmPara)
{	
	
	
	if(document.frmAddAttributeValue.txtOptionName.value == ""){
		alert('Please Enter Product Attributes Name!!');
		document.frmAddAttributeValue.txtOptionName.focus();
		return false;
	}
	if(document.frmAddAttributeValue.txtProductValue.value == ""){
		alert('Please Enter Product Attributes Value!!');
		document.frmAddAttributeValue.txtProductValue.focus();
		return false;
	}
	document.frmAddAttributeValue.action =FrmPara;
	document.frmAddAttributeValue.submit();	
}

function updateQuote()
{
	document.frm_view_quote.action="update_quote.php";
	document.frm_view_quote.submit();
}

function emptyQuote()
{
	document.frm_view_quote.action="empty_quote.php";
	document.frm_view_quote.submit();
}

function checkoutQuote()
{
	document.frm_view_quote.action="checkout.php";
	document.frm_view_quote.submit();
}

	
function requestQuote()
{
var d=document.frm_checkout;	
	
	if(document.frm_checkout.txt_ship_user_fname.value == ""){
		alert('Please enter first name!!');
		document.frm_checkout.txt_ship_user_fname.focus();
		return false;
	}
	if(document.frm_checkout.txt_ship_user_lname.value == ""){
		alert('Please enter last name!!');
		document.frm_checkout.txt_ship_user_lname.focus();
		return false;
	}
	if(document.frm_checkout.txt_ship_user_address.value == ""){
		alert('Please enter address!!');
		document.frm_checkout.txt_ship_user_address.focus();
		return false;
	}
	if(document.frm_checkout.txt_ship_user_city.value == ""){
		alert('Please enter city name!!');
		document.frm_checkout.txt_ship_user_city.focus();
		return false;
	}if(document.frm_checkout.txt_ship_user_state.value == ""){
		alert('Please enter state name!!');
		document.frm_checkout.txt_ship_user_state.focus();
		return false;
	}
	
	if(document.frm_checkout.txt_ship_user_zip_code.value == ""){
		alert('Please enter zipcode!!');
		document.frm_checkout.txt_ship_user_zip_code.focus();
		return false;
	}
	if(!IsNumericforReg(document.frm_checkout.txt_ship_user_zip_code.value))
		{
		alert("Please enter valid zipcode");
		document.frm_checkout.txt_ship_user_zip_code.focus();
		return false;
		}
	if(!IsBlank(d.txt_ship_user_email))
		{
		alert("Email cannot be left blank");
		return false;
		}
	else if(!IsEmail(d.txt_ship_user_email))
		{
			alert("Please Enter valid Email!");
			return false;
		}	
		
/*	if(document.frm_checkout.txt_ship_user_fax.value == ""){
		alert('Please enter fax number!!');
		document.frm_checkout.txt_ship_user_fax.focus();
		return false;
	}
	if(!IsNumericforReg(document.frm_checkout.txt_ship_user_fax.value))
		{
		alert("Please enter valid fax number");
		document.frm_checkout.txt_ship_user_fax.focus();
		return false;
		}*/
	if(document.frm_checkout.txt_ship_user_phone.value == ""){
		alert('Please enter phone number!!');
		document.frm_checkout.txt_ship_user_phone.focus();
		return false;
	}
	if(!IsNumericforReg(document.frm_checkout.txt_ship_user_phone.value))
		{
		alert("Please enter valid phone number");
		document.frm_checkout.txt_ship_user_phone.focus();
		return false;
		}
	document.frm_checkout.action="order_add.php";
	document.frm_checkout.submit();
}
function checkSearch()
{
	
	
	if(document.frmSearchProd.txtSearch.value == ""){
		alert('Please Enter Search Text!!');
		document.frmSearchProd.txtSearch.focus();
		return false;
	}
	if(String(document.frmSearchProd.txtSearch.value).length < 3){
		alert('Please Enter Minimum Three Characters!!');
		document.frmSearchProd.txtSearch.focus();
		return false;
	}
	
	document.frmSearchProd.action = "product.php";
	document.frmSearchProd.submit();
	
}

function checkEmailPass()
{
	
	
	if(document.frmPassword.username.value == ""){
		alert('Please Enter User Name!');
		document.frmPassword.username.focus();
		return false;
	}
	if(document.frmPassword.useremail.value == ""){
		alert('Please Enter Email Id!');
		document.frmPassword.useremail.focus();
		return false;
	}
	
	
	return true;
	
}

function pageNext(cpage,cid)
{
 
 if(document.frm_product_detail.totalpage.value<cpage)
 	{
	 alert("Current page is last page!!");
	 return false;
	}
	
document.frm_product_detail.action = "product.php?page="+cpage+"&category_id="+cid;
document.frm_product_detail.submit();
}

function pageBack(cpage,cid)
{
 
 if(cpage<=0)
 	{
	 alert("Current page is first page!!");
	 return false;
	}
	
document.frm_product_detail.action = "product.php?page="+cpage+"&category_id="+cid;
document.frm_product_detail.submit();
}

function nextNews(cpage)
{
 
 if(document.frmNews.totalpage.value<cpage)
 	{
	 alert("Current news is last news!!");
	 return false;
	}
	
document.frmNews.action = "index.php?page="+cpage;
document.frmNews.submit();
}
function previousNews(cpage)
{
 
 if(cpage<=0)
 	{
	 alert("Current news is first news!!");
	 return false;
	}
	
document.frmNews.action = "index.php?page="+cpage;
document.frmNews.submit();
}
function goPage()
{
 
 if(document.frmSearchproduct.total_pages.value<document.frmSearchproduct.txtPage.value )
 	{
	 alert("Please Enter Valid Page Number!!");
	 return false;
	}
	if(document.frmSearchproduct.txtPage.value == "")
 	{
	 alert("Please Enter Page Number!!");
	 return false;
	}
document.frmSearchproduct.action = "product.php?page="+document.frmSearchproduct.txtPage.value;
document.frmSearchproduct.submit();
}
function goPage2()
{

if(document.frmSearchproduct.total_pages.value<document.frmSearchproduct.txtPage2.value)
 	{
	 alert("Please Enter Valid Page Number!!");
	 return false;
	}
	if(document.frmSearchproduct.txtPage2.value == "")
 	{
	 alert("Please Enter Page Number!!");
	 return false;
	}
document.frmSearchproduct.action = "product.php?page="+document.frmSearchproduct.txtPage2.value;
document.frmSearchproduct.submit();
}
function searchResultProduct()
{
	//document.frm_user_mgmt.user_id.value=id;
	//alert(document.frm_user_mgmt.user_id.value);
	var search1=document.frmSearchProduct.txtSearch.value;
	var field1=docoment.frmSearchProduct.selField.value;
	document.frmSearchProduct.action = "product.php?search="+search1+"&field="+field1;
	document.frmSearchProduct.submit();
}


function back()
{

	document.frmSearchProduct.submit();
}

function dopost(id)
{

document.frmSearchproduct.action = "product_detail.php";
document.frmSearchproduct.submit();	

}


function checkout_user()
{
	if(document.frm_checkout.txt_ship_user_fname.value == ""){
		alert('Please Enter Shipping First name');
		document.frm_checkout.txt_ship_user_fname.focus();
		return false;
	}
	if(document.frm_checkout.txt_ship_user_lname.value == ""){
		alert('Please Enter Shipping Last name');
		document.frm_checkout.txt_ship_user_lname.focus();
		return false;
	}
	if(document.frm_checkout.txt_ship_user_phone.value == ""){
		alert('Please Enter Shipping Phone Number');
		document.frm_checkout.txt_ship_user_phone.focus();
		return false;
	}
	if(document.frm_checkout.txt_ship_user_address.value == ""){
		alert('Please Enter Shipping Address');
		document.frm_checkout.txt_ship_user_address.focus();
		return false;
	}
	if(document.frm_checkout.txt_ship_user_city.value == ""){
		alert('Please Enter Shipping City');
		document.frm_checkout.txt_ship_user_city.focus();
		return false;
	}
	if(document.frm_checkout.txt_ship_user_state.value == ""){
		alert('Please Enter Shipping State');
		document.frm_checkout.txt_ship_user_state.focus();
		return false;
	}
	if(document.frm_checkout.txt_ship_user_country.value == ""){
		alert('Please Enter Shipping Country');
		document.frm_checkout.txt_ship_bill_user_country.focus();
		return false;
	}
	if(document.frm_checkout.txt_ship_user_zip_code.value == ""){
		alert('Please Enter Shipping Zip Code');
		document.frm_checkout.txt_ship_user_zip_code.focus();
		return false;
	}
	
	if(document.frm_checkout.txt_bill_user_fname.value == ""){
		alert('Please Enter Billing First name');
		document.frm_checkout.txt_bill_user_fname.focus();
		return false;
	}
	if(document.frm_checkout.txt_bill_user_lname.value == ""){
		alert('Please Enter Billing Last name');
		document.frm_checkout.txt_bill_user_lname.focus();
		return false;
	}
	if(document.frm_checkout.txt_bill_user_phone.value == ""){
		alert('Please Enter Billing Phone Number');
		document.frm_checkout.txt_bill_user_phone.focus();
		return false;
	}
	if(document.frm_checkout.txt_bill_user_address.value == ""){
		alert('Please Enter Billing Address');
		document.frm_checkout.txt_bill_user_address.focus();
		return false;
	}
	if(document.frm_checkout.txt_bill_user_city.value == ""){
		alert('Please Enter Billing City');
		document.frm_checkout.txt_bill_user_city.focus();
		return false;
	}
	if(document.frm_checkout.txt_bill_user_state.value == ""){
		alert('Please Enter Billing State');
		document.frm_checkout.txt_bill_user_state.focus();
		return false;
	}
	if(document.frm_checkout.txt_bill_user_country.value == ""){
		alert('Please Enter Billing Country');
		document.frm_checkout.txt_bill_user_country.focus();
		return false;
	}
	if(document.frm_checkout.txt_bill_user_zip_code.value == ""){
		alert('Please Enter Billing Zip Code');
		document.frm_checkout.txt_user_zip_code.focus();
		return false;
	}
	return true;
}


function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
		{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
	  catch (e)
		{
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	  }
	return xmlHttp;
}
function getAttributesValue()
{ 	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="getattributevalue.php";
	
	var len = document.product_add.selAttributes.length;
	
	var i = 0;
	var attribute_value = new Array(len-1);
	for (i = 0; i < len-1; i++)
			{
				if (document.product_add.selAttributes[i+1].value != "other")
					{
				 		if (document.product_add.selAttributes[i+1].selected) 
				 			{
								attribute_value[i]=document.product_add.selAttributes[i+1].value;
				 			} 
							document.getElementById("getOtherAttribute").innerHTML="";
							document.getElementById("getAttributeNodeText").innerHTML="";
					}else{
						if (document.product_add.selAttributes[i+1].selected){ 
						document.getElementById("getOtherAttribute").innerHTML="&nbsp;&nbsp;Other Attribute:&nbsp;&nbsp;<input type=\"text\" name=\"txtAttribute\">";
						document.getElementById("getAttributeNodeText").innerHTML="&nbsp;&nbsp;Attribute value:&nbsp;&nbsp;<input type=\"text\" name=\"txtAttributeValue\">";
						
						}
						}
			}
	url=url+"?attribute_value="+attribute_value;
	url=url+"&length="+(len-1);
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								//alert(xmlHttp.responseText);
								document.getElementById("getAttributeNode").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function getAttributes()
{ 	
	
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	  {
	  alert ("Your browser does not support AJAX!");
	  return;
	  } 
	var url="getattribute.php";
	
	var len = document.product_attribute.selProdAttributes.length;
	
	var i = 0;
	var attribute_value = new Array(len-1);
	var count=0;
	for (i = 0; i < len-1; i++)
			{
				if (document.product_attribute.selProdAttributes[i+1].value != "other"){
					if (document.product_attribute.selProdAttributes[i+1].selected) 
				 		{
							attribute_value[count]=document.product_attribute.selProdAttributes[i+1].value;
							count++;
							document.getElementById("getOtherAttribute2").innerHTML="";
							document.getElementById("getAttributeNodeText2").innerHTML="";
							
				 		} 
				}else{
						if (document.product_attribute.selProdAttributes[i+1].selected){ 
						document.getElementById("getOtherAttribute2").innerHTML="&nbsp;&nbsp;Other Attribute:&nbsp;&nbsp;<input type=\"text\" name=\"txtAttribute\">";
						document.getElementById("getAttributeNodeText2").innerHTML="&nbsp;&nbsp;Attribute value:&nbsp;&nbsp;<input type=\"text\" name=\"txtAttributeValue\">";
						
						}
					
					}
			}
	url=url+"?attribute_value="+attribute_value;
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=function() 
							{ 
								if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
								{ 
								//alert(xmlHttp.responseText);
								document.getElementById("getAttributeHint").innerHTML=xmlHttp.responseText;
								}
							};
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
//dev by raj
function sendEnquiry()
{
	var d=document.frmContact;
	
		if(document.frmContact.txt_fname.value == ""){
		alert('Please enter Name!!');
		document.frmContact.txt_fname.focus();
		return false;
		}
	/*	if(document.frmContact.txt_lname.value == ""){
		alert('Please last name !!');
		document.frmContact.txt_lname.focus();
		return false;
		}*/
		if(document.frmContact.txt_company.value == ""){
		alert('Please enter Company name !!');
		document.frmContact.txt_company.focus();
		return false;
		}
		if(document.frmContact.txt_phone.value == ""){
		alert('Please enter phone number!!');
		document.frmContact.txt_phone.focus();
		return false;
		
		}
		if(!IsNumericforReg(document.frmContact.txt_phone.value))
		{
		alert("Please enter valid phone number");
		document.frmContact.txt_phone.focus();
		return false;
		}
		/*if(document.frmContact.txt_suburb.value == ""){
		alert('Please enter Suburb !!');
		document.frmContact.txt_suburb.focus();
		return false;
		}
		if(document.frmContact.txt_state.value == ""){
		alert('Please select State !!');
		document.frmContact.txt_state.focus();
		return false;
		}*/
		if(!IsBlank(d.txt_email))
		{
		alert("Email cannot be left blank");
		return false;
		}
		else if(!IsEmail(d.txt_email))
		{
			alert("Please Enter valid Email!");
			return false;
		}
	/*	if(document.frmContact.txt_comment.value == ""){
		alert('Please enter comment!!');
		document.frmContact.txt_comment.focus();
		return false;
		
		}*/
		
		if(!IsBlank(d.verificationCode))
		{
			alert("Please Enter verification Code!");
			return false;
		}
		document.frmContact.submit();
	}