function isUrl(s)
{
var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
return regexp.test(s);
}
function linemaker(posted,detailtext,datefrom,dateto,contactname,contactemail,documentname)
//make an line in classified page - either doc download or link
{

document.write(commonbegin(posted))
if(isUrl(documentname)){
document.writeln("onclick=\"javascript:timelink('",datefrom,"','",dateto,"','",documentname,"')\">")}
else{
document.writeln("onclick=\"javascript:datebetween('",datefrom,"','",dateto,"','",escape(detailtext),"','",documentname,"')\">")
}
a=commonend(detailtext,contactname,contactemail)
return 0
}
function commonbegin(posted)
{
var a="<tr><td width='15%'>"+posted+"</td><td width='65%'><a href='#'";
return a
}
function commonend(detailtext,contactname,contactemail)
{
document.writeln(detailtext,"</a></td>")
document.writeln("<td width='20%'><a href='#' onclick=\"javascript:mailto('",contactemail.replace(/@/g,'@Q'),"?subject=",escape(detailtext),"')\">")
document.writeln(contactname,"</a></td>")
document.writeln("</tr>")
return 0
}

