$(document).ready(function()
{

$("#heading_explore").hide();
var show_explore = 0;
$("#explore").click(function () {
	show_explore++;
if(show_explore % 2) {
	$("#heading_explore").slideDown();
}
else {
	$("#heading_explore").slideUp();
}
});
var baseurl = "http://www.dupemonkey.com/";
function encode_utf8( s )
{
  var s = unescape( encodeURIComponent( s ) );
  s = s.replace('\\','');
  s = s.replace('/','');
  return s;
}
function decode_utf8( s )
{
  return decodeURIComponent( escape( s ) );
}

function searchFD() {
$("#search").submit(function () {
var terms = escape(encode_utf8($("input#q").val()));
terms = terms.replace(' ','+');
if(unescape(terms).length >= 3) { 
var url =  "tag/";
var affine = "all"
var vaffine = "/";
var fullurl = baseurl+url+terms+vaffine+affine+vaffine;
window.location.href = fullurl;
return false;
}
else { return false; }
});
}
searchFD();	
$("#thumb_img_green").click(function () {

		$.post(baseurl+"models/thumb.php?green",{ ip:$("#ip").val(),id:$("#id").val(),rand:Math.random() } ,function(data)
		{ 
			location.reload();
	   });
});  
$("#thumb_img_red").click(function () {

		$.post(baseurl+"models/thumb.php?red",{ ip:$("#ip").val(),id:$("#id").val(),rand:Math.random() } ,function(data)
		{ 
			location.reload();
	   });
});  

});  

