function hide(element){
        if(document.getElementById(element)){
       document.getElementById(element).style.display="none";
       }
}
function show(element){
        if(document.getElementById(element)){
        document.getElementById(element).style.display="block";
        }
}

$(function(){
		   
   //after page loads set the src attr
  $("#mostwanted").attr("src","http://community.hottopic.com/hottopic/carousel/carousel_mostwanted_011312.html");
  $("#popculture").attr("src","http://community.hottopic.com/hottopic/carousel/carousel_popculture_011312.html");
  $("#topartists").attr("src","http://community.hottopic.com/hottopic/carousel/carousel_topartists_011312.html");
  $("#newsvideos").attr("src","http://community.hottopic.com/hottopic/carousel/carousel_newsvideos.html");
  
	jQuery.fn.center = function () {
		this.css("position","absolute");
		this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");
		this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
		return this;
	}
	
	//modal box
	var modalArea = '<div id="modalBox" style="z-index:900;"></div>'
	//content box
	var videoContent = '<div id="videoContent" style="z-index:950; width:854px; height:468px; display:none">'+
		//close button
		'<div style="text-align:right"><a href="#" id="closeVideo" style="color:white; text-decoration:none; display:block; font-family:arial; font-size:16px; font-weight:bold;"> X</a></div>'+
		//flash object goes here
'<div id="videoObject"></div>'+
		// flash object end
	'</div>';
	
	
	$("body").append(modalArea + videoContent);
	$("#videoContent").center();
	$("#modalBox").css({backgroundColor: 'black', opacity: .75, height: $(document).height(), position: 'absolute', width: '100%', top: 0, left:0, display: 'none'});

	
var videoObjectCode = '<iframe src="http://community.hottopic.com/hottopic/valentinelookbook/index.html"  scrolling="no" frameBorder="0" style=" border:0px; margin:0px; padding:0px; width:850px; height:500px; overflow:hidden"></iframe>';
	
	$("#videoBtn").click(function(){
			$("#modalBox").css("display","block");	
			$("#videoContent").css("display","block");
			$("#videoObject").html(videoObjectCode);
	});
	$("#closeVideo").click(function(){
			$("#modalBox").css("display","none");	
			$("#videoContent").css("display","none");	
			$("#videoObject").html('');
	});
});

var promoText ='<div id="shippingNote1" style="display:none;position:absolute; top:25px; left:181px; z-index:999; width:486px; height:258px;"><a href="javascript:hide(\'shippingNote1\')"><img src="http://community.hottopic.com/hottopic/images/Landing_Page_Image/detailsbox_website.gif" border="0"/></a></div>'
var openShipping='<img id="shippingNote1" src="http://community.hottopic.com/hottopic/images/clear.gif" style="position:absolute;z-index:1000; left:801px; top:546px;  z-index:999; width:49px; cursor:help; height:19px; border:0px red solid;" onmousedown="show(\'shippingNote1\')"/>';


var Main_bg ='<div style="background:url(http://img.hottopic.com/is/image/HotTopic/20120126_homepage?wid=850) no-repeat; width:850px; height:567px;  margin:0; padding:0; position:relative;">';

<!-- main image -->

var Main_img ='<img src="http://community.hottopic.com/hottopic/images/clear.gif" style="width:850px; height:567px;" border="0" usemap="#Map1" /><map name="Map1" id="Map1"><area shape="rect" coords="553,189,848,364" href="#" id="videoBtn" alt="Get Some"/><area shape="rect" coords="3,496,397,545" href="/hottopic/Valentines.jsp?cm_re=HP-_-Main-_-Valentines" alt="Shop Valentines" /><area shape="rect" coords="2,11,549,498" href="/hottopic/Valentines.jsp?cm_re=HP-_-Main-_-Valentines" alt="Shop Valentines" /><area shape="rect" coords="563,133,688,158" href="/hottopic/Apparel/Bottoms/Denim.jsp?cm_re=HP-_-RightNav-_-DenimBOGO" alt="All Denin Buy One, Get One 50% Off" ><area shape="rect" coords="692,134,839,158" href="/hottopic/Deals.jsp?cm_re=HP-_-RightNav-_-Deals" alt="Shop Deals" ><area shape="rect" coords="553,370,848,545" href="/hottopic/Apparel/Tops.jsp?cm_re=HP-_-RightNav-_-Tops" alt="Shop Tops" /><area shape="rect" coords="396,498,548,544" href="/hottopic/Valentines/getsomevideo.jsp" alt="Watch Video" /></map>';

<!-- floating animated gif  -->
//var gif = '<div style="position:absolute; left:0px; width:548px; height:535px; top:70px;" ><img src="http://img.hottopic.com/is/content/HotTopic/2012022_FlushingHotCash?wid=548" style="width:548px; height:535px;" border="0" usemap="#Map_gif" /><map name="Map_gif" id="Map_gif"><area shape="rect" coords="42,487,123,520" href="/hottopic/Apparel/Tops.jsp?cm_re=HP-_-Main-_-Tops" /><area shape="rect" coords="126,488,252,519" href="/hottopic/Apparel/Bottoms.jsp?cm_re=HP-_-Main-_-Bottoms" /><area shape="rect" coords="254,487,418,519" href="/hottopic/Accessories.jsp?cm_re=HP-_-Main-_-Accessories" /><area shape="rect" coords="421,488,510,519" href="/hottopic/Shoes.jsp?cm_re=HP-_-Main-_-Shoes" /><area shape="rect" coords="22,11,518,475" href="/hottopic/Apparel.jsp?cm_re=HP-_-Main-_-HotCash" /></map></div>';

<!-- floating video  -->
//var Video_Img = '<div style="position:absolute; left:369px; width:466px; height:225px; top:135px;" ><object wmode="transparent" type="application//x-shockwave-flash" width="466" height="225" id="vplayer" data="http://community.hottopic.com/hottopic/flash/video/mpw_player.swf"><param name="flashVars" value="&flv=http://community.hottopic.com/hottopic/flash/DISTURBED_indestructable.flv&jpg=http://community.hottopic.com/flash/disturbedstill.jpg"/><param name="movie" value="http://community.hottopic.com/hottopic/flash/video/mpw_player.swf" /><param name="quality" value="best" /><param name="allowFullScreen" value="true" /><param name=wmode VALUE="transparent"><embed src="http://community.hottopic.com/hottopic/flash/video/mpw_player.swf" width="466" height="225" wmode="transparent"></embed></object></div>';

var Main_bg_end ='</div>';

var mostwanted = '<iframe id="mostwanted" src=""  scrolling="no" frameBorder="0" style=" border:0px; margin:0px; padding:0px; width:850px; height:200px; overflow:hidden; margin-bottom:0px"></iframe>';

var popculture = '<iframe id="popculture" src=""  scrolling="no" frameBorder="0" style=" border:0px; margin:0px; padding:0px; width:850px; height:200px; overflow:hidden; margin-bottom:0px"></iframe>';

var topartists = '<iframe id="topartists" src=""  scrolling="no" frameBorder="0" style=" border:0px; margin:0px; padding:0px; width:850px; height:200px; overflow:hidden; margin-bottom:0px"></iframe>';

var newsvideos = '<iframe id="newsvideos" src=""  scrolling="no" frameBorder="0" style=" border:0px; margin:0px; padding:0px; width:850px; height:200px; overflow:hidden; margin-bottom:10px"></iframe>';

var Content =  promoText + openShipping + Main_bg + Main_img + Main_bg_end + mostwanted + popculture + topartists + newsvideos;


document.write(Content);


