// JS display manager for all phone directrory

 function Display(name,mobile,city,county,country,streetNB,street,fax)
 {
    document.getElementById(name).innerHTML='<td width="11"></td><td width="120"><span class = "informationsTitles">Mobile : </span><span class = "informationsAdded">'+mobile+'</span></td><td width="120"><span class = "informationsTitles">Fax : </span><span class = "informationsAdded">'+fax+'</span></td><td></td><td colspan=4><span class = "informationsTitles">Address : </span><span class = "informationsAdded">'+streetNB+' '+street+', '+city+', '+county+', '+country+'</span></td>';
    imgID = 'img'+name;
    document.getElementById(imgID).innerHTML = '<img src="images/moins.gif" onclick = "disappear(&quot;'+name+'&quot;,&quot;'+mobile+'&quot;,&quot;'+city+'&quot;,&quot;'+county+'&quot;,&quot;'+country+'&quot;,&quot;'+streetNB+'&quot;,&quot;'+street+'&quot;,&quot;'+fax+'&quot;);" >';
  }
 
 function disappear(name,mobile,city,county,country,streetNB,street,fax )
 {
     document.getElementById(name).innerHTML="";
     imgID = 'img'+name;
     document.getElementById(imgID).innerHTML = '<img src="images/plus.gif" onclick = "Display(&quot;'+name+'&quot;,&quot;'+mobile+'&quot;,&quot;'+city+'&quot;,&quot;'+county+'&quot;,&quot;'+country+'&quot;,&quot;'+streetNB+'&quot;,&quot;'+street+'&quot;,&quot;'+fax+'&quot;);" >';
 }
 
 function DisplayOtherPage(form,Numpage)
 {
    form.numPage.value = Numpage;
    form.submit();
 }
 
function pop_it(webUrl,dirid)
{
   url=webUrl+"sms.aspx?dirid="+dirid+"&action=askNumber";
   
   window.open(url, "popup", "height=440,width=640,menubar='no',toolbar='no',location='no',status='no',scrollbars='no'");

   //form.submit();
}

function displayBusiness(who)       // Is customer representing a business or a residential
{
    if(who =='b')
    {
        document.getElementById("business").style.display ="block";
    }
    if(who =='c')
    {
        document.getElementById("business").style.display ="none";
    }
}

function checkForm(form)
{radio = form.customerType;
    if (radio[0].checked || radio[1].checked)
    {return form.submit();}
    else{alert("Please choose your status between Residential or Business.");}
}


