var emailForm = '<div id="emailToFriend">' +
				'<div class="lightbox-canvasClose"><img src="/common/images/btn-closeLightbox.gif" width="9" height="9" alt="Close" border="0" onClick="killLightbox();" /></div>' +
				'<h1 class="prodDtl-name">EMAIL TO A FRIEND</h1>' +
				'<div class="dblLine">&nbsp;</div>' +
				'<p class="emailFriend-prodName">' + productDetailObject.title + '<br />';

				if(productDetailObject.subtitle != undefined) {
					emailForm += 'No. ' + productDetailObject.subtitle;
				}

				emailForm += '</p><p>To email this product detail, please fill out the form below.<br />Items with an asterisk* are required.</p>' +
				'<ul><li class="link"><a href="#">Privacy Statement</a></li></ul>' +
				'<form>' +
				'<input type="hidden" name="urlOfInterest" value="' + productDetailObject.currentUrl + '" />' +
				'<div class="clearfix">' +
					'<div class="emailInput">' +
					'<label for"">Your First Name *</label>' +
					'<input type="Text"/>' +
					'</div>' +
					'<div class="emailInput-right">' +
					'<label for"">Your Last Name *</label>' +
					'<input type="Text"/>' +
					'</div>' +
				'</div>' +
				'<div class="emailInputWide">' +
				'<label for"">Your E-mail *</label>' +
				'<input type="Text"/>' +
				'</div>' +
				'<div class="emailInputWide">' +
				'<label for"">Recipient(s) E-mail <span>(separate multiple addresses with a comma)</span> *</label>' +
				'<input type="Text"/>' +
				'</div>' +
				'<div class="emailTextArea">' +
				'<label for"">Your Comments</label><br />' +
				'<textarea>Hi \n I thought you might be interested in this item I found on the McGuire Furniture site. Just click the link below to see for yourself.</textarea>' +
				'</div>' +
				'<div class="emailToCheckbox">' +
				'<input type="checkbox" id="sendToSelf" class="checkbox" /><label for="sendToSelf">Send a Copy to Self</label>' +
				'</div>' +
				'<div class="submitEmail"><input type="Image" src="/common/images/btn-send-off.gif" width="53" height="19" border="0" alt="send" class="submit" /></div>' +
				'</form>' +
			'</div>';


$(function(){

function emailToFriend(currentPageUrl) {
        var src = "/onlinecatalog/emailToAFriend.mcg?urlOfInterest="+currentPageUrl;
       try {
           var iframe = document.createElement("<iframe frameborder='0' scrolling='no' ></iframe>");

       }   catch(e) {
		var iframe = document.createElement("iframe");
		$(iframe).attr("scrolling", "no");
		$(iframe).attr("frameborder", "0");
        //$(iframe).css("border", "none");
       }

        $(iframe).load(function() {
			var that = this;
			window.setTimeout(function() {
				var width = 393;
				var height = 510;

				if (that.contentWindow) {
					width = $(that.contentWindow.document).find("#emailToFriend").width();
					height = $(that.contentWindow.document).find("#emailToFriend").height();
				} else {
					width = $(that.contentDocument).find("#emailToFriend").width();
					height = $(that.contentDocument).find("#emailToFriend").height();
				}

				$(iframe).attr("width", width);
				$(iframe).attr("height", height);
                $("#emailForm").attr("width", width);
                ieWidthFix();
            }, 100);
            createLightbox();

        });

        $('#lightbox-copy').html('');
        $('#lightbox-copy').append($(iframe));
        $('#lightbox-copy').children("iframe").wrapAll("<div id='emailForm' ></div>")
        $(iframe).attr("src", src);



    }

$("a.email").click(function () {emailToFriend(currentPageUrl)});
             })