/* This javascript file handles the clicks for the Nov 2009 hero images section
 * as well as the automatic transition and fade outs between the hero images 
 */ 

if (!(typeof(addEvent)=='function')) {
  function addEvent(name,obj,f) {
    if (window.attachEvent) {
      obj.attachEvent("on"+name,f);
    } else if (window.addEventListener) {
      obj.addEventListener(name,f,false);
    }
  }
}

if (!(typeof(removeEvent)=='function')) {
	function removeEvent(name,obj,f) {
		if (window.attachEvent) {
			obj.detachEvent("on"+name,f);
		} else if (window.addEventListener) {
			obj.removeEventListener(name,f,false);
		}
	}
}

addEvent('load',window,function() {
	
	var ppcContainer = document.getElementById("ppc-landing-june2010");
	var guarantees_link = document.getElementById("suppliesguys-guarantees");
	var hundredpercent_link = document.getElementById("hundred-percent");
	var oemguarantee_link = document.getElementById("oem-guarantee");
	var seals = [];
	
	//Create the popup and its contents
	var popupDiv = document.createElement("div");
	popupDiv.className = "popup";
	ppcContainer.appendChild(popupDiv);
	var popupContent = document.createElement("div");
	popupContent.className = "popup-content";
	popupDiv.appendChild(popupContent);
	var closeButton = document.createElement("p");
	closeButton.className = "close-button";
	popupContent.appendChild(closeButton);
	var popupImage = document.createElement("div");
	popupContent.appendChild(popupImage);
	var popupTitle = document.createElement("p");
	popupTitle.className = "popup-title";
	popupContent.appendChild(popupTitle);
	var popupText = document.createElement("div");
	popupText.className = "popup-text";
	popupContent.appendChild(popupText);
	
		
	//Attach and event listener for the close button
	addEvent('click',closeButton,function(){
		popupDiv.style.display = "none";
	});	
			
	function showPopup(e)
	{
		var seal;
		if (window.event) {
      seal=window.event.srcElement;
			window.event.cancelBubble=true;
			window.event.returnValue=false;
		} else {
			seal=e.target;
		}
		
		switch(seal.id)
		{
			case "suppliesguys-guarantees":
				popupImage.className = "seal-tsg";
				popupTitle.innerHTML = "<strong>Supplies Guys Guarantees</strong>";
				popupText.innerHTML = "<p><strong>Best Value</strong></p><p>We at The Supplies Guys are committed to providing you the best value for your money. What that means is our customers get:</p><ul><li>Quality - we carry and sell only the highest quality products to assure the highest levels of satisfaction.</li> 						<li>Convenience - buy on-line or off-line, order through your personalized PURL website or call our 800 number to order by phone, flexible shipping options.</li> 						<li>Service - contact us by phone, online chat, or email for any questions, advice, needs, concerns or issues.</li> 						<li>Economy - our products are competitively priced.</li> 						<li>Commitment - satisfaction is guaranteed or your money back.</li></ul><p><strong>Lifetime Warranty</strong></p><p>All compatible ink and toner products from The Supplies Guys are backed by a lifetime warranty against manufacturer defects. If you happen to get a defective compatible ink or toner consumable, it may be returned for replacement as long as that item has not been discontinued by The Supplies Guys. The Supplies Guys will cover the cost of shipping. Credit will be issued upon return of the item.</p><p>OEM products are covered by each respective manufacturer with a 90-day warranty for ink and toner products and typically a one year warranty on printers (see product Specs for details). Defective OEM ink and toner products can be returned within 90 days of purchase, printers can be returned within 30 days of purchase (excluding Xerox brand products). Unfortunately, The Supplies Guys cannot accept returns of defective Xerox products. Xerox's policy is to deal with the end user, and they will not accept returns from dealers. If you have a defective Xerox product, it may be returned for replacement within 90 days of purchase. Just call or email us and we'll give you the information on how to contact Xerox for replacement procedures. If you have a defective OEM product and the return timeframe has passed, please contact our customer service department for instructions on how to contact the original manufacturer.</p><p><strong>100% Compatibility</strong></p><p>The cartridges you are viewing on this page are guaranteed to be compatible with the printer models listed. Should you find that the cartridge you purchase is not compatible with any of these models, the Supplies Guys offer a compatibility guarantee. This guarantees that you will receive a full refund or replacement at no cost if the cartridge is found to be incompatible with your printer (to be eligible your printer must be included in the list on this page and you must return the original cartridge).</p><p><strong>Genuine Price Guarantee</strong></p><p>At The Supplies Guys we strive to bring you the best value and pricing for Original Equipment Manufacturer (OEM) ink and toner products. We therefore guarantee that, for products available on our website, we will beat the retail price of the same ink and toner products sold directly by an OEM (excluding Dell). In the unlikely event that you find an OEM offering a product for a lower price, simply contact us by chat, email or phone with:</p><ul><li>The OEM manufacturer</li><li>The ink or toner product that matches exactly a product on our website</li><li>The OEM's web page (URL) advertising that product and its price</li></ul><p>Once our customer service representative verifies this information they will immediately give you a lower price.</p><p>Some restrictions apply as follows: OEM product must be the exact same make, model, and color(s) as available on The Supplies Guys website; only ink and toner products are eligible; product must be available for retail purchase directly from an OEM company; the availability and lower retail price of the product from the OEM must be verified by a Supplies Guys representative; Dell products are excluded; applies to the price of the item, prior to any shipping charges, handling fees, taxes, etc.</p>";
				break;	
			case "hundred-percent":
				popupImage.className = "seal-hundred";
				popupTitle.innerHTML = "The Supplies Guys 100% Guarantee";
				popupText.innerHTML = "<p><strong>100% Compatibility Guarantee</strong></p><p>The cartridges you are viewing on this page are guaranteed to be compatible with the printer models listed. Should you find that the cartridge you purchase is not compatible with any of these models, the Supplies Guys offer a compatibility guarantee. This guarantees that you will receive a full refund or replacement at no cost if the cartridge is found to be incompatible with your printer (to be eligible your printer must be included in the list on this page and you must return the original cartridge).</p><p><strong>100% Lifetime Product Warranty</strong></p><p>All compatible ink and toner products from The Supplies Guys are backed by a lifetime warranty against manufacturer defects. If you happen to get a defective compatible ink or toner consumable, it may be returned for replacement as long as that item has not been discontinued by The Supplies Guys. The Supplies Guys will cover the cost of shipping. Credit will be issued upon return of the item.</p><p><strong>100% Satisfaction Guarantee</strong></p><p>If you are not satisfied with a compatible ink or toner product for any reason, you may return opened and partially used products within 45 days of purchase for a free replacement or refund. No restocking fees apply. Shipping charges are non-refundable. Compatible ink and toner supplies being returned for customer dissatisfaction are limited to one set of opened products; all other returned products must be unopened.</p>";
				break;	
			case "oem-guarantee":
                popupImage.className = "seal-oem";
				popupTitle.innerHTML = "The Supplies Guys Genuine Price Guarantee";
				popupText.innerHTML = "<p>At The Supplies Guys we strive to bring you the best value and pricing for Original Equipment Manufacturer (OEM) ink and toner products. We therefore guarantee that, for products available on our website, we will beat the retail price of the same ink and toner products sold directly by an OEM (excluding Dell). In the unlikely event that you find an OEM offering a product for a lower price, simply contact us by chat, email or phone with:</p><ul><li>The OEM manufacturer</li><li>The ink or toner product that matches exactly a product on our website</li><li>The OEM's web page (URL) advertising that product and its price</li></ul><p>Once our customer service representative verifies this information they will immediately give you a lower price.</p><p>Some restrictions apply as follows: OEM product must be the exact same make, model, and color(s) as available on The Supplies Guys website; only ink and toner products are eligible; product must be available for retail purchase directly from an OEM company; the availability and lower retail price of the product from the OEM must be verified by a Supplies Guys representative; Dell products are excluded; applies to the price of the item, prior to any shipping charges, handling fees, taxes, etc.</p>";
				break;		
		}
		
		popupDiv.style.display = "block";
	}//showPopup
	
	seals.push(guarantees_link);
	seals.push(hundredpercent_link);
	seals.push(oemguarantee_link);
	
	for(var i=0; i<seals.length; i++)
		addEvent('click',seals[i],showPopup);
});
