// Content: Empty
// Metron is Greek for measure
// Metron is a facade for a vendor implementation for webstatistics/webanalytics, e.g. WebTrends
// Metron is used by all KLM applications
// Metron is created by Walter van der Heiden
// Metron is last changed on 2009-03-23
function Metron(id) {

         // if (typeof(CURRENCIES) == "undefined") {
	//IncludeFile("/travel/nl_nl/static/js/measure/currency.js");
         // }

	if (typeof(id) == "undefined") { // no id > use default id
		this.webtrends = new WebTrends();
		
	} else { // use caller specific id
		this.webtrends = new WebTrends(id);
	}
	if (navigator.cookieEnabled)
	{
		this.webtrends.dcsGetId(); // do initialisation of WebTrends, see doc for usage
	}

}

Metron.prototype.ClearWT = function () {
	for(var item in this.webtrends.WT)
	{
			var dont_do_this = (item == "z_application") 
				|| (item == "z_language")
				|| (item == "z_country");
			
			if(!dont_do_this ){
				delete this.webtrends.WT[item];
			}
	}
}

Metron.prototype.ClearEventWT = function () {
	for(var item in this.webtrends.WT)
	{
			var do_this = (item == "z_event") 
				|| (item == "z_eventtype")
				|| (item == "z_eventplace");
			
			if( do_this ){
				delete this.webtrends.WT[item];
			}
	}
}

/*
	example HTML:
	var _metron=new Metron();
	_metron.measureVariable("z_Countrycode", "au");
	_metron.measureVariable("z_Languagecode", "en");

	var newPageTitle = document.URL;
	newPageTitle = newPageTitle.substring(newPageTitle.lastIndexOf("/")+1, newPageTitle.length); 
	newPageTitle = newPageTitle.substring(0, newPageTitle.lastIndexOf("."));
	_metron.measureVariable("ti", newPageTitle);
	_metron.measuresCommit();		
	_metron.debug();
*/

Metron.prototype.measureVariable = function (key, value) {
	// 2008-12-16 Changed by Anish not to overwrite the existing variables
	if (this.webtrends.WT[key]) {
		this.webtrends.WT[key] += ";" + value;
	} else {
		this.webtrends.WT[key] = value;
	}
}

Metron.prototype.measureAndOverwriteVariable = function (key, value) {
	this.webtrends.WT[key] = value;
}

/* 
 * Function to overwrite a "dcs" tag, like dcsuri
 *  The dcsuri is automatically set by WT, but can be overwritten with this function
 *  _metron.measureAndOverwriteVariableDCS("dcsuri", "newurl.htm");
 *  -> query string value: newurl.htm
 */
Metron.prototype.measureAndOverwriteVariableDCS = function (key, value) {
	this.webtrends.DCS[key] = value;
}

Metron.prototype.measuresCommit = function () {
	this.webtrends.dcsCollect();
  //this.ClearWT();
}

Metron.prototype.debug = function () {
	this.webtrends.dcsDebug();
}

/*
	return URL
	e.g.
	http://www.ite1.klm.com/travel/nl_nl/index_default.html?db=db_tt2#
	
	return:
	travel/nl_nl/index_default.html
*/
Metron.prototype.getURL = function () {
	var returnUrl;
	if(document.URL.indexOf("?") == -1)
	{
		returnUrl = document.URL.substring( document.URL.indexOf("/", 8));
	}
	else
	{
		returnUrl = document.URL.substring( document.URL.indexOf("/", 8), document.URL.indexOf("?") );
	}
	return returnUrl;
}


Metron.prototype.convertAndGetArray = function (inputArray) {

	var _inputArray = new Array();
	
	if(typeof(inputArray[0]) != "undefined")
	{	
		for (var i in inputArray) 
		{
			var key = inputArray[i].key;
			var value = inputArray[i].value;
			_inputArray[key] = value;
		}	
	}
	else
	{
		_inputArray = inputArray;
	}
	return _inputArray;
}
// user-defined functions
/*
	Usage:
		_metron.measureVariablesAndCommit(
			{ 	"z_ebt_eventtype"  : "autocomplete_no_selection_from_list", 
				"z_ebt_eventplace" : "homepage",
				"z_ebt_event"        : "1" 
			} );
*/
Metron.prototype.measureVariablesAndCommit = function (inputArray) {
	var newURL = this.getURL(); 
	var newTitle = newURL; 
	var _inputArray = new Array();

	_inputArray = this.convertAndGetArray(inputArray);
	
	this.webtrends.dcsMultiTrackKLM2(/* DCS.dcsuri */ newTitle, /* WT.ti */ newTitle, _inputArray);	
                //this.ClearWT();
                this.ClearEventWT();
}

/*
	example HTML (hidden INPUT fields with application specific names):
	<input type="hidden" name="M_pnr" value="32FRUI" disabled="disabled"/>
	<input type="hidden" name="M_eo" value="Change Booking" disabled="disabled"/>
	<input type="hidden" name="M_es" value="Offered" disabled="disabled"/>
	<input type="hidden" name="M_eo" value="Cancel Booking" disabled="disabled"/>
	<input type="hidden" name="M_es" value="Offered" disabled="disabled"/>
	
	example JS (specify the Webtrends tagname (without WT.), the HTML Element-type and the HTML Element-name):
	<script type="text/javascript">
	//<![CDATA[
		var _metron = new Metron();
		_metron.measureHTMLElementAndCommit("z_pnr", "input", "M__pnr");
		_metron.measureHTMLElementAndCommit("z_event", "input", "M_eo");
		_metron.measureHTMLElementAndCommit("z_event_status", "input", "M_es");
	//]]>>
	</script>		
*/
Metron.prototype.measureHTMLElementAndCommit = function (wtKey, htmlElement, htmlName) {
	var newURL = this.getURL(); // e.g. http://www.ite1.klm.com/travel/it_it/index_default.htm
	var newTitle = newURL; // e.g. /travel/it_it/index_default.htm

	var inputArray = this.getInputValuesByName(htmlElement, htmlName);
	/*
	inputArray format: [ { "wtKey" : "myKey", "value" : "myValue" }, { } ]
	*/
	
	// 20081119 WvdH: changed to instant processing
	// for (var i = 0; i < inputArray.length; i++) {
	// 	this.webtrends.dcsMultiTrack("DCS.dcsuri", newTitle, "WT.ti", newTitle, "WT." + wtKey, inputArray[i]);
	// }
	this.webtrends.dcsMultiTrackKLM(/* DCS.dcsuri */ newTitle, /* WT.ti */ newTitle, inputArray);
}

