function ECatalogClass(){
	var t = this;
	t.eventCollection = [];
	t.optimalScreenWidth = 1024;
	t.optimalScreenHeight = 768;
	t.stormMarkupParentTagSet = "TABLE";
	t.stormMarkupCatalogTagFlag = "<OBJECT";
	t.stormObjectsToDestroy = ["writeFooterStart","writeFooterMid","writeFooterClose"];
	t.hasRequiredResolution = (screen.width>=t.optimalScreenWidth && screen.height>=t.optimalScreenHeight)?true:false;
	var encodeRedirectURL = function(urlStr,urlSplitStr){
		var httpStr = "http://";
		var trackingURL = httpStr + urlStr.substring(0,urlStr.indexOf(urlSplitStr));
		var redirectURL = urlSplitStr + httpStr + escape(urlStr.substring(urlStr.indexOf(urlSplitStr)+urlSplitStr.length+httpStr.length,urlStr.length));
		var newURL = trackingURL + redirectURL;
		var rE = /&amp;/gi;
		newURL=newURL.replace(rE,"&");
		//alert(newURL);		
		return newURL;
	}
	t.addEvent = function(str){
		t.eventCollection[t.eventCollection.length] = str;
		return t.eventCollection.length; 
	}
	t.loadEvents = function(){
		for(var i=0; i<t.eventCollection.length;i++) {
			eval(t.eventCollection[i]);
		}
	}
	t.buyIt = function(url){
		var buywin = window.open(encodeRedirectURL(url,"DURL="), "buyIt", "width=800,height=600,top=0,left=0,scrollbars=1,resizable=1,toolbar=1,address=1,location=1,status=1,menubar=1");
	    buywin.focus();
	}
	t.externalLink = function(url){
		var externalLinkWin = window.open(url,"externalLink", "width=800,height=600,top=0,left=0,scrollbars=1,resizable=1,toolbar=1,address=1,location=1,status=1,menubar=1");
		externalLinkWin.focus();
	}
	t.launch = function(url){
		var scrollBars = (t.hasRequiredResolution)?"0":"1";
		var eCatalogWin = window.open(url,"eCatalog", "width=1014,height=706,top=0,left=0,scrollbars="+scrollBars+",resizable=0,toolbar=0,address=0,location=0,status=0");
		eCatalogWin.focus();
	}
	t.resizeWindow = function(){
		window.moveTo(0,0);
		window.resizeTo(t.getWidth(),t.getHeight());
		var bodyObj = document.getElementsByTagName("BODY")[0];
		if(bodyObj){
			bodyObj.scroll = (t.hasRequiredResolution)?"no":"yes";
			document.documentElement.style.overflow = (t.hasRequiredResolution)?"hidden":"scroll";//doctype && ie6  
		}else{
			t.addEvent("t.resizeWindow()");
		}
	}
	t.getWidth = function(){
		return (t.hasRequiredResolution)?"1024":"800";
	}
	t.getHeight = function(){
		return (t.hasRequiredResolution)?"740":"570";
	}
	t.stormHandler = function(){
		t.addEvent("t.modifyStormMarkup()");
		for(var i=0; i<t.stormObjectsToDestroy.length; i++){
			eval(t.stormObjectsToDestroy[i]+"= function(){}");
		}
	}
	t.modifyStormMarkup = function(){
		var tagCollection = document.getElementsByTagName(t.stormMarkupParentTagSet);
		for(var j=0; j<tagCollection.length; j++){
			if(tagCollection[j].innerHTML.toUpperCase().indexOf(t.stormMarkupCatalogTagFlag)!=-1){
				tagCollection[j].style.display = "block";
			} 
		}
	}
	t.sendDefaultMailMsg = function(linkStr){
		var emailTo = "";
		var subject = "Check out the Dell E-Catalog";
		var bodyStr = "";
		bodyStr += "I was shopping with the Dell E-Catalog and thought you might enjoy it.%0D%0D";
		bodyStr += "You can see the E-Catalog at " + linkStr + "%0D%0D";
		bodyStr += "About the Dell E-Catalog%0D";
		bodyStr += "The Dell E-Catalog streamlines your business technology shopping. Online and interactive,%0D";
		bodyStr += "the E-Catalog makes shopping simple with one-click access to product customization and%0D";
		bodyStr += "purchasing, up-to-date savings, detailed information, and enhanced content. Available%0D";
		bodyStr += "24/7, shopping for your business is Easy as Dell.%0D";		
		t.emailFriend(emailTo,subject,bodyStr);
	}
	t.emailFriend = function(emailTo,subject,body){
 		var mailtoStr = "mailto:"+emailTo+"?subject="+subject+"&body="+body;;
		window.location = mailtoStr;
	}
	t.constructor = function(){
		window.onload = t.loadEvents;
		t.stormHandler();
		t.resizeWindow();
	}
	t.constructor();
}
var eCatalog = new ECatalogClass();

