$(document).ready(function() {
	$("[id*='spanBreadcrumbRoot']").replaceWith('<span id="ctl00_ctl00_Content_Content_spanBreadcrumbRoot"><a id="ctl00_ctl00_Content_Content_lnkBreadcrumbRoot" href="http://www.tisbookbsu.com/home.aspx">Home</a>&nbsp;&gt;</span>');

	// Change inline background color style of MerchList nav button row //
	$('table [id*=dgMerch] tr').add('table [id*=dgBooks] tr').css('background-color','white');
	
	// Swap default MerchList page nav buttons with custom images //
	//$('input[alt="<<"]').attr("src","SiteImages/11-SchoolImages/11-newSite/11-button_first.png");
	//$('input[alt="<"]').attr("src","SiteImages/11-SchoolImages/11-newSite/11-button_prev.png");
	//$('input[alt=">"]').attr("src","SiteImages/11-SchoolImages/11-newSite/11-button_next.png");
	//$('input[alt=">>"]').attr("src","SiteImages/11-SchoolImages/11-newSite/11-button_last.png");
	
	// Check if we're already logged in.  If so, replace the //
	// "log in" link with the "log out" link, within the     //
	// div using the ID "login".                             //
		
	$('.iFooterPane div:first-child').hide(); 
	
	/* Make changes to the ReCaptcha box on registration page */
	 
	var reg = $('input[value=Register]').parent();
	$('<table id="reg_table"><tr><td id="recap_target" rowspan=2></td><td id="reg_text">To complete your registration, fill in the two security words and hit Register</td></tr><tr><td id="reg_target"></td></tr></table>').appendTo(reg);
	 
	$('#recaptcha_widget_div').appendTo('#recap_target');
	$('#recaptcha_area').css('margin-left','auto').css('margin-right','auto');
	$('input[value=Register]').appendTo('#reg_target');
	$('#reg_table').css('width','715px').css('margin-right','auto').css('margin-left','auto');
	$('#reg_text').css('text-align','center').css('color','#ffffff');
	$('#reg_target').css('text-align','center');

		
	//$('#ctl00_ctl00_div_content_sec').append
	//$('#top').after('<div id="header"><div id="logo"><h1><a href="http://www.tisbookbsu.com/" title="T.I.S College Bookstore"></a></h1><p class="tagline"></p></div><div id="searcharea"><p></p><div id="mySearch"><center><a href="http://www.facebook.com/TISUofIllinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/cham/images/facebook.gif" /></a> <a href="http://twitter.com/#!/tisillinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/cham/images/twitter.gif" /></a> </center></div></div></div>');
	
	//$('<div id="header"><div id="logo"><h1><a href="http://www.tisbookbsu.com/" title="T.I.S College Bookstore"></a></h1><p class="tagline"></p></div><div id="searcharea"><p></p><div id="mySearch"><center><a href="http://www.facebook.com/TISUofIllinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/cham/images/facebook.gif" /></a> <a href="http://twitter.com/#!/tisillinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/cham/images/twitter.gif" /></a> </center></div><div id="myCart"></div></div></div>').appendTo('#ctl00_ctl00_ctl07_dvHtmlContent');
	$('<div id="header"><div id="logo"><h1><a href="http://www.tisbookbsu.com/" title="T.I.S College Bookstore"></a></h1></div><div id="searcharea"><div id="myCart"></div><div id="mySearch"></div></div></div>').appendTo('[id*="div_top_sec"]');
	//<div id="mySearch"><center><a href="http://www.facebook.com/TISUofIllinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/cham/images/facebook.gif" /></a> <a href="http://twitter.com/#!/tisillinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/cham/images/twitter.gif" /></a> </center></div>
	//$('<div id="header"><div id="logo"><h1><a href="http://www.tisbookbsu.com/" title="T.I.S College Bookstore"></a></h1><p class="tagline"></p></div><div id="searcharea"><div id="mySearch"><center><a href="http://www.facebook.com/TISUofIllinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/cham/images/facebook.gif" /></a> <a href="http://twitter.com/#!/tisillinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/cham/images/twitter.gif" /></a> </center></div></div></div>').appendTo('[id*="dvHtmlContent"]');
	
	//$('#content').after('<div id="header"><div id="logo"><h1><a href="http://www.tisbookbsu.com/" title="T.I.S College Bookstore"></a></h1></div><div id="cartSearch"><div id="mySearch"><div id="ctl00_ctl00_ctl06_pnlHorz"><center><a href="http://www.facebook.com/TISUofIllinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/facebook.gif" /></a> <a href="http://twitter.com/#!/tisillinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/twitter.gif" /></a> </center><!-- Shopping cart and login link could go here --><label class="speakonly" id="ctl00_ctl00_ctl06_Label1" for="ctl00_ctl00_ctl06_txtSearchHorz">Search: </label><input name="ctl00$ctl00$ctl06$txtSearchHorz" tabindex="32765" id="ctl00_ctl00_ctl06_txtSearchHorz" onkeypress="return clickButton(event,\'ctl00_ctl00_ctl06_btnSearchHorz\');" type="text" size="25" maxlength="70" value="Search for Merchandise" /> <input name="ctl00$ctl00$ctl06$btnSearchHorz" tabindex="32766" id="ctl00_ctl00_ctl06_btnSearchHorz" type="submit" value="Search" /></div></div></div></div>');
	//$('#content').after('<div id="header"><div id="logo"><h1><a href="http://www.tisbookbsu.com/" title="T.I.S College Bookstore"></a></h1></div><div id="cartSearch"><div id="mySearch"><center><a href="http://www.facebook.com/TISUofIllinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/facebook.gif" /></a> <a href="http://twitter.com/#!/tisillinois" target="_blank"><img height="50" height="50" src="http://www.tisbook.com/newsites/twitter.gif" /></a> </center></div></div></div>');

	//$('#header').after('<div class="menustyle" id="menu"><ul><li><a href="http://www.tisbookbsu.com">Home <br />Page</a></li><li><a href="#" rel="menu1">Cardinal <br />Apparel</a></li><li><a href="#" rel="menu2">Cardinal <br />Giftware</a></li><li><a href="#" rel="menu3">Textbook <br />Department</a></li><li><a href="#" rel="menu4">Alumni &amp; <br />Graduation</a></li><li><a href="#" rel="menu5">School <br />Supplies</a></li></ul><p align="right"></p></div>');
	$('#header').after('<div class="menustyle" id="menu"><ul><li><a href="http://www.tisbookbsu.com">Home <br />Page</a></li><li><a href="#" rel="menu1">Cardinal <br />Apparel</a></li><li><a href="#" rel="menu2">Cardinal <br />Giftware</a></li><li><a href="#" rel="menu3">Textbook <br />Department</a></li><li><a href="#" rel="menu4">Alumni &amp; <br />Graduation</a></li><li><a href="#" rel="menu5">School <br />Supplies</a></li></ul><div><a href="http://www.facebook.com/TISBSU" target="_blank"><img height="45" height="45" src="http://tisbookbsu.com/SiteImages/182-SchoolImages/182-facebook.gif" /></a> <a href="http://twitter.com/TISbsu" target="_blank"><img height="45" height="45" src="http://tisbookbsu.com/SiteImages/182-SchoolImages/182-twitter.gif" /></a></div></div>');
	$('#menu').after('<div class="dropmenu" id="menu1" style="width: 150px"><a href="http://tisbookbsu.com/MerchList.aspx?ID=14144">T-Shirts</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=14044">Sweatshirts</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=14136">Hats</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=14138">Outerwear</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=14139">Polos &amp; Dress Shirts</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=14141">Shorts &amp; Pants</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=14149">Kids Gear</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=14140">Womens Wear</a></div>');
	$('#menu1').after('<div class="dropmenu" id="menu2" style="width: 150px"><a href="http://tisbookbsu.com/MerchList.aspx?ID=16463">Drinkware</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=16462">Car Accessories</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=16464">Golf</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=16465">Holiday</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=16466">Home &amp; Office</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=16467">Jewelry</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=16468">Novelties</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=16469">Tailgating &amp; Outdoors</a> <a href="http://tisbookbsu.com/MerchList.aspx?ID=16470">Toys &amp; Games</a> <a href="http://ballstate.theclasswatch.com/" target="_blank">Illini Class Watches</a></div>');
	$('#menu2').after('<div class="dropmenu" id="menu3" style="width: 225px"><a href="http://tisbookbsu.com/SelectTermDept.aspx">Buy/Rent Online</a> <a href="http://tisbookbsu.com/Buyback.aspx">Sellback Information</a> <a href="http://tisbookbsu.com/SiteText.aspx?id=6639">Rental FAQs</a> <a href="https://tisbookbsu.mybooksandmore.com/MBM/screens/products/more/trade.jsp" target="_blank">Reference Books, Movies, & Music</a></div>');
	$('#menu3').after('<div class="dropmenu" id="menu4" style="width: 150px"><a href="http://tisbookbsu.com/MerchList.aspx?ID=14137">Alumni &amp; Graduation</a> <a href="http://tisbookbsu.universityframes.com/eframe/Welcome.asp?reid=78" target="_blank">Custom Diploma Frames</a> </div>');
	$('#menu4').after('<div class="dropmenu" id="menu5" style="width: 133px"><a href="http://tisbookbsu.com/MerchList.aspx?ID=14142">Supplies</a></div>');
	//$('#menu4').after('<div class="dropmenu" id="menu5" style="width: 175px;"><a href="http://tisbookbsu.com/MerchList.aspx?ID=19156">Binders & Notebooks</a><a href="http://tisbookbsu.com/MerchList.aspx?ID=19160">Pens & Pencils</a><a href="http://tisbookbsu.com/MerchList.aspx?ID=19157">Markers & Highlighters</a><a href="http://tisbookbsu.com/MerchList.aspx?ID=19158">Calculators</a><a href="http://tisbookbsu.com/MerchList.aspx?ID=19159">Misc.</a></div>');
	$('#menu5').after('<div class="subMenu"><a href="http://tisbookbsu.com/Contact.aspx">Contact Us</a> | <a href="http://www.tisbook.com/rewards/" target="_blank">Rewards Card</a> | <a href="http://tisbook.iapplicants.com/" target="_blank">Employment</a> | <a href="http://www.taylorimprints.com/" target="_blank">Taylor Imprinted Sportswear</a> | <a href="http://tisbookbsu.com/StoreAbout.aspx">Store Info</a></div>');
	//$('#content').after('<div class="subMenu"><a href="http://tisbookbsu.com/Contact.aspx">Contact Us</a> | <a href="http://www.tisbook.com/rewards/">Rewards Card</a> | <a href="http://tisbook.iapplicants.com/">Employment</a> | <a href="http://www.facebook.com/TheIlliniShop" target="_blank">The Illini Shop</a> | <a href="http://www.taylorimprints.com/" target="_blank">Taylor Imprinted Sportswear</a> | <a href="http://tisbookbsu.com/StoreAbout.aspx">Store Info</a></div>');
	
	//$("[id*='pnlHorz']").appendTo("#mySearch");
 		
	// Get cart values //
	var cartSubTotal = $('#dvCart span[id*=lblCartTotal]').text();
	var cartItemCount = $('#dvCart span[id*=lblCount]').text();
	
	// Append to div#myCart //
	//$('div#myCart').html('<div><a href="http://tisbookbsu.com/ShoppingCart.aspx">Total Items In Cart</a>: <span>' + cartItemCount + '</span></div><div>Sub Total: <span>' + cartSubTotal + '</span></div><div id="login"></div>');
	$('div#myCart').html('<div id="ctl00_ctl00_ctl11_upMiniCart"><a href="http://tisbookbsu.com/ShoppingCart.aspx" style="color:black">Shopping Cart</a><div>SubTotal: <span>' + cartSubTotal + '</span></div><div>Item Count: <span>' + cartItemCount + '</span></div></div><div id="login"></div>');
	
	if($('div.AspNet-Menu-Vertical a:contains("Log Out")').length) {
		$('div#login').html('<a href="http://tisbookbsu.com/logout.aspx">Log Out</a> / <a href="http://tisbookbsu.com/customeraccount.aspx">Account</a>');
	} else {
		$('div#login').html('<a href="http://tisbookbsu.com/login.aspx">Log In</a>');
	}
	
	$('table.search_v label[id*="lblS"]').addClass('speakonly');
	$('table.search_v label[id*="lblS"]').text('Search: ');
	$('[id*="txtSearch"]').attr('style', '');
	$('[id*="txtSearch"]').attr('size', '25');
	$('[id*="txtSearch"]').attr('value', 'Search');

	$('table.search_v label[id*="lblS"]').appendTo('#mySearch');
	$('[id*="txtSearch"]').appendTo('#mySearch');
	$('[id*="btnSearch"]').appendTo('#mySearch');
	//$('<br />').appendTo('#mySearch');
	$('[id*="listSearch"]').appendTo('#mySearch');
	
	//$("[id*='td_left_sec']").remove();
	$("[id*='dv_Logo']").remove();
	$("[id*='menu_v']").remove();
	$("[id*='div_footer_sec']").remove();
	
	$('div#ctl00_ctl00_div_content_sec').attr('id', 'div_content_sec');
	$('table#tbl_left_cont_right').attr('class', '');
	$('table#tbl_left_cont_right').attr('id', '');
	
	$('div#ctl00_ctl00_Content_ctl00_dvHtmlContent').attr('id', 'dvHtmlContent');
	$('#div_left_sec').remove(); 
	
	//$('link').remove();
	//$('div#ctl00_ctl00_div_top_sec').after('<br /><br />');
	$('#spacerdiv').after($("[id*='dMerchModule51']"));
	$('div.LocationBar').before($("[id*='dMerchModule51']"));
	cssdropdown.startmenu("menu"); 

	/*$("td.donotspeak ~ td").css('width', '');
	$('td.donotspeak').css('padding', '5px');
	$('td.donotspeak').attr('width', '110');
	$('td.donotspeak + td').attr('width', '720');*/
});

 