/*
<input type="hidden" name="M_ABC" value="32FRUITS" disabled="disabled"/>
<input type="hidden" name="M_KLM" value="Koffered" disabled="disabled"/>
<input type="hidden" name="M_ABC" value="64APPEL" disabled="disabled"/>
<input type="hidden" name="M_ABC" value="16CITRON" disabled="disabled"/>

<script type="text/javascript">
	//<![CDATA[
		var _metron=new Metron();
		_metron.measureHTMLElement("z_abc", "input", "M_ABC");
		_metron.measureHTMLElement("z_def", "input", "M_DEF");
		_metron.measureHTMLElement("z_klm", "input", "M_KLM");
		_metron.measuresCommit();
		_metron.debug();
	//]]>>
</script>
*/
Metron.prototype.measureHTMLElement = function (wtKey, htmlElement, htmlName) {
	var newURL = this.getURL(); // e.g. http://www.ite1.klm.com/travel/it_it/index_default.htm
	var newTitle = newURL; // e.g. /travel/it_it/index_default.htm

	var inputArray = this.getInputValuesByName(htmlElement, htmlName);

	// 2008-12-16 Changed by Anish not to overwrite the existing variables
	if (this.webtrends.WT[wtKey]) {
		this.webtrends.WT[wtKey] += ";" + inputArray[0];
	} else {
		this.webtrends.WT[wtKey] = inputArray[0];
	}
	
	for (var i = 1; i < inputArray.length; i++) {
		this.webtrends.WT[wtKey] += ";" + inputArray[i];
	}
}

// Same but for the DCS array of data
Metron.prototype.measureHTMLElement2 = function (wtKey, htmlElement, htmlName) {
	var newURL = this.getURL(); // e.g. http://www.ite1.klm.com/travel/it_it/index_default.htm
	var newTitle = newURL; // e.g. /travel/it_it/index_default.htm

	var inputArray = this.getInputValuesByName(htmlElement, htmlName);

	this.webtrends.DCS[wtKey] = inputArray[0];
	
	for (var i = 1; i < inputArray.length; i++) {
		this.webtrends.DCS[wtKey] += ";" + inputArray[i];
	}
}

/*
	Example HTML:
	<input type="hidden" name="M_ABC" value="32FRUITS" />
	<input type="hidden" name="M_KLM" value="Koffered" />
	<input type="hidden" name="M_ABC" value="64APPEL" />
	<input type="hidden" name="M_DEF" value="" />
	<input type="hidden" name="M_XYZ" />

	<script type="text/javascript">
	//<![CDATA[
		var _metron=new Metron();
	//]]>>
	</script>
	<script type="text/javascript">
	//<![CDATA[
	function something(object) {
		for (var i=0; i < object.valueList.length; i++) {
			object.valueList[i].value = object.valueList[i].value + " *2= " + object.valueList[i].value;
		}	
	}

	var valueItem1 = new valueItem("input", "M_ABC", "walter");
	var valueItem2 = new valueItem("input", "M_KLM", "willem");
	var valueItem3 = new valueItem("input", "M_DEF", "willem");
	var valueItem4 = new valueItem("input", "M_DEG", "");
	var valueItem5 = new valueItem("input", "M_DEH");
	var valueItem6 = new valueItem("input", "M_XYZ", "");
	
	var testObject = new analyticsInfo(null, 
		[ valueItem1, valueItem2, valueItem3, valueItem4, valueItem5, valueItem6 ], 
		"ti");
	_metron.measureHTMLElementAndCommitObject(testObject);	
	_metron.debug();		

	//]]>>
	</script>
*/
function analyticsInfo(operation, valueList, wtKey) {
	this.operation = operation;
	this.valueList = valueList;
	this.wtKey = wtKey;
}

function valueItem(htmlElement, htmlName, value) {
	this.htmlElement = htmlElement;
	this.htmlName = htmlName;
	this.value = value;
}

/*
	2008-12-16:
	The following method clears just the WT data parameters. The DCS parameters will still remain.
	Added by Anish - exe43
*/
Metron.prototype.clearWAParameters = function() {
	this.webtrends.WT = {};
}

/*
	2008-12-16:
	The following method Process the analyticsInfo object and retains the data without committing.
	Added by Anish - exe43
*/
Metron.prototype.measureAnalyticsObject = function (object) {
	var inputArray = object.valueList;
	
	for (var i = 0; i < inputArray.length; i++) {
		var tmp = inputArray[i].value;
		// test if it is (not) necessary to overwrite the value
		if (typeof(tmp) == "undefined") { // the override value is not defined, so use the supplied data
			tmp = this.getInputValuesByName(inputArray[i].htmlElement, inputArray[i].htmlName);
		} // else the override value is defined, so use that one
		object.valueList[i].value = tmp;
//alert("html-elem="+inputArray[i].htmlElement+"\nhtml-name="+inputArray[i].htmlName+"\nhtml-value="+this.getInputValuesByName(inputArray[i].htmlElement, inputArray[i].htmlName)+"\noverride="+inputArray[i].value+"\nobject.value="+object.valueList[i].value);
	}

	if (object.operation != null) { // post-processing function is defined, so call it
		object.operation(object);
		//  since the object or valueList can be changed we do not sent it to WebTrends
		// it is the responsibility of the application to call this function again, but without the operation
		return;
		
	} else {
		
		this.webtrends.WT[object.wtKey] = inputArray[0].value;
		
		for (var i = 1; i < inputArray.length; i++) {
			this.webtrends.WT[wtKey] += ";" + inputArray[i].value;
		}
			
	}
}

Metron.prototype.measureHTMLElementAndCommitObject = function (object) {
	var inputArray = object.valueList;
	
	for (var i = 0; i < inputArray.length; i++) {
		var tmp = inputArray[i].value;
		// test if it is (not) necessary to overwrite the value
		if (typeof(tmp) == "undefined") { // the override value is not defined, so use the supplied data
			tmp = this.getInputValuesByName(inputArray[i].htmlElement, inputArray[i].htmlName);
		} // else the override value is defined, so use that one
		object.valueList[i].value = tmp;
//alert("html-elem="+inputArray[i].htmlElement+"\nhtml-name="+inputArray[i].htmlName+"\nhtml-value="+this.getInputValuesByName(inputArray[i].htmlElement, inputArray[i].htmlName)+"\noverride="+inputArray[i].overrideValue+"\nobject.value="+object.valueList[i].value);
	}

	if (object.operation != null) { // post-processing function is defined, so call it
		object.operation(object);
		//  since the object or valueList can be changed we do not sent it to WebTrends
		// it is the responsibility of the application to call this function again, but without the operation
		return;
		
	} else {
		var newURL = this.getURL(); 
		var newTitle = newURL; 
		// pass the array with values to a modified dcsMultiTrack function
		this.webtrends.dcsMultiTrackKLM(/* DCS.dcsuri */ newTitle, /* WT.ti */ newTitle, inputArray);
	}
}

Metron.prototype.getInputValuesByName = function (tagName, inputName){
	var inputValues = new Array();
	var inputFields = document.getElementsByTagName(tagName);
	for (var i = 0; i < inputFields.length; i++) {
		if (inputFields[i].name == inputName) {
			inputValues[inputValues.length] = inputFields[i].value;
		}
	}
	return inputValues;
}


/*
 * Functions for currency conversions
 */

function IncludeFile(file) {  /* This function includes the given file*/
		
		var js_url = "http://www.klm.com" + file;
		if ( location.protocol == "https:" ){
			js_url = js_url.replace("http:", "https:");
		}
		var headID = document.getElementsByTagName("head")[0];         
		var newScript = document.createElement('script');
		newScript.type = 'text/javascript';
		newScript.src = js_url;
		headID.appendChild(newScript);
}

 

