
if (typeof(qr_shareName)!='undefuned')
 if (qr_shareName!='')
 {  
       
    var qr_i = qr_shareName.indexOf(" ");
    if (qr_i>0)
    {
      qr_shareName = qr_shareName.substring(qr_i)+","+qr_shareName.substring(0,qr_i);
    }

    var qr_ans = "MECARD:N:"+qr_shareName+";"

    if (typeof(qr_shareAddress)!='undefined')
     if (qr_shareAddress!='') 
     {
      qr_ans+="ADR:"+encodeURIComponent(qr_shareAddress)+";";
     }

    if (typeof(qr_sharePhone)!='undefined')
     if (qr_sharePhone!='') 
     {
      qr_ans+="TEL:"+qr_sharePhone+";";
     }

    if (typeof(qr_shareEmail)!='undefined')
     if (qr_shareEmail!='') 
     {
      qr_ans+="EMAIL:"+qr_shareEmail+";";
     }

    if (typeof(qr_shareURL)!='undefined')
     if (qr_shareURL!='') 
     {
       qr_i = qr_shareURL.indexOf("http://");
       if (qr_i==0) qr_shareURL=qr_shareURL.substring(7);
       qr_ans+="URL:"+qr_shareURL+";";
     }


    qr_ans+=";";
    var qr_res="http://chart.apis.google.com/chart?cht=qr&chs=";

    if (typeof(qr_shareSize)!='undefined')
    {
     if (qr_shareSize!='') 
        qr_res+=qr_shareSize;
     else
        qr_res+="200x200";
    }
    else 
        qr_res+="200x200";

    qr_res+="&chl="+qr_ans;

    qr_ans="<img src='"+qr_res+"' alt='Address of "+qr_shareName+"'";

    if (typeof(qr_shareID)!='undefined')
     if (qr_shareID!='') 
       qr_ans+=" id='"+qr_shareID+"'"; 

    if (typeof(qr_shareClass)!='undefined')
     if (qr_shareClass!='') 
       qr_ans+=" class='"+qr_shareClass+"'"; 

    if (typeof(qr_shareStyle)!='undefined')
     if (qr_shareStyle!='') 
       qr_ans+=" style='"+qr_shareStyle+"'"; 

    qr_ans+="/>";

    qr_ans+="<br><a style='padding-left:35px;font-size:90%' href='http://www.servletsuite.com' target='_blank'>widget by Coldbeans</a>";

    document.write(qr_ans);
    
 }

