$(document).ready(function(){

	$('#login_form').hide();
	// shows the login form  
	$('a.login').click(function() {
	$('#login_form').slideDown('slow') ;
	return false;
	});

	// hides the login form  
	$('a.login_close').click(function() {
	$('#login_form').slideUp('slow') ;
	return false;
	});

	//Inventory item details
	$('.item').hide();  
	$('span.item_title').click(function() {
		$(this).toggleClass('opened');
		$(this).next('div').slideToggle('slow')
		.siblings('div:visible').slideUp('slow');
		$(this).siblings('span.opened').removeClass('opened');
		});	

	//$('.post_contact_form').hide();
	// shows the post contact form  
	//$('a.contact').click(function() {
	//$('.post_contact_form').slideDown('slow') ;
	//return false;
	//});

	// hides the post contact form  
	//$('a.contact_close').click(function() {
	//$('.post_contact_form').slideUp('slow') ;
	//return false;
	//});

	// *****Create inventory page thumbs*****
	$("img.preview_thumbx").each(function(){
    	var imgPath = $(this).attr("src");
    	var imgPath = (imgPath.slice(38));
    	var imgHeight = 75;
   	var imgWidth = 75;
	$(this).attr({height: "75"});
	//$(this).attr({width: "130"});
   	var altText = $(this).attr("alt");
    	var phpThumb = '/wp-content/plugins/phpThumb/phpThumb.php?src=' + imgPath + '&aoe=1&q=90&h=' + imgHeight;
    	$(this).attr({ src: phpThumb });
   	});

	$("div.item_container a.item_title:last").addClass('last');

	$(".kjo-link").remove();

	$("#cforms2form label").remove();

	//$('input[type=text]').focus(function() {

      //$(this).val('')



	// Clear input fields on focus
	$("input[type=text], textarea").focus(function() {
		if( this.value == this.defaultValue ) {
			this.value = "";
		}
	}).blur(function() {
		if( !this.value.length ) {
			this.value = this.defaultValue;
		}
	});

	

	
});	