Array.prototype.findKey = function(searchStr) {

/* This function finds the index of the search value in the array*/ 

       var returnIndex = -1;                                                   

       for (i=0; i<this.length; i++) {                                                                                        

                          if (this[i].key.toUpperCase()==searchStr.toUpperCase()) {                                      

                                    return i;

        }

      }

      return returnIndex;

    }

 

Metron.prototype.getExchangeRate = function (curr) {

/* This function gets a currency parameter and returns the value of that currency*/ 
                       

            var returnVal=0;

            var keyIndex=-1;

            if (typeof(CURRENCIES) != "undefined") { //successfull include of JS

                        keyIndex=CURRENCIES.findKey(curr);    //find the currency                      

                        if(keyIndex>=0){

                                    returnVal=CURRENCIES[keyIndex].value;

                                    if(isNaN(returnVal)){                                            //currency is not numeric

                                                returnVal=0;                                                      

                                    }

                                    if (returnVal != 0){

                                                returnVal = 1 / returnVal;

                                    }                                   

                        } 

            }

 

            

            return returnVal;

}

 

Metron.prototype.convertCurrencyToEuro = function (curr, val) {

/* This function gets a currency parameter and a local value and returns the EUR value of that currency*/ 

            var returnVal=0;

            var keyIndex=-1;

            if (typeof(CURRENCIES) != "undefined")  {            //successfull include of JS                                              

                        keyIndex=CURRENCIES.findKey(curr);      //find the currency

                        if(keyIndex>=0){

                                    returnVal=CURRENCIES[keyIndex].value;

                                    if(isNaN(returnVal)){                                            //currency is not numeric

                                                returnVal=0;                                                                                          

                                    }

                                    if (returnVal != 0){

                                                returnVal = 1 / returnVal;

                                    }                                   

                        } 

            }

               return returnVal*val;

}
// Do not use any or call any methods below because that are not guaranteed to work
// Do not copy new WebTrends code and overwrite the code below because it contains customizations

// WebTrends SmartSource Data Collector Tag
// Version: 8.5.0     
// Tag Builder Version: 2.0.0
// Created: 9/22/2008 10:56:37 AM

