﻿//alert(1);
var wmx_clid ="ECC";
var wmx_cpid="Projector08";
var wmx_listid="562";
var thisURL=document.URL;
var thisReferral=document.referrer;
var thisTitle=document.title;
var counterURL = "http://epson.emarketing.com.cn/web_service/counter/counter.aspx";
var trackURL="http://epson.emarketing.com.cn/web_service/list/add_s.aspx";
var adTotalOpenURL="http://epson.emarketing.com.cn/web_service/counter/ad_total_open.aspx";

function doWmxCounter()
{
	var targetURL=counterURL+"?";
	targetURL+="client="+wmx_clid+"&campaign="+wmx_cpid+"&url="+encodeURIComponent(thisURL);
	targetURL+="&pname="+encodeURIComponent(thisTitle);
	
		var imgCounter = document.createElement("img");	
		imgCounter.width=1;
		imgCounter.height=1;
		imgCounter.src =targetURL;
                
		//document.write(targetURL+"<br>");
}
doWmxCounter();
//////////////////////////////////////////////////////////////////////////
function doWmxTrack(wmx_flash_btn)
{
	var targetURL=trackURL+"?cli="+wmx_clid+"&li="+wmx_listid;
	targetURL+="&1="+encodeURIComponent(thisURL);
	targetURL+="&2=W_S_UID&3=W_S_SC&4=W_S_IP&5=W_S_DATE";
	targetURL+="&6="+encodeURIComponent(wmx_flash_btn)+"&r="+Math.random();
	
	  var imgCounter = document.createElement("img");	
		imgCounter.width=1;
		imgCounter.height=1;
		imgCounter.src =targetURL;
         //alert(targetURL);
          
}
doWmxTrack("");
////////////////////flash process
function wmx_FlashLoad()
{
		var flash=document.body.getElementsByTagName("object");

	     for(i=0;i<flash.length;i++)
	     {
				try{
				flash[i].attachEvent("FSCommand",eval("ProductFlash_DoFSCommand")); 
				 // IE can't find event handler when dynamic added script, so manually attach event
				}
				catch(e){}
			}
} 

function ProductFlash_DoFSCommand(command, args) 
{
//alert(command);
doWmxTrack(args);
//wmx_thisURL = command;
//wmx_counter();
}
function Do_WMX_Tracing_Init()
 {
       if(document.readyState && document.readyState != "complete")
       {
            setTimeout("Do_WMX_Tracing_Init();",500);
       }
       else
       {	
			wmx_FlashLoad();
		}	
}
Do_WMX_Tracing_Init();
/////  total open
if(document.referrer!= document.URL)
{
    wmx_total_open();
}
function wmx_total_open()
{    
    var imgCounter2;
    if (imgCounter2 != null) imgCounter2.removeNode(true);
    imgCounter2 = document.createElement("div");
    imgCounter2.innerHTML ="<img width=0 height=0 src='" + adTotalOpenURL + "'>";
}
////
