﻿function TrackClick(guid, pagename) {
//    storageclick = getCookie('storageclick');
//    alert('Tracking CampaignID: ' + guid + ' Cookie Value: ' + storageclick + ' IP: ' + ip);
//    if (storageclick != null && storageclick == guid) {
//        alert('Welcome again !');
//    }
//    else {
	var d = new Date();
        pic1 = new Image(1, 1);
        pic1.src = "http://www.vanlines.com/RemoteTracking.aspx?type=storageppc&guid=" + guid +"&pagename=" + pagename + '&d=' + d.getDate();
//        setCookie("storageclick", guid, 1);
//    }
}

function TrackSmCl(seourl, ip, userId) {
	var p = new Image(1, 1);
	var d = new Date();

    	p.src = "http://beta.vanlines.com/RemoteTracking.aspx?type=sitemapstorateppc"
			+ "&seourl=" + seourl
			+ "&ip=" + ip
			+ "&userId=" + userId
			+ "&d=" + d.getDate()
		;

}

function setCookie(c_name, value, expiredays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + expiredays);
    document.cookie = c_name + "=" + escape(value) +
	((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
}

function getCookie(c_name) {
    if (document.cookie.length > 0) {
        c_start = document.cookie.indexOf(c_name + "=");
        if (c_start != -1) {
            c_start = c_start + c_name.length + 1;
            c_end = document.cookie.indexOf(";", c_start);
            if (c_end == -1) c_end = document.cookie.length;
            return unescape(document.cookie.substring(c_start, c_end));
        }
    }
    return "";
}