function WebTrends(newID){
	var fullDomain = window.location.hostname;
	var lightDomain = fullDomain.substring(fullDomain.indexOf(".airfrance"), fullDomain.length);

	var that=this;
	// begin: user modifiable
	if (typeof(newID) == "undefined") { // no id > use default id
		this.dcsid = "dcs8i7h6p00000om5mqog2xmv_9h5e"; // le			
	} else { // use caller specific id
		this.dcsid = newID;
	}
	this.domain="statse.webtrendslive.com";
	this.timezone=1;
	this.fpcdom=lightDomain;
	this.onsitedoms=lightDomain;
	this.downloadtypes="xls,doc,pdf,txt,csv,zip";
	this.trackevents=true;
	this.enabled=true;
	this.i18n=false;
	this.fpc="WT_FPC";
	// end: user modifiable
	this.DCS={};
	this.WT={};
	this.DCSext={};
	this.images=[];
	this.index=0;
	this.exre=(function(){return(window.RegExp?new RegExp("dcs(uri)|(ref)|(aut)|(met)|(sta)|(sip)|(pro)|(byt)|(dat)|(p3p)|(cfg)|(redirect)|(cip)","i"):"");})();
	this.re=(function(){return(window.RegExp?(that.i18n?{"%25":/\%/g}:{"%09":/\t/g,"%20":/ /g,"%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g,"%22":/\"/g,"%7F":/\x7F/g,"%A0":/\xA0/g}):"");})();
}
WebTrends.prototype.dcsGetId=function(){
	if (this.enabled&&(document.cookie.indexOf(this.fpc+"=")==-1)&&(document.cookie.indexOf("WTLOPTOUT=")==-1)){
		document.write("<scr"+"ipt type='text/javascript' src='"+"http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+this.domain+"/"+this.dcsid+"/wtid.js"+"'><\/scr"+"ipt>");
	}
}
WebTrends.prototype.dcsGetCookie=function(name){
	var cookies=document.cookie.split("; ");
	var cmatch=[];
	var idx=0;
	var i=0;
	var namelen=name.length;
	var clen=cookies.length;
	for (i=0;i<clen;i++){
		var c=cookies[i];
		if ((c.substring(0,namelen+1))==(name+"=")){
			cmatch[idx++]=c;
		}
	}
	var cmatchCount=cmatch.length;
	if (cmatchCount>0){
		idx=0;
		if ((cmatchCount>1)&&(name==this.fpc)){
			var dLatest=new Date(0);
			for (i=0;i<cmatchCount;i++){
				var lv=parseInt(this.dcsGetCrumb(cmatch[i],"lv"));
				var dLst=new Date(lv);
				if (dLst>dLatest){
					dLatest.setTime(dLst.getTime());
					idx=i;
				}
			}
		}
		return unescape(cmatch[idx].substring(namelen+1));
	}
	else{
		return null;
	}
}
WebTrends.prototype.dcsGetCrumb=function(cval,crumb,sep){
	var aCookie=cval.split(sep||":");
	for (var i=0;i<aCookie.length;i++){
		var aCrumb=aCookie[i].split("=");
		if (crumb==aCrumb[0]){
			return aCrumb[1];
		}
	}
	return null;
}
WebTrends.prototype.dcsGetIdCrumb=function(cval,crumb){
	var id=cval.substring(0,cval.indexOf(":lv="));
	var aCrumb=id.split("=");
	for (var i=0;i<aCrumb.length;i++){
		if (crumb==aCrumb[0]){
			return aCrumb[1];
		}
	}
	return null;
}
WebTrends.prototype.dcsIsFpcSet=function(name,id,lv,ss){
	var c=this.dcsGetCookie(name);
	if (c){
		return ((id==this.dcsGetIdCrumb(c,"id"))&&(lv==this.dcsGetCrumb(c,"lv"))&&(ss==this.dcsGetCrumb(c,"ss")))?0:3;
	}
	return 2;
}
WebTrends.prototype.dcsFPC=function(){
	if (document.cookie.indexOf("WTLOPTOUT=")!=-1){
		return;
	}
	var WT=this.WT;
	var name=this.fpc;
	var dCur=new Date();
	var adj=(dCur.getTimezoneOffset()*60000)+(this.timezone*3600000);
	dCur.setTime(dCur.getTime()+adj);
	var dExp=new Date(dCur.getTime()+315360000000);
	var dSes=new Date(dCur.getTime());
	WT.co_f=WT.vt_sid=WT.vt_f=WT.vt_f_a=WT.vt_f_s=WT.vt_f_d=WT.vt_f_tlh=WT.vt_f_tlv="";
	if (document.cookie.indexOf(name+"=")==-1){
		if ((typeof(gWtId)!="undefined")&&(gWtId!="")){
			WT.co_f=gWtId;
		}
		else if ((typeof(gTempWtId)!="undefined")&&(gTempWtId!="")){
			WT.co_f=gTempWtId;
			WT.vt_f="1";
		}
		else{
			WT.co_f="2";
			var curt=dCur.getTime().toString();
			for (var i=2;i<=(32-curt.length);i++){
				WT.co_f+=Math.floor(Math.random()*16.0).toString(16);
			}
			WT.co_f+=curt;
			WT.vt_f="1";
		}
		if (typeof(gWtAccountRollup)=="undefined"){
			WT.vt_f_a="1";
		}
		WT.vt_f_s=WT.vt_f_d="1";
		WT.vt_f_tlh=WT.vt_f_tlv="0";
	}
	else{
		var c=this.dcsGetCookie(name);
		var id=this.dcsGetIdCrumb(c,"id");
		var lv=parseInt(this.dcsGetCrumb(c,"lv"));
		var ss=parseInt(this.dcsGetCrumb(c,"ss"));
		if ((id==null)||(id=="null")||isNaN(lv)||isNaN(ss)){
			return;
		}
		WT.co_f=id;
		var dLst=new Date(lv);
		WT.vt_f_tlh=Math.floor((dLst.getTime()-adj)/1000);
		dSes.setTime(ss);
		if ((dCur.getTime()>(dLst.getTime()+1800000))||(dCur.getTime()>(dSes.getTime()+28800000))){
			WT.vt_f_tlv=Math.floor((dSes.getTime()-adj)/1000);
			dSes.setTime(dCur.getTime());
			WT.vt_f_s="1";
		}
		if ((dCur.getDay()!=dLst.getDay())||(dCur.getMonth()!=dLst.getMonth())||(dCur.getYear()!=dLst.getYear())){
			WT.vt_f_d="1";
		}
	}
	WT.co_f=escape(WT.co_f);
	WT.vt_sid=WT.co_f+"."+(dSes.getTime()-adj);
	var expiry="; expires="+dExp.toGMTString();
	var cur=dCur.getTime().toString();
	var ses=dSes.getTime().toString();
	document.cookie=name+"="+"id="+WT.co_f+":lv="+cur+":ss="+ses+expiry+"; path=/"+(((this.fpcdom!=""))?("; domain="+this.fpcdom):(""));
	var rc=this.dcsIsFpcSet(name,WT.co_f,cur,ses);
	if (rc!=0){
		WT.co_f=WT.vt_sid=WT.vt_f_s=WT.vt_f_d=WT.vt_f_tlh=WT.vt_f_tlv="";
		WT.vt_f=WT.vt_f_a=rc;
    }
}
WebTrends.prototype.dcsIsOnsite=function(host){
	if (host.length>0){
	    host=host.toLowerCase();
	    if (host==window.location.hostname.toLowerCase()){
		    return true;
	    }
	    if (typeof(this.onsitedoms.test)=="function"){
		    return this.onsitedoms.test(host);
	    }
	    else if (this.onsitedoms.length>0){
		    var doms=this.dcsSplit(this.onsitedoms);
		    var len=doms.length;
		    for (var i=0;i<len;i++){
			    if (host==doms[i]){
			        return true;
			    }
		    }
	    }
	}
	return false;
}
WebTrends.prototype.dcsTypeMatch=function(pth, typelist){
	var type=pth.substring(pth.lastIndexOf(".")+1,pth.length);
	var types=this.dcsSplit(typelist);
	var tlen=types.length;	
	for (var i=0;i<tlen;i++){
		if (type==types[i]){
			return true;
		}
	}
	return false;
}
WebTrends.prototype.dcsEvt=function(evt,tag){
	var e=evt.target||evt.srcElement;
	while (e.tagName&&(e.tagName!=tag)){
		e=e.parentElement||e.parentNode;
	}
	return e;
}
WebTrends.prototype.dcsNavigation=function(evt){
	return "";
}
WebTrends.prototype.dcsBind=function(event,func){
	if ((typeof(func)=="function")&&document.body){
		if (document.body.addEventListener){
			document.body.addEventListener(event, func.wtbind(this), true);
		}
		else if(document.body.attachEvent){
			document.body.attachEvent("on"+event, func.wtbind(this));
		}
	}
}
WebTrends.prototype.dcsET=function(){
	var e=(navigator.appVersion.indexOf("MSIE")!=-1)?"click":"mousedown";
	this.dcsBind(e,this.dcsDownload);
	this.dcsBind(e,this.dcsFormButton);
	this.dcsBind(e,this.dcsOffsite);
	this.dcsBind(e,this.dcsAnchor);
}
/*
	Calling: this.webtrends.dcsMultiTrackKLM("DCS.dcsuri", newTitle, "WT.ti", newTitle,  array);
*/
/*
 * inputArray = [ { "wtKey" : "myKey", "value" : "myValue" }, { "wtKey" : "myKey2", "value" : "myValue2" },  ]
*/
WebTrends.prototype.dcsMultiTrackKLM = function( dcsUri, wtTi, inputArray ) {
	var bTi = false;
	var bDCSuri = false;

	for (var i = 0; i < inputArray.length;i ++) {
		this.WT[ inputArray[i].wtKey ] = "" + inputArray[i].value;
		if(inputArray[i].wtKey == "ti")
		{
			bTi = true;
		}
		if(inputArray[i].wtKey == "dcsuri")
		{
			bDCSuri = true;
		}
	}
	if(!bDCSuri){
		this.DCS["dcsuri"] = dcsUri;
	}
	if(!bTi){
		this.WT["ti"] = wtTi;
	}	
	var dCurrent=new Date();
	this.DCS.dcsdat=dCurrent.getTime();
	this.dcsFunc(this.dcsFPC());
	//this.dcsTag();
	this.dcsCollect();

	// clear data so next call doesn't contain the old values
	//this.WT = {};
}
/*
	Original WebTrends function that works with multiple function arguments
	Calling: this.webtrends.dcsMultiTrackKLM("DCS.dcsuri", newTitle, "WT.ti", newTitle, "WT." + inputArray[i].wtKey, inputArray[i].value);

*/

/*
 * inputArray = { "prop" : "value", "prop2" : "value2" }
*/
WebTrends.prototype.dcsMultiTrackKLM2 = function( dcsUri, wtTi, inputArray ) {
	
	var bTi = false;
	var bDCSuri = false;
	
	for (var prop in inputArray) {
		this.WT[ prop ] = "" + inputArray[prop];
		if(prop == "ti")
		{
			bTi = true;
		}
		if(prop == "dcsuri")
		{
			bDCSuri = true;
		}
		if (prop.indexOf('WT.')==0){
			this.WT[prop.substring(3)]=inputArray[prop];
		}
		else if (prop.indexOf('DCS.')==0){
			this.DCS[prop.substring(4)]=inputArray[prop];
		}
		else if (prop.indexOf('DCSext.')==0){
			this.DCSext[prop.substring(7)]=inputArray[prop];
		}	
	}
	if(!bDCSuri){
		this.DCS["dcsuri"] = dcsUri;
	}
	if(!bTi){
		this.WT["ti"] = wtTi;
	}	
		
	var dCurrent=new Date();
	this.DCS.dcsdat=dCurrent.getTime();
	this.dcsFunc(this.dcsFPC());
	//this.dcsTag();
	this.dcsCollect();

	// clear data so next call doesn't contain the old values
	//this.WT = {};
}

WebTrends.prototype.dcsMultiTrack=function(){
	var args=dcsMultiTrack.arguments?dcsMultiTrack.arguments:arguments;
	if (args.length%2==0){
		for (var i=0;i<args.length;i+=2){
			if (args[i].indexOf('WT.')==0){
				this.WT[args[i].substring(3)]=args[i+1];
			}
			else if (args[i].indexOf('DCS.')==0){
				this.DCS[args[i].substring(4)]=args[i+1];
			}
			else if (args[i].indexOf('DCSext.')==0){
				this.DCSext[args[i].substring(7)]=args[i+1];
			}
		}
		var dCurrent=new Date();
		this.DCS.dcsdat=dCurrent.getTime();
		this.dcsFunc(this.dcsFPC());
		this.dcsTag();
	}
}
WebTrends.prototype.dcsSplit=function(list){
	var items=list.toLowerCase().split(",");
	var len=items.length;
	for (var i=0;i<len;i++){
		items[i]=items[i].replace(/^\s*/,"").replace(/\s*$/,"");
	}
	return items;
}
// Code section for Track clicks to download links.
WebTrends.prototype.dcsDownload=function(evt){
	evt=evt||(window.event||"");
	if (evt&&((typeof(evt.which)!="number")||(evt.which==1))){
		var e=this.dcsEvt(evt,"A");
		if (e.href){
		    var hn=e.hostname?(e.hostname.split(":")[0]):"";
		    if (this.dcsIsOnsite(hn)&&this.dcsTypeMatch(e.pathname,this.downloadtypes)){
		        var qry=e.search?e.search.substring(e.search.indexOf("?")+1,e.search.length):"";
		        var pth=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
		        var ttl="";
		        var text=document.all?e.innerText:e.text;
		        var img=this.dcsEvt(evt,"IMG");
		        if (img.alt){
			        ttl=img.alt;
		        }
		        else if (text){
			        ttl=text;
		        }
		        else if (e.innerHTML){
			        ttl=e.innerHTML;
		        }
		        this.dcsMultiTrack("DCS.dcssip",hn,"DCS.dcsuri",pth,"DCS.dcsqry",e.search||"","WT.ti","Download:"+ttl,"WT.dl","20","WT.nv",this.dcsNavigation(evt));
		        this.DCS.dcssip=this.DCS.dcsuri=this.DCS.dcsqry=this.WT.ti=this.WT.dl=this.WT.nv="";
		    }
		}
	}
}
// Code section for Track form button clicks.
WebTrends.prototype.dcsFormButton=function(evt){
	evt=evt||(window.event||"");
	if (evt&&((typeof(evt.which)!="number")||(evt.which==1))){
		var tags=["INPUT","BUTTON"];
		for (var j=0;j<tags.length;j++){
			var e=this.dcsEvt(evt,tags[j]);
			var type=e.type||"";
			if (type&&((type=="submit")||(type=="image")||(type=="button")||(type=="reset"))||((type=="text")&&((evt.which||evt.keyCode)==13))){
				var uri="";
				var ttl="";
				var qry="";
				var id=0;
				if (e.form){
					// begin: field capture
					// end: field capture
					uri=e.form.action||window.location.pathname;
					ttl=e.form.id||e.form.name||e.form.className||"Unknown";
					id=(e.form.method&&(e.form.method.toLowerCase()=="post"))?"27":"26";
				}
				else{
					uri=window.location.pathname;
					ttl=e.name||e.id||"Unknown";
					id=(tags[j].toLowerCase()=="input")?"28":"29";
				}
				if (uri&&ttl&&(evt.keyCode!=9)){
					this.dcsMultiTrack("DCS.dcsuri",uri,"DCS.dcsqry",qry,"WT.ti","FormButton:"+ttl,"WT.dl",id,"WT.nv",this.dcsNavigation(evt));
				}
				this.DCS.dcsuri=this.DCS.dcsqry=this.WT.ti=this.WT.dl=this.WT.nv="";
				break;
			}
		}
	}
}
// Code section for Track clicks to links leading offsite.
WebTrends.prototype.dcsOffsite=function(evt){
	evt=evt||(window.event||"");
	if (evt&&((typeof(evt.which)!="number")||(evt.which==1))){
		var e=this.dcsEvt(evt,"A");
		if (e.href){
		    var hn=e.hostname?(e.hostname.split(":")[0]):"";
		    var pr=e.protocol||"";
		    if ((hn.length>0)&&(pr.indexOf("http")==0)&&!this.dcsIsOnsite(hn)){
			    var qry=e.search?e.search.substring(e.search.indexOf("?")+1,e.search.length):"";
			    var pth=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
			    var trim=true;
			    this.dcsMultiTrack("DCS.dcssip",hn,"DCS.dcsuri",pth,"DCS.dcsqry",trim?"":qry,"WT.ti","Offsite:"+hn+pth+qry,"WT.dl","24","WT.nv",this.dcsNavigation(evt));
			    this.DCS.dcssip=this.DCS.dcsuri=this.DCS.dcsqry=this.WT.ti=this.WT.dl=this.WT.nv="";
		    }
		}
	}
}

// Code section for Track clicks to links that contain anchors.
WebTrends.prototype.dcsAnchor=function(evt){
	evt=evt||(window.event||"");
	if (evt&&((typeof(evt.which)!="number")||(evt.which==1))){
		var e=this.dcsEvt(evt,"A");
		if (e.href){
		    var hn=e.hostname?(e.hostname.split(":")[0]):"";
		    if (this.dcsIsOnsite(hn)&&e.hash&&(e.hash!="")&&(e.hash!="#")){
		        var qry=e.search?e.search.substring(e.search.indexOf("?")+1,e.search.length):"";
			    var pth=e.pathname?((e.pathname.indexOf("/")!=0)?"/"+e.pathname:e.pathname):"/";
			    this.dcsMultiTrack("DCS.dcssip",hn,"DCS.dcsuri",pth+e.hash,"WT.ti","Anchor:"+e.hash,"WT.dl","21","WT.nv",this.dcsNavigation(evt));
			    this.DCS.dcssip=this.DCS.dcsuri=this.WT.ti=this.WT.dl=this.WT.nv="";
		    }
		}
	}
}
WebTrends.prototype.dcsAdv=function(){
	if (this.trackevents&&(typeof(this.dcsET)=="function")){
		if (window.addEventListener){
			window.addEventListener("load",this.dcsET.wtbind(this),false);
		}
		else if (window.attachEvent){
			window.attachEvent("onload",this.dcsET.wtbind(this));
		}
	}
	this.dcsFunc(this.dcsFPC());
}
WebTrends.prototype.dcsVar=function(){
	var dCurrent=new Date();
	var WT=this.WT;
	var DCS=this.DCS;
	WT.tz=parseInt(dCurrent.getTimezoneOffset()/60*-1)||"0";
	WT.bh=dCurrent.getHours()||"0";
	WT.ul=navigator.appName=="Netscape"?navigator.language:navigator.userLanguage;
	if (typeof(screen)=="object"){
		WT.cd=navigator.appName=="Netscape"?screen.pixelDepth:screen.colorDepth;
		WT.sr=screen.width+"x"+screen.height;
	}
	if (typeof(navigator.javaEnabled())=="boolean"){
		WT.jo=navigator.javaEnabled()?"Yes":"No";
	}
	if (document.title){
		// 2008-10-01 WvdH: Bugfix! WebTrends doesn't accept overwriting the WT.ti tag (now it does!)
		if (WT.ti == "") { // WT.ti tag not set by our JavaScript, so WebTrends may do it
			if (window.RegExp) {
				var tire=new RegExp("^"+window.location.protocol+"//"+window.location.hostname+"\\s-\\s");
				WT.ti=document.title.replace(tire,"");
			} else {
				WT.ti=document.title;
			}
		} // else WT.ti tag is set by our JavaScript, e.g. structure-group title used for the WT.ti tag
	}
	WT.js="Yes";
	WT.jv=(function(){
		var agt=navigator.userAgent.toLowerCase();
		var major=parseInt(navigator.appVersion);
		var mac=(agt.indexOf("mac")!=-1);
		var ff=(agt.indexOf("firefox")!=-1);
		var ff0=(agt.indexOf("firefox/0.")!=-1);
		var ff10=(agt.indexOf("firefox/1.0")!=-1);
		var ff15=(agt.indexOf("firefox/1.5")!=-1);
		var ff20=(agt.indexOf("firefox/2.0")!=-1);
		var ff3up=(ff&&!ff0&&!ff10&!ff15&!ff20);
		var nn=(!ff&&(agt.indexOf("mozilla")!=-1)&&(agt.indexOf("compatible")==-1));
		var nn4=(nn&&(major==4));
		var nn6up=(nn&&(major>=5));
		var ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1));
		var ie4=(ie&&(major==4)&&(agt.indexOf("msie 4")!=-1));
		var ie5up=(ie&&!ie4);
		var op=(agt.indexOf("opera")!=-1);
		var op5=(agt.indexOf("opera 5")!=-1||agt.indexOf("opera/5")!=-1);
		var op6=(agt.indexOf("opera 6")!=-1||agt.indexOf("opera/6")!=-1);
		var op7up=(op&&!op5&&!op6);
		var jv="1.1";
		if (ff3up){
			jv="1.8";
		}
		else if (ff20){
			jv="1.7";
		}
		else if (ff15){
			jv="1.6";
		}
		else if (ff0||ff10||nn6up||op7up){
			jv="1.5";
		}
		else if ((mac&&ie5up)||op6){
			jv="1.4";
		}
		else if (ie5up||nn4||op5){
			jv="1.3";
		}
		else if (ie4){
			jv="1.2";
		}
		return jv;
	})();
	WT.ct="unknown";
	if (document.body&&document.body.addBehavior){
		try{
			document.body.addBehavior("#default#clientCaps");
			WT.ct=document.body.connectionType||"unknown";
			document.body.addBehavior("#default#homePage");
			WT.hp=document.body.isHomePage(location.href)?"1":"0";
		}
		catch(e){
		}
	}
	if (document.all){
		WT.bs=document.body?document.body.offsetWidth+"x"+document.body.offsetHeight:"unknown";
	}
	else{
		WT.bs=window.innerWidth+"x"+window.innerHeight;
	}
	WT.fv=(function(){
		var i,flash;
		if (window.ActiveXObject){
			for(i=10;i>0;i--){
				try{
					flash=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
					return i+".0";
				}
				catch(e){
				}
			}
		}
		else if (navigator.plugins&&navigator.plugins.length){
			for (i=0;i<navigator.plugins.length;i++){
				if (navigator.plugins[i].name.indexOf('Shockwave Flash')!=-1){
					return navigator.plugins[i].description.split(" ")[2];
				}
			}
		}
		return "Not enabled";
	})();
	WT.slv=(function(){
		var slv="Not enabled";
		try{     
			if (navigator.userAgent.indexOf('MSIE')!=-1){
				var sli = new ActiveXObject('AgControl.AgControl');
				if (sli){
					slv="Unknown";
				}
			}
			else if (navigator.plugins["Silverlight Plug-In"]){
				slv="Unknown";
			}
		}
		catch(e){
		}
		if (slv!="Not enabled"){
			var i,j,v;
			if ((typeof(Silverlight)=="object")&&(typeof(Silverlight.isInstalled)=="function")){
				for (j=9;j>=0;j--){
					for(i=3;i>0;i--){
						v=i+"."+j;
						if (Silverlight.isInstalled(v)){
							slv=v;
							break;
						}
					}
					if (slv==v){
						break;
					}
				}
			}
		}
		return slv;
	})();
	if (this.i18n){
		if (typeof(document.defaultCharset)=="string"){
			WT.le=document.defaultCharset;
		} 
		else if (typeof(document.characterSet)=="string"){
			WT.le=document.characterSet;
		}
		else{
			WT.le="unknown";
		}
	}
	WT.tv="8.5.0";
//	WT.sp="@@SPLITVALUE@@";
	//WT.dl="0";
	if (typeof(WT.z_dl) != 'undefined') {
		WT.dl=WT.z_dl;
	}
	else{
		WT.dl="0";
	}
	WT.ssl=(window.location.protocol.indexOf('https:')==0)?"1":"0";
	DCS.dcsdat=dCurrent.getTime();
	DCS.dcssip=window.location.hostname;

	// 2008-10-31 WvdH: Bugfix! WebTrends doesn't accept overwriting the DCS.dcsuri tag (now it does!)
	if (typeof(DCS.dcsuri) == "undefined") { // DCS.dcsuri tag not set by our JavaScript, so WebTrends may do it
		DCS.dcsuri = window.location.pathname;
	} // else DCS.dcsuri tag is set by our JavaScript, e.g. application specific URL used for the DCS.dcsuri tag

	WT.es=DCS.dcssip+DCS.dcsuri;
	if (window.location.search){
		DCS.dcsqry=window.location.search;
	}
	if ((window.document.referrer!="")&&(window.document.referrer!="-")){
		if (!(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)<4)){
			DCS.dcsref=window.document.referrer;
		}
	}
}
WebTrends.prototype.dcsEscape=function(S, REL){
	if (REL!=""){
		S=S.toString();
		for (var R in REL){
 			if (REL[R] instanceof RegExp){
				S=S.replace(REL[R],R);
 			}
		}
		return S;
	}
	else{
		return escape(S);
	}
}
WebTrends.prototype.dcsA=function(N,V){
	if (this.i18n&&(this.exre!="")&&!this.exre.test(N)){
		if (N=="dcsqry"){
			var newV="";
			var params=V.substring(1).split("&");
			for (var i=0;i<params.length;i++){
				var pair=params[i];
				var pos=pair.indexOf("=");
				if (pos!=-1){
					var key=pair.substring(0,pos);
					var val=pair.substring(pos+1);
					if (i!=0){
						newV+="&";
					}
					newV+=key+"="+this.dcsEncode(val);
				}
			}
			V=V.substring(0,1)+newV;
		}
		else{
			V=this.dcsEncode(V);
		}
	}
	return "&"+N+"="+this.dcsEscape(V, this.re);
}
WebTrends.prototype.dcsEncode=function(S){
	return (typeof(encodeURIComponent)=="function")?encodeURIComponent(S):escape(S);
}
WebTrends.prototype.dcsCreateImage=function(dcsSrc){
	if (document.images){
		this.images[this.index]=new Image();
		this.images[this.index].src=dcsSrc;
		this.index++;
	}
	else{
		document.write('<IMG ALT="" BORDER="0" NAME="DCSIMG" WIDTH="1" HEIGHT="1" SRC="'+dcsSrc+'">');
	}
}
WebTrends.prototype.dcsMeta=function(){
	var elems;
	if (document.all){
		elems=document.all.tags("meta");
	}
	else if (document.documentElement){
		elems=document.getElementsByTagName("meta");
	}
	if (typeof(elems)!="undefined"){
		var length=elems.length;
		for (var i=0;i<length;i++){
			var name=elems.item(i).name;
			var content=elems.item(i).content;
			var equiv=elems.item(i).httpEquiv;
			if (name.length>0){
				if (name.indexOf("WT.")==0){
					this.WT[name.substring(3)]=content;
				}
				else if (name.indexOf("DCSext.")==0){
					this.DCSext[name.substring(7)]=content;
				}
				else if (name.indexOf("DCS.")==0){
					this.DCS[name.substring(4)]=content;
				}
			}
		}
	}
}
WebTrends.prototype.getQryOnlyWT = function(qryVal) {
	var newV="";
	var bFirst = true;
	var params=qryVal.substring(1).split("&");
	for (var i=0;i<params.length;i++){
		var pair=params[i];
		var pos=pair.indexOf("=");
		if (pos!=-1){
			var key=pair.substring(0,pos);
			var val=pair.substring(pos+1);
			if ( ( key.indexOf("WT") == 0 ) || ( key.indexOf("DCS") == 0 ) ) {
				if (! bFirst){
					newV+="&";
				}
				newV += key+"="+this.dcsEncode(val);
				bFirst = false;
			}
		}
	}
	return newV;
}
WebTrends.prototype.dcsTag=function(){
	if (document.cookie.indexOf("WTLOPTOUT=")!=-1){
		return;
	}
	var WT=this.WT;
	var DCS=this.DCS;
	var DCSext=this.DCSext;
	var i18n=this.i18n;

	var P = "";
	var strBase="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+this.domain+(this.dcsid==""?'':'/'+this.dcsid)+"/dcs.gif?";
	var strDCSqryTotal = "";
	var strDCSqryOnlyWT = "";
	var strDCSqryNone = this.dcsA("dcsqry", "NONE" );
	var strDCSRefTotal = "";
	var strDCSRefStatic = "";
	var strDCSRefNone = this.dcsA("dcsref", "NONE" );

	if (i18n){
		WT.dep="";
	}
	for (var N in DCS){
 		if (DCS[N]&&(typeof DCS[N]!="function")){
			if ( N == 'dcsqry' ) {
				strDCSqryTotal = this.dcsA(N,DCS[N]);
			}
			else if ( N == 'dcsref' ) {
				strDCSRefTotal = this.dcsA(N,DCS[N]);
			}
			else {
				strBase+=this.dcsA(N,DCS[N]);
			}
		}
	}
	var keys=["co_f","vt_sid","vt_f_tlv"];
	for (var i=0;i<keys.length;i++){
		var key=keys[i];
		if (WT[key]){
			strBase+=this.dcsA("WT."+key,WT[key]);
			delete WT[key];
		}
	}
	for (N in WT){
		if (WT[N]&&(typeof WT[N]!="function")){
			strBase+=this.dcsA("WT."+N,WT[N]);
		}
	}
	for (N in DCSext){
		if (DCSext[N]&&(typeof DCSext[N]!="function")){
			if (i18n){
				WT.dep=(WT.dep.length==0)?N:(WT.dep+";"+N);
			}
			strBase+=this.dcsA(N,DCSext[N]);
		}
	}
	if (i18n&&(WT.dep.length>0)){
		strBase+=this.dcsA("WT.dep",WT.dep);
	}

	P = strBase + strDCSqryTotal + strDCSRefTotal;

	var iMaxLength = 2048;
	if ( (P.length > iMaxLength) && (navigator.userAgent.indexOf('MSIE') >=0 ) )
	{
		// 1. Check 'dcsqry' and remove all non-Webtrends prefixes
		strDCSqryOnlyWT = this.dcsA("dcsqry", this.getQryOnlyWT(DCS['dcsqry']) );
		P = strBase + strDCSqryOnlyWT + strDCSRefTotal + "&truncated=1";
		if ( P.length > iMaxLength )
		{
			// 2. Check 'dcsref' and leave only the static part
			if ( DCS.dcsref )
			{
				var iPos = DCS.dcsref.indexOf("?");
				if ( iPos > -1 )
				{
					strDCSRefStatic = this.dcsA("dcsref", DCS.dcsref.substr(0,iPos) );
				}
				else
				{
					strDCSRefStatic = strDCSRefTotal;
				}
				P = strBase + strDCSqryOnlyWT + strDCSRefStatic + "&truncated=2";
			}
			if ( P.length > iMaxLength )
			{
				// 3. Check 'dcsref' and remove the total value and set to 'NONE'
				P = strBase + strDCSqryOnlyWT + strDCSRefNone + "&truncated=3";
				if ( P.length > iMaxLength )
				{
					// 4. Check 'dcsqry' and remove the total value and set to 'NONE'
					P = strBase + strDCSqryNone + strDCSRefNone + "&truncated=4";
					if ( P.length > iMaxLength )
					{
						// 5. Set truncated value to 5
						P=P.substring(0,iMaxLength - 13) + "&truncated=5";
					}
				}
			}
		}
	}
	/* Current solution:
	if (P.length>2048&&navigator.userAgent.indexOf('MSIE')>=0){
		// P=P.substring(0,2040)+"&WT.tu=1";
		// 2009-07-01 WvdH: fix long URL's
		P=P.substring(0,2035)+"&truncated=1";
	}
	*/
	this.dcsCreateImage(P);
	this.WT.ad="";
}
WebTrends.prototype.dcsFunc=function(func){
	if (typeof(func)=="function"){
		func();
	}
}
WebTrends.prototype.dcsDebug=function(){
	var t=this;
	var i=t.images[0].src;
	var q=i.indexOf("?");
	var r=i.substring(0,q).split("/");
	var m="<b>Protocol</b><br><code>"+r[0]+"<br></code>";
	m+="<b>Domain</b><br><code>"+r[2]+"<br></code>";
	m+="<b>Path</b><br><code>/"+r[3]+"/"+r[4]+"<br></code>";
	m+="<b>Query Params</b><code>"+i.substring(q+1).replace(/\&/g,"<br>")+"</code>";
	m+="<br><b>Cookies</b><br><code>"+document.cookie.replace(/\;/g,"<br>")+"</code>";
	if (t.w&&!t.w.closed){
		t.w.close();
	}
	t.w=window.open("","dcsDebug","width=500,height=650,scrollbars=yes,resizable=yes");
	t.w.document.write(m);
	t.w.focus();
}
WebTrends.prototype.dcsCollect=function(){
    if (this.enabled){
        this.dcsVar();
        this.dcsMeta();
        this.dcsFunc(this.dcsAdv());
        this.dcsTag();
    }
}

function dcsMultiTrack(){
	if (typeof(_tag)!="undefined"){
		return(_tag.dcsMultiTrack());
	}
}

Function.prototype.wtbind = function(obj){
	var method=this;
	var temp=function(){
		return method.apply(obj,arguments);
	};
	return temp;
}

var CURRENCIES = [
{key:"AED", value:      4.519520},
{key:"AFN", value:     60.908800},
{key:"ALL", value:    137.005000},
{key:"AMD", value:    454.663000},
{key:"ANG", value:      2.202560},
{key:"AOA", value:    114.816000},
{key:"ARS", value:      4.831050},
{key:"AUD", value:      1.410360},
{key:"AWG", value:      2.202560},
{key:"AZN", value:      0.989100},
{key:"BAM", value:      1.955830},
{key:"BBD", value:      2.460960},
{key:"BDT", value:     85.417400},
{key:"BGN", value:      1.955830},
{key:"BHD", value:      0.462780},
{key:"BIF", value:   1515.710000},
{key:"BMD", value:      1.230480},
{key:"BND", value:      1.706410},
{key:"BOB", value:      8.637970},
{key:"BRL", value:      2.190720},
{key:"BSD", value:      1.230480},
{key:"BWP", value:      8.644180},
{key:"BZD", value:      2.460960},
{key:"CAD", value:      1.268450},
{key:"CDF", value:   1110.390000},
{key:"CHF", value:      1.362180},
{key:"CLP", value:    656.913000},
{key:"CNY", value:      8.370740},
{key:"COP", value:   2334.890000},
{key:"CRC", value:    650.710000},
{key:"CUP", value:      1.139300},
{key:"CVE", value:    110.265000},
{key:"CYP", value:      0.585270},
{key:"CZK", value:     25.771600},
{key:"DJF", value:    216.306000},
{key:"DKK", value:      7.442240},
{key:"DOP", value:     44.666400},
{key:"DZD", value:     91.787200},
{key:"EEK", value:     15.646600},
{key:"EGP", value:      6.988630},
{key:"ETB", value:     16.709900},
{key:"EUR", value:      1.000000},
{key:"FJD", value:      2.414130},
{key:"FRF", value:      6.559570},
{key:"GBP", value:      0.827080},
{key:"GEL", value:      2.270800},
{key:"GHS", value:      1.768630},
{key:"GIP", value:      0.827080},
{key:"GMD", value:     35.831800},
{key:"GNF", value:   6215.160000},
{key:"GTQ", value:      9.843220},
{key:"GYD", value:    251.386000},
{key:"HKD", value:      9.570700},
{key:"HNL", value:     23.250000},
{key:"HRK", value:      7.194560},
{key:"HTG", value:     48.911600},
{key:"HUF", value:    281.393000},
{key:"IDR", value:  11116.100000},
{key:"ILS", value:      4.736300},
{key:"INR", value:     56.821000},
{key:"IQD", value:   1437.200000},
{key:"IRR", value:  12308.500000},
{key:"ISK", value:    157.043000},
{key:"JMD", value:    104.806000},
{key:"JOD", value:      0.871670},
{key:"JPY", value:    111.056000},
{key:"KES", value:     99.717200},
{key:"KGS", value:     56.602100},
{key:"KMF", value:    491.968000},
{key:"KPW", value:    127.502000},
{key:"KRW", value:   1464.460000},
{key:"KWD", value:      0.358460},
{key:"KYD", value:      1.008990},
{key:"KZT", value:    181.073000},
{key:"LAK", value:  10158.600000},
{key:"LBP", value:   1854.950000},
{key:"LKR", value:    139.795000},
{key:"LRD", value:     86.809500},
{key:"LSL", value:      9.316200},
{key:"LTL", value:      3.452800},
{key:"LVL", value:      0.708180},
{key:"LYD", value:      1.624440},
{key:"MAD", value:     11.018300},
{key:"MDL", value:     15.799600},
{key:"MGA", value:   2753.810000},
{key:"MKD", value:     61.351900},
{key:"MMK", value:      7.918140},
{key:"MNT", value:   1692.960000},
{key:"MOP", value:      9.857820},
{key:"MRO", value:    343.548000},
{key:"MUR", value:     39.756800},
{key:"MVR", value:     15.750100},
{key:"MWK", value:    185.702000},
{key:"MXN", value:     15.503400},
{key:"MYR", value:      3.967490},
{key:"MZN", value:     42.082600},
{key:"NAD", value:      9.316200},
{key:"NGN", value:    185.483000},
{key:"NIO", value:     26.242400},
{key:"NLG", value:      2.203710},
{key:"NOK", value:      7.941760},
{key:"NPR", value:     90.913600},
{key:"NZD", value:      1.737540},
{key:"OMR", value:      0.473120},
{key:"PAB", value:      1.230480},
{key:"PEN", value:      3.481150},
{key:"PGK", value:      3.335820},
{key:"PHP", value:     56.597700},
{key:"PKR", value:    105.169000},
{key:"PLN", value:      4.079210},
{key:"PYG", value:   5859.530000},
{key:"QAR", value:      4.478950},
{key:"RON", value:      4.238370},
{key:"RSD", value:    104.093000},
{key:"RUB", value:     38.155000},
{key:"RWF", value:    720.991000},
{key:"SAR", value:      4.614730},
{key:"SBD", value:      9.646080},
{key:"SCR", value:     15.384600},
{key:"SDD", value:    288.313000},
{key:"SDG", value:      3.076200},
{key:"SEK", value:      9.547970},
{key:"SGD", value:      1.706410},
{key:"SKK", value:     30.126000},
{key:"SLL", value:   4833.950000},
{key:"SOS", value:   1929.150000},
{key:"SRD", value:      3.408430},
{key:"STD", value:  24500.000000},
{key:"SVC", value:     10.766700},
{key:"SYP", value:     57.611100},
{key:"SZL", value:      9.316200},
{key:"THB", value:     39.814500},
{key:"TND", value:      1.861150},
{key:"TOP", value:      2.339310},
{key:"TRY", value:      1.931020},
{key:"TTD", value:      7.788910},
{key:"TWD", value:     39.459700},
{key:"TZS", value:   1797.000000},
{key:"UAH", value:      9.745610},
{key:"UGX", value:   2772.270000},
{key:"USD", value:      1.230480},
{key:"UYU", value:     25.679700},
{key:"UZS", value:   1958.520000},
{key:"VEB", value:   3090.950000},
{key:"VEF", value:      5.284480},
{key:"VND", value:  23353.300000},
{key:"VUV", value:    125.036000},
{key:"WST", value:      3.135560},
{key:"XAF", value:    655.957000},
{key:"XCD", value:      3.322300},
{key:"XDR", value:      0.834450},
{key:"XEU", value:      1.000000},
{key:"XOF", value:    655.957000},
{key:"XPF", value:    119.332000},
{key:"YER", value:    273.167000},
{key:"YUM", value:     71.274200},
{key:"ZAR", value:      9.316200},
{key:"ZMK", value:   6281.570000},
{key:"ZWR", value:     95.473300}];
