﻿function writeMailto(firstPart, secondPart)
{
    var address = firstPart + '@' + secondPart;
    var innerAddr;
    if(firstPart.length + secondPart.length > 23)
        innerAddr = firstPart + '@<br/>' + secondPart;
    else
        innerAddr = address;
    document.write("<a class=\"dotted\" href=\"mailto:" + address + "\">" + innerAddr + "</a>")
}

function writeMailto(firstPart, secondPart, split)
{
    var address = firstPart + '@' + secondPart;
    var innerAddr;
    if(firstPart.length + secondPart.length > 23 && split == 'true')
        innerAddr = firstPart + '@<br/>' + secondPart;
    else
        innerAddr = address;
    document.write("<a class=\"dotted\" href=\"mailto:" + address + "\">" + innerAddr + "</a>")
}

function writeMailtoWithTrack(id,firstPart, secondPart, split, oc,tracking) {
    var address = firstPart + '@' + secondPart;
    var innerAddr;
    if (firstPart.length + secondPart.length > 23 && split == 'true' && typeof(contactpage) == 'undefined')
        innerAddr = firstPart + '@<br/>' + secondPart;
    else
        innerAddr = address;
   $("#"+id).html("<a class=\"dotted\" href=\"mailto:" + address + "\" onclick=\"javascript:pageTracker._trackPageview('/virtual/mail-skickat/"+oc+"/');"+tracking+"\">" + innerAddr + "</a>")
}

//function writeMailtoWithTrack(firstPart, secondPart, oc) {
//    var address = firstPart + '@' + secondPart;
//    var innerAddr;
//    if (firstPart.length + secondPart.length > 23 && split == 'true')
//        innerAddr = firstPart + '@<br/>' + secondPart;
//    else
//        innerAddr = address;
//    document.write("<a class=\"dotted\" href=\"mailto:" + address + "\" onclick=\"javascript:pageTracker._trackPageview('/virtual/mail-skickat/" + oc + "/');\">" + innerAddr + "</a>")
//}


