// JavaScript Document

function subNewsletter()
{
 
var emailId = document.getElementById("textfield").value;
var url = "subscribe-newsletter.aspx?emailId=" + emailId + "&strip=strip&test=test";
document.getElementById("textfield").value = "";
//alert(url);
ajaxRequest(null,'true','GET',null,url,'subdiv')
}

// validator for site feedback
function validateradio(name)
{
var i=0;
var ctrls=document.getElementsByName(name);
var tempc;
var bresult=false;

    for(i=0;i<ctrls.length;i++)
    {           
        if(ctrls[i].checked)
        {
            bresult=true;
            break;
        }
    }
    
    if(!bresult)
    {        
        return false;    
    }    
    
    return true;
}

function validateratingWebSite(oSrc,sender)
{
    if(!validateradio('WebsiteLookrating'))
    {
    sender.IsValid=false;
    }
    else
    {
        sender.IsValid=true;
    }
    
}
function validateratingEaseOfNavigation(oSrc,sender)
{
    if(!validateradio('EaseofNavigationrating'))
    {
    sender.IsValid=false;
    }
    else
    {
        sender.IsValid=true;
    }
}

function validateratingInformationAvailable(oSrc,sender)
{
    if(!validateradio('InformationAvaiilablerating'))
    {
    sender.IsValid=false;
    }
    else
    {
        sender.IsValid=true;
    }
}
//Overallrating


function validateratingOverAllRating(oSrc,sender)
{
    if(!validateradio('Overallrating'))
    {
    sender.IsValid=false;
    }
    else
    {
        sender.IsValid=true;
    }
}

 function mobilevalidate(oSrc, args)
      {
           var mobilenum=document.getElementById("txtmobilenumber").value ;
           if(mobilenum.length < 10)
                       {
                         args.IsValid=false;
                        }
                        if(mobilenum.charAt(0)!=9)
                        {
                        args.IsValid=false;
                        }
                        ///////////////////////////////////
                            var testvar="0123456789";
                      var iloop=0;
                     var jloop=0;
                     var str=mobilenum;
                   var flag=false;
        for(iloop=0;iloop <mobilenum.length;iloop++)
    {
        for(jloop=0;jloop<testvar.length;jloop++)
        {
            if(str.charAt(iloop)==testvar.charAt(jloop))
            {
                   flag=true;break;
            }
            else
            {
                    flag=false;
            }
            
        }
        if(!flag)
        {break;
        }
    }   
    
  if(!flag)
  {
  args.IsValid=false;
  }
  }
