function metric(PRODUCT,LINK)
{
    var xmlhttp1;
    xmlhttp1 = GetXmlHttpObject();
    if (xmlhttp1==null)
     {
     alert ("Browser does not support XMLHttpRequest, update Browser");
     }
    var weekday=new Array(7); 
    weekday[0]="Sun";
    weekday[1]="Mon";
    weekday[2]="Tue";
    weekday[3]="Wed";
    weekday[4]="Thu";
    weekday[5]="Fri";
    weekday[6]="Sat";    

    var month=new Array(11);
    month[0]="Jan";
    month[1]="Feb";
    month[2]="Mar";
    month[3]="Apr";
    month[4]="May";
    month[5]="Jun";
    month[6]="Jul";
    month[7]="Aug";
    month[8]="Sep";
    month[9]="Oct";
    month[10]="Nov";
    month[11]="Dec";
   
    d= new Date()
    var clienttime = "";
    var clientdate = "";
//
// Build Date String
//
    clientdate = d.getUTCFullYear() + "-" + (month[d.getUTCMonth()]) + "-" + d.getUTCDate() + "-" +(weekday[d.getUTCDay()]);
    clienttime = d.getUTCHours() + ":" + d.getUTCMinutes() + ":" + d.getUTCSeconds() + "--" + (d.getTimezoneOffset()/60) + "UTC";

//
// Build URL string 
//
 
    url="../php/wslog1.php";
    url= url + "?d=" + clientdate + "?" + clienttime + "?" + PRODUCT;
//
//  POST URL and Send to server
//
    xmlhttp1.open("POST",url,true);
    xmlhttp1.send(null);   
//
//  Open Apple iTunes Window
//

    window.open("http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?" + LINK); 
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // Use native object for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // Use the ActiveX control for IE5.x and IE6.
  return new ActiveXObject('MSXML2.XMLHTTP.3.0');
  }
return null;
}
