// function
String.prototype.startsWith = function(sStart) {
    return (this.substr(0,sStart.length)==sStart);
}

function getLastStr(str, separator) {
    var splitStr = str.split(separator);
    return splitStr[splitStr.length-1];
}

// URL Information
var dmp_host = (location.host).toLowerCase()           // <hostname>[:<port>]
var dmp_path = (location.pathname).toLowerCase()                        // <pathname>
var dmp_param = (location.search).toLowerCase()        // <search> -- ?...
var dmp_page = getLastStr(dmp_path, "/");
var dmp_fullPath = (document.URL).toLowerCase();

// Referer URL Information
var dmp_referType = "N"
var dmp_referURL = "";
if (dmp_referrer == "" || dmp_referrer.length == 0) {
    if (dmp_opener == null) {
        dmp_referType = "D"; // direct
        dmp_referURL = "null";
    } else {
        dmp_referType = "O" // opener
        dmp_referURL = dmp_opener;
    }
} else {
    dmp_referType = "L"; // link
    dmp_referURL = dmp_referrer;
}

// Initialization
var dmp_siteId = 702;
var dmp_pageId = -1;

if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/event0802/"){
    dmp_pageId = 6017;
}else if (dmp_fullPath == "http://www.samsungplay.com.cn/index.jsp"){
    dmp_pageId = 6016;
}else if (dmp_fullPath == "http://www.samsungplay.com.cn/index.jsp?smsession=no"){
    dmp_pageId = 5591;
}else if (dmp_fullPath == "http://www.samsungplay.com.cn/product/mp3_players_main.jsp"){
    dmp_pageId = 5570;
}else if (dmp_fullPath == "http://www.samsungplay.com.cn/product/mp3_players_main.jsp?smsession=no"){
    dmp_pageId = 5592;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/200710/index.html"){
    dmp_pageId = 5748;
}else if (dmp_fullPath == "http://www.samsungshop.com.cn/defaultmall/sitemap/event/promotion_mp4t08.jsp"){
    dmp_pageId = 5995;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/event0801/index.aspx"){
    dmp_pageId = 6033;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/event0804_moki/index.aspx"){
    dmp_pageId = 6100;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/event0804_bluetooth/"){
    dmp_pageId = 6115;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/event0806_yp-s2/"){
    dmp_pageId = 6133;
}else if (dmp_fullPath == "http://mp3.zol.com.cn/topic/957195.html"){
    dmp_pageId = 5749;
}else if (dmp_fullPath == "http://www.yesky.com/kpzhuanti/282/8162282.shtml"){
    dmp_pageId = 5751;
}else if (dmp_fullPath == "http://play3.pconline.com.cn/online080616/"){
    dmp_pageId = 5750;
}else if (dmp_fullPath == "http://play.pconline.com.cn/doodle/"){
    dmp_pageId = 5752;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/event0807_yp-s3/"){
    dmp_pageId = 6199;
}else if (dmp_fullPath == " http://www.samsungplay.com.cn/product/mp3_player_detail.jsp"){
    dmp_pageId = 5600;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/dv/200710/index.html"){
    dmp_pageId = 5744;
}
//  MP3  Oct

if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/event0922/"){
    dmp_pageId = 5753;
}else if (dmp_fullPath == ""){
    dmp_pageId = 5755;
}else if (dmp_fullPath == ""){
    dmp_pageId = 5756;
}else if (dmp_fullPath == ""){
    dmp_pageId = 5757;
}else if (dmp_fullPath == ""){
    dmp_pageId = 4131;
}else if (dmp_fullPath == ""){
    dmp_pageId = 4121;
}else if (dmp_fullPath == ""){
    dmp_pageId = 4059;
}else if (dmp_fullPath == ""){
    dmp_pageId = 4132;
}else if (dmp_fullPath == ""){
    dmp_pageId = 5765;
}else if (dmp_fullPath == ""){
    dmp_pageId = 3496;
}else if (dmp_fullPath == ""){
    dmp_pageId = 5754;
}else if (dmp_fullPath == ""){
    dmp_pageId = 4126;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6303;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6304;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6305;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6306;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6307;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6308;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6309;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6310;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6311;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6312;
}
// 9years  0810

