window.onload = onLoad;

function onLoad() {
	try {
		var pathname = window.location.pathname.toLowerCase();
		
		if (pathname == "/acc_img/addtl/pop_utility02.htm" || pathname == "/acc_img/addtl/pop_utility01.htm") {
			setPopUtilityTableStyle();
		}
		else if (pathname == "/popris/shopping_cart/shopping_cart.aspx") {
			setShoppingCartLineStyle();
		}
		else if (pathname == "/popris/show_article.aspx") {
			var article = window.location.search.substr(1, window.location.search.length -1).split('&');
			
			if (article[0]) {
				if (article[0].toLowerCase() == "article_id=290") {
					setArticle290ParagraphStyle();
				}
			}
		}
	}
	catch (ex) { 
	}
}

function setArticle290ParagraphStyle() {
	var item = document.getElementById("D2Coutter");
	if (item) {
	    var items = item.getElementsByTagName("span");
		setArticle290ItemParagraphStyle(items[5]);
		setArticle290ItemParagraphStyle(items[7]);
	}
}

function setArticle290ItemParagraphStyle(item) {
	if (item) {
        item.style.display = "inline-block";
		item.style.marginTop = 10;
		item.style.width = 510;
    }
}

function setShoppingCartLineStyle() {
	var item = document.getElementById("Table22");
	if (item) {
	    var items = item.getElementsByTagName("td");
	    if (items[2]) {
	        items[2].style.fontSize = 9;
	    }
	}
}

function setPopUtilityTableStyle() {	
	var items = document.getElementsByTagName("table");
	
	if (items.length == 1) {
		items = document.getElementsByTagName("td");
		if (items.length > 0) {
			setTdWidth(items[2], 261, 299);
			setTdWidth(items[3], 138, 100);	    
		} 
	}
}

function setTdWidth(item, oldValue, newValue) {
	if (item !== undefined) {
		if (item.width !== undefined)
		if (item.width == oldValue) {
			item.width = newValue;
		}
	}
}

