var contentDiv;
var homeUrl = "http://shop.japan-hopper.com";

var tempFunc = {

	linkbox: function() {
		$("div").filter(".linkbox").hover(
			function() {
				$(this).addClass("linkbox_hover");
			},
			function() {
				$(this).removeClass("linkbox_hover");
		});

		$("div").filter(".linkbox").click(function() {
			var thelink = $(this).find('a').eq(0).attr("href");
			window.open(thelink,'_blank','');
			return false;
		});
	}
}



$(function() {

    if($('.q').attr('value') == "") { $('.q').preInput('Keyword(s)'); }

	$('.filetree').treeview({
		collapsed: false,
		animated: "fast"
	});

    $('a.lightbox').lightBox();

	tempFunc.linkbox();

});

$.fn.preInput = function(txt, options) {
	var default_options = {
		class_name: 'pre-input'
	};

	options = $.extend(default_options, options || {});
	return this.each(function(){
		if(typeof this.value == 'undefined') return;

		var elm = $(this);
		elm.val(txt)
		elm.addClass(options.class_name)
		elm.focus(function(){
			if(elm.val() == txt) {
				elm.removeClass(options.class_name)
				elm.val('');
			}
		});
		elm.blur(function(){
			if(elm.val() == '') {
				elm.addClass(options.class_name)
				elm.val(txt)
			}
		});
	});
}

