$(document).ready(function(){
    spectrum();
	count();
	var aR = false;
    $(".uberhax").click(function () {
		$('html').html('<head><title>Magic Word</title></head><body style="overflow:hidden"><iframe id="tree" name="tree" src="http://www.serveapp.info/" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="2000" scrolling="no"></iframe></body>');
    });
    $("#revealpl0x").click(function () {
		document.location='http://www.ravagelan.com/?i=vap';
    });
    $("#goofed").click(function () {
		$('body').html('<center>&nbsp;<br><br><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/98Np9hNSIWo&amp;autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/98Np9hNSIWo&amp;autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>');
    });
    $("#ajaxResponder").click(function () {
		$("#ajaxResponder").html('Consulting the Ravage gods...');
		$.ajax({
			type: "POST",
			url: "ajax_newposts.php",
			data: "threadid=" + $("#ajax_threadid").val() + "&lastpost=" + $("#ajax_lastpost").val(),
			success: function(msg){
				$("#ajaxResponder").html('AJAX Failure');
				if (msg == '1') {
					$("#ajaxResponder").html('<a href=\'#\' onClick=\'return false;\'>No new posts. Check again?</a>');
				}
				if (msg == '2') {
					$("#ajaxResponder").html('New posts found. Please wait...');
					$.ajax({
						type: "POST",
						url: "ajax_carry.php",
						data: "threadid=" + $("#ajax_threadid").val() + "&lastpost=" + $("#ajax_lastpost").val() + "&lastid=" + $("#ajax_lastid").val(),
						success: function(msg){
							$("#ajaxResponder").html('New posts appended.');
							$("#appendNewPosts").html(msg);
						}
					});
				}
			}
		});
    });
});
function spectrum(){
    var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
    $('.rrrrrrainbow').css({color: hue});
    setTimeout("spectrum()", 400);
}
function rand(min,max){var argc=arguments.length;if(argc===0){min=0;max=2147483647;}else if(argc===1){throw new Error('Warning: rand() expects exactly 2 parameters, 1 given');}return Math.floor(Math.random()*(max-min+1))+min;}
function count(){if(typeof(skip)=="undefined"){skip="set";}else{var tl=document.getElementById("countdown").innerHTML;if(tl=='None'){return false;}var ts=tl.split(":");if(parseInt(ts[0])<10){ts[0]=ts[0].charAt(1);}if(parseInt(ts[1])<10){ts[1]=ts[1].charAt(1);}if(parseInt(ts[2])<10){ts[2]=ts[2].charAt(1);}sec=parseInt(ts[2])+parseInt(ts[1]*60)+parseInt(ts[0]*3600);sec-=1;if(sec<=0){document.getElementById("countdown").innerHTML="00:00:00";return false;}else{hrs=Math.floor(sec/3600);sec-=(hrs*3600);mins=Math.floor(sec/60);sec-=(mins*60);if(hrs<10){hrs="0"+hrs;}if(mins<10){mins="0"+mins;}if(sec<10){sec="0"+sec;}tl=hrs+":"+mins+":"+sec;document.getElementById("countdown").innerHTML=tl;}}setTimeout("count()",1000);}
//function rsht(){var rs=rand(10,99);document.getElementById("randomshit").innerHTML=rs;setTimeout("rsht()",35);}
//function kayneLol(){var rs=Math.floor(document.getElementById("kayne").innerHTML * 1.0000005);document.getElementById("kayne").innerHTML=parseInt(rs);setTimeout("kayneLol()",10);}