// JavaScript Document
var $x=0;
$(document).ready(function(){	
	$("#send_button").attr('disabled',true);
	$("#checktrue").change(function () {
		if(document.getElementById("checktrue").checked==true){
			$("#send_button").attr('disabled',false);
		}else{
			$("#send_button").attr('disabled',true);
		}
	});
	/*$("#checktrue").click(function(){
		$("#captcha_keystring").val('<?=$_SESSION['captcha_keystring']?>');
	});*/
	$("#table2").click(function(){
		$.ajax({
			type: "POST",
			url: "/portfolio/ajax.html",
			data: "what="+$(this).attr('what')+"&offset="+$(this).attr('offset')+"&count="+$(this).attr('count'),
			success: function(msg){
				var count=msg.substr(0,msg.indexOf('!___!'));
				msg=msg.substr(msg.indexOf('!___!')+5,msg.length);
				var offset=msg.substr(0,msg.indexOf('!__!'));
				msg=msg.substr(msg.indexOf('!__!')+4,msg.length);
				$("#table2").attr('count',count);
				$("#table2").attr('offset',offset);
				var div=$("#table2").prev().find('div').last();
				div.html(msg);
				div.slideDown();
				if(offset>count)$("#table2").hide();
			}
		});		
	});
});
