function friend_vali()
{
	return(checkCorrect3(document.friend_form.friend_name,"Name")&&checkEmail(document.friend_form.friend_email,"Email"))
	document.friend_form.submit();
	}


// ================================ function add company=============================================

function add_company()
{
	if (checkCorrect_select_box(document.frm.company_cat_id,"Category",true)==false)
        return false;
		
	if (checkCorrect3(document.frm.company_name,"Company Name",true)==false)
        return false;
		
	if (checkCorrect3(document.frm.company_contactname,"Contact Name",true)==false)
        return false;
		
	 var theurl=document.frm.company_website.value;
    
	 var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{3}/
     
	 if (tomatch.test(theurl))
     {
       		
     }
     else
     {
         window.alert("Website invalid. Try again.");
         return false; 
     } 
	 
	if (checkEmail(document.frm.company_email,"Email",true)==false)
        return false;
	
	if (checkCorrect3(document.frm.company_address,"Address",true)==false)
        return false;
	 
	if (checkCorrect3(document.frm.company_city,"City",true)==false)
        return false;
		
    if (checkCorrect_select_box(document.frm.company_country,"Country",true)==false)
        return false;
		
 
    if (checkCorrect_select_box(document.frm.company_state,"State",true)==false)
        return false;
		
		
	if (checkNumericWithOutDot(document.frm.company_phone,"Phone",true)==false)
        return false;
 
 
   if (checkNumericWithOutDot(document.frm.company_fax,"Fax",true)==false)
        return false;
 
    if (checkNumericWithOutDot(document.frm.company_zipcode,"Zip Code",true)==false)
        return false;
 
 	document.frm.submit();
	
}

//----------===================  Country AJax =====================================
function validate_hots()
{
return(checkCorrect3(document.frm.hots_title,"Title"));
}
//======================================end ajax========================================
function search_validation()
{
	document.users.submit();
	}
function validate_add_product()
{
	
	if (checkCorrect_select_box(document.frm.product_company_id,"Category",true)==false)
        return false;
	
	if (checkCorrect_select_box(document.frm.product_packageid,"Package",true)==false)
        return false;
		
	
	if (checkCorrect3(document.frm.product_name,"Product name",true)==false)
        return false;
		
									   
	if (checkNumeric(document.frm.product_price,"Product Price",true)==false)
        return false;					   
								   
	if (checkNumeric(document.frm.product_weight,"Product weight",true)==false)
        return false;				
		
			
	document.frm.submit();
	}
function submitformcompany()
{
return(checkCorrect3(document.frm_cmp.company_cat_id,"Category")&& checkCorrect3(document.frm_cmp.company_name,"Company Nmae")&& checkCorrect3(document.frm_cmp.company_contactname,"Contact Nmae")&&checkEmail(document.frm_cmp.company_email," Email")&& checkCorrect3(document.frm_cmp.company_address,"Address")&& checkCorrect3(document.frm_cmp.company_city,"City")&& checkCorrect3(document.frm_cmp.company_country,"Country"));
document.frm_cmp.submit();
}
function validation_login()
{
return(checkCorrect3(document.frm_login.txtusername,"Login Id")&& checkCorrect3(document.frm_login.txtpassword,"Password"));
//alert("sadfasdf");
document.frm_login.submit();
}
function submitformpck()
{
//	if(document.frm_pack.pack_name)
	//document.frm_pack.submit();
	
	var btn = valButton(document.frm_pack.pack_name);
if (btn == false)
{
	alert('Please Select Package');
	return false;
}
}
	function valButton(btn) {
    var cnt = -1;
    for (var i=0; i<btn.length; i++) {
        if (btn[i].checked) 
		{
			cnt = i;
		}
    }
    if (cnt > -1) 
	return true;
    else
	return false;
}