$(function() {

$('a[href*="go.php"]').click(function() {
	var str = $(this)[0].toString();
	var id = str.match(/id=([0-9]+)/)[1];
	pageTracker._trackPageview('/site_outgoing/' + id);										
});

// wishlist
/*
var top = $('#wishlist').offset().top - parseFloat($('#wishlist').css('margin-top').replace(/auto/, 0));
$(window).scroll(function(event) {
	var y = $(this).scrollTop();
	if (y >= top) {
		$('#wishlist').addClass("fixed");
	} else {
		$('#wishlist').removeClass("fixed");
	}
});
$("#contentwrap").css("min-height",$("#wishlist").height());
*/

// search input box
var searchinput = $("#searchpanel #kw");
searchinput.focus(function() {
	if (searchinput.val() == "Search!") {
		searchinput.val("");			
	}
});
searchinput.blur(function() {
	if (searchinput.val() == "") {
		searchinput.val("Search!");	
	}	
});

/*
var $wishlist = $("#wishlist"), $p_img = $(".p-img");

$p_img.draggable({
	appendTo: "body",
	helper: "clone",
	zIndex: 100
});

$wishlist.droppable({
	accept: '.p-img',
	activate: function(event,ui) {
		$(this).find("#dropzone").css({background : "#E5F5FC", borderColor: "#0B77BF"});
	},
	deactivate: function(event,ui) {
		$(this).find("#dropzone").css({background : "white", borderColor: "#CCC"});
	}, 
	drop: function(event,ui) {
		var clone = $(ui.draggable).clone();
		var clone_id = clone.attr("class").split(" ")[1];
		var wish_item = $("#wishlist img." + clone_id);
				
		if (wish_item.length > 0) {
			return false;	
		} else {
			$(this).find("#dropzone").after(clone.fadeIn());
			document.cookie = ("wishlist[" + clone_id + "]=" + clone_id);			
		}
	},
	out: function(event,ui) {
		var clone = $(ui.draggable).clone();
		var clone_id = clone.attr("class").split(" ")[1];
		var expdate = new Date();
		expdate.setTime(expdate.getTime() - 1);

		document.cookie = "wishlist[" + clone_id + "]=" + clone_id + "; expires=" + expdate.toGMTString();
		$(ui.draggable).fadeOut().remove();	
	}
});

$wishlist.sortable({
	items: "img"
});

// style corrections
$("#results .panel .mid:last").css("margin-bottom","0");
$("#results table tr:last-child td").css("border-bottom","0");
*/
});