if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/9years/"){
    dmp_pageId = 6317;
}else if (dmp_fullPath == "http://www.yesky.com/kpzhuanti/41/8543041.shtm"){
    dmp_pageId = 6318;
}else if (dmp_fullPath == "http://www1.pconline.com.cn/zt/samsung/081024/"){
    dmp_pageId = 6319;
}else if (dmp_fullPath == "http://mp3.zol.com.cn/topic/1105548.html"){
    dmp_pageId = 6320;
}else if (dmp_fullPath == "http://cn.samsungmobile.com/cn/phone/view/phone.jsp?productid=sgh-g508e"){
    dmp_pageId = 6321;
}else if (dmp_fullPath == "http://www.samsungplay.com.cn/index.jsp"){
    dmp_pageId = 6322;
}else if (dmp_fullPath == "http://www.samsung.com/cn/consumer/detail/detail.do?group=camerascamcorders <http://www.samsung.com/cn/consumer/detail/detail.do?group=camerascamcorders&type=cameras&subtype=nvseries&model_cd=ec-nv100bca/cn> &type=cameras&subtype=nvseries&model_cd=ec-nv100bca/cn"){
    dmp_pageId = 6323;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/dv/200809/main.html"){
    dmp_pageId = 6324;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6354;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6355;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6356;
}else if (dmp_fullPath == ""){
    dmp_pageId = 6357;
}

//  MP3  P3  0901

if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/200901/?cid=cn_banner_pconline_samsung-mp3-p3-feb-2009_200902"){
    dmp_pageId = 6545;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/200901/?cid=cn_banner_zol_samsung-mp3-p3-feb-2009_200902"){
    dmp_pageId = 6545;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/200901/?cid=cn_banner_it168_samsung-mp3-p3-feb-2009_200902"){
    dmp_pageId = 6545;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/200901/?cid=cn_banner_yesky_samsung-mp3-p3-feb-2009_200902"){
    dmp_pageId = 6545;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/200901/?cid=cn_banner_youku_samsung-mp3-p3-feb-2009_200902"){
    dmp_pageId = 6545;
}else if (dmp_fullPath == "http://support-cn.samsung.com/campaign/mp3/200901/?cid=cn_banner_sohu_samsung-mp3-p3-feb-2009_200902"){
    dmp_pageId = 6545;
}
if (dmp_fullPath.startsWith("http://support-cn.samsung.com/campaign/mp3/200901/")){
    dmp_pageId = 6545;
}
if (dmp_fullPath == ""){
    dmp_pageId = 6824;
}

//  200907 

if (dmp_fullPath.startsWith("http://support-cn.samsung.com/campaign/mp3/summerplan/")){
    dmp_pageId = 6848;
}else if (dmp_fullPath.startsWith("http://support-cn.samsung.com/campaign/mp3/20090714/default.htm")){
    dmp_pageId = 6864;
}
//  200911

if (dmp_fullPath.startsWith("http://support-cn.samsung.com/campaign/mp3/20091125/new/")){
    dmp_pageId = 7233;
}


// Sending the information to Tracker
var loc="http://site.thinkmedia.cn/stracker"
loc = loc + "/" + "siteid=" + dmp_siteId;
loc = loc + "|" + "pageid=" + dmp_pageId;
loc = loc + "|" + "refertype=" + dmp_referType;
loc = loc + "|" + "refer=" + dmp_referURL + "::" + dmp_param;
document.writeln("<div style=\"visibility:hidden; position:absolute; left:0px; top:0px; width:1px; height:1px;\">");
document.writeln("    <img width=0 height=0 border=0 src="+loc+">");
document.writeln("</div>");
