
// Copyright (c) 2000-2008, Mobular Technologies&#174;, Inc.  All Rights
// Reserved.
// Mobular and Mobular Technologies are Registered Trademarks of Mobular
// Technologies, Inc.
// All rights reserved.  Unauthorized reproduction prohibited.
// http://www.mobular.com/
//
 // Mobular Engine Serial Number-131_45_102
 //
 // attributes.js
 //
 // john@mobular.com
 // September 24, 2001
 //
 //
 // Modified February 7, 2002
 // john@mobular.com
 //
 // --> will now look for vendor id (vid)
 // --> and unsubscribe id.
 //
 // Modified March 11, 2002
 // to include specific info for 60 vendors.
 // john@mobular.com
 //--------------------------------------------
 //
 
 var uniqueId = "";
 var vendorId = "";
 var unsubId = "";
 var listId = "";
 var verticalId = "";
 var sourceId = "3";
 var campaignId = "131_45_102";
 var clickNum = 0;
 
 var theHeader = "";
 
 // Try to take the identification variable from the 
 // eesearch tag.
 //
 
 wordLoad = parent.location.href ? parent.location.href : "";
 wordLoad = wordLoad.substring(wordLoad.indexOf("?"));
 
 wordLoad = unescape(wordLoad);
 
 var variables = wordLoad.split("&");
 var testIndex = variables [0];
 
 //
 // It may be the case that this is embedded not in eesearch,
 // but from the index.html tag.
 //
 
 if ((variables.length <= 1) || ( testIndex == "index")){
      var objREEmail = /[\?]*id=([^&]+)[&]*/;
 
      // check for query value
      if (objREEmail.test(wordLoad)) {
         uniqueId = RegExp.$1;
         uniqueId = unescape(uniqueId);
      } else {
 	  	   var uniqueId = "";
      }
 } else {
 	var howmanyIds = variables.length;
 			
 	for (var loop = 0; loop <= howmanyIds - 1; loop++){
 	
 		var testString = variables[loop];
 
          if ( testString.indexOf("?") == 0 ) {
                  testString = testString.substring( 1 );
          }
 		if (testString.indexOf("id=") == 0)
 		{
 			uniqueId = testString.substring(3,testString.length);
 			uniqueId = unescape(uniqueId);
 		}
 		if (testString.indexOf("vid=") == 0){
 			vendorId = variables[loop].substring(4);
 			vendorId = unescape(vendorId);
 			}
 		if (testString.indexOf("uid=") == 0){
 			unsubId = variables[loop].substring(4);
 			unsubId = unescape(unsubId);
 			}
 		if (testString.indexOf("lid=") == 0){
 			listId = variables[loop].substring(4);
 			listId = unescape(listId);
 		}
 		if (testString.indexOf("vertid=") == 0){
 			verticalId = variables[loop].substring(7);
 			verticalId = unescape(verticalId);
 		}
 		if (testString.indexOf("sid=") == 0){
 			sourceId = variables[loop].substring(4);
 			sourceId = unescape(sourceId);
 		}
 
 		if (testString.indexOf("cid=") == 0){
 			campaignId = variables[loop].substring(4);
 			campaignId = unescape(campaignId);
 		}
 
 	}
 	
 }
 
 //
 // end of attributes.
 //
 