// JavaScript Document
$(document).ready(function() {


//--- Grabs argument from URL and places into a text field

	// Read a page's GET URL variables and return them as an associative array.
		function getUrlVars()
		{
				var vars = [], hash;
				var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
				for(var i = 0; i < hashes.length; i++)
				{
						hash = hashes[i].split('=');
						vars.push(hash[0]);
						vars[hash[0]] = hash[1];
				}
				return vars;
		}

	var isbn = getUrlVars()["isbn"];
	var item = getUrlVars()["name"];



//	alert(first);
	$("input#edit-submitted-isbn").val(isbn);
	$("input#edit-submitted-isbn").attr('disabled','disabled');	
	$("input#edit-submitted-item").val(item);
	$("input#edit-submitted-item").attr('disabled','disabled');	





	$('#edit-search-block-form-1').val('Use a keyword, title, author or ISBN');
	$('#edit-search-block-form-1').focus(function () {
		if($(this).val() == 'Use a keyword, title, author or ISBN') {
			$(this).val('').addClass('filled');
		}
	});
	$('#edit-search-block-form-1').blur(function () {
		if($(this).val() == '') {
			$(this).val('Use a keyword, title, author or ISBN').removeClass('filled');
		}
	});

//----  Creates an "All" link next to expanded TV Menu Items

	$('#block-tvmenu-0 .expanded>a, #block-tvmenu-0 .collapsed>a').each(function() {
		$(this).after('<a class="direct" href="'+$(this).attr('href')+'">&nbsp;</a>');
	});
	
//---- Gets rid of the extra hyphen in pseudo-categories

	$("li.collapsed a").each(function() {
		 $(this).html($(this).html().replace(/-/g,""));
	});
	
	

	  $('.node-type-product .cartlink').html($('.node-type-product .cartlink').html().replace('Order Now',''));


//--- Remove Delete Button from Taxonomy Term Edit Screen
	
	$('#taxonomy-form-term #edit-delete').css('display','none');
	$('.user-admin #taxonomy-form-term #edit-delete').css('display','inline-block');




});

