var s = 119;

var count = new Object();

function func() {
    s--;
   document.getElementById('count').innerHTML = s;
  if(s == 0) {
    var tt = document.getElementById('edity');
	new Effect.BlindUp(tt, {duration:0.6});
   }
}

function aa(aa)
{
var tt = document.getElementById(aa);
window.location='retrieveemail.php?em=' + tt.value;

}

function startcount(dy,dt,secs) {

  document.getElementById(dt).innerHTML = s;

if(!count[dy])
{
count[dy] = setInterval('updateCountdown(\''+element+'\')',1000);	
}

}

function showreply(yer,ker)
{

var tt = document.getElementById(yer);
var hh = document.getElementById(ker);

if(hh.style.display == 'none')
{
tt.style.border = '1px solid #8DB5D7';
tt.style.border.right = '0px';
tt.style.color = 'white';
tt.style.background = '#8DB5D7';
new Effect.BlindDown(hh, {duration:0.2});

}
else
{
tt.style.border = '0px';
tt.style.color = '#333';
tt.style.background = 'white' ;
new Effect.BlindUp(hh, {duration:0.2});	
}
	
	
}


function submitcomment(user,story,comment,code,error)
{
	
	var comm = document.getElementById(comment).value;
	var err = document.getElementById(error);
	var cod = document.getElementById(code).value;

	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	
var url = "../../../submitcomment.php";
var params = "comment=" + comm + "&code=" + cod + "&user=" + user + "&story=" + story;
ajaxRequest.open("POST", url, true);

//Send the proper header information along with the request
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajaxRequest.setRequestHeader("Content-length", params.length);
ajaxRequest.setRequestHeader("Connection", "close");
	
	
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
		
		  var resp = ajaxRequest.responseText;
		if(resp == '0')
		   {
			   err.style.width = '100%';
			   err.style.float = 'left';
		  	   err.innerHTML = '<div style="font-family:arial;font-size:14px;font-weight:bold;color:#990000;padding-left:10px">The code you entered is wrong. Please retry.</div>';
		   }
		   else
		   {
			  document.getElementById('comment_box').innerHTML = ''; 
			  var chez = document.getElementById('comments').innerHTML;
			  
			  var xmlDoc = ajaxRequest.responseXML;
			  
			  var auth = xmlDoc.getElementsByTagName("author")[0].childNodes[0].nodeValue;
			  var av = xmlDoc.getElementsByTagName("avatar")[0].childNodes[0].nodeValue;
			  var commy = xmlDoc.getElementsByTagName("comment")[0].childNodes[0].nodeValue;
			  if(av == 'true')
			  {
				av = '<img src="http://mmarocks.com/avatars/default_small.jpg" width="15" height="15" />'  
			  }
			  
			  

			  
			  document.getElementById('comments').innerHTML = chez + '<div style="margin-top:14px;width:100%;border-top:1px solid #447891;background:#9CBBDC;height:28px;float:left"><div style="float:left;padding:6px">' + av + '</div><div style="float:left;font-family:arial;font-size:11px;color:#333;padding-top:7px">by <a href="http://mmarocks.com/users/' + auth + '" style="color:#333"><strong>' + auth + '</strong></a> just now</div><div style="padding-top:4px;padding-right:4px;float:right;"><img src="http://mmarocks.com/images/arrowdown_dis.jpg" width="18" height="18" /></div><div style="padding-top:4px;padding-right:4px;float:right;"><img src="http://mmarocks.com/images/arrowup_dis.jpg" width="18" height="18" /></div><div style="float:right;padding-top:6px;padding-right:7px;font-family:arial;font-size:12px;font-weight:bold;color:#333">+1 vote</div></div><div id="edity"  style="width:100%;background:#EFDC92;height:28px;float:left"><div style="float:left;padding:6px;font-family:arial;font-size:11px;color:#333;"><a href="javascript://" style="color:#333" onclikc=""><strong>Click here</strong></a> to edit (available for <span id="count">120</span> seconds)</div></div><div style="width:100%;float:left;display:table"><div style="text-align:left;float:left;padding-top:9px;padding-left:7px;font-family:arial;font-size:12px;color:#333">' + commy + '</div></div>';
																																																																																																																																																																																																																																																								 

var a = setInterval(func,1000);
																																																																																																																																																																																																																																													 
		   }
		}
	}
	
ajaxRequest.send(params);
}



function fetchcomm(cid,divv)
{
	
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	
var url = "../../../fetchcomm.php";
var params = "cid=" + cid;
ajaxRequest.open("POST", url, true);

//Send the proper header information along with the request
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajaxRequest.setRequestHeader("Content-length", params.length);
ajaxRequest.setRequestHeader("Connection", "close");
	
	
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
		
		  var resp = ajaxRequest.responseText;

document.getElementById(divv).innerHTML = resp;
		}
	}
	
ajaxRequest.send(params);
}

function showm(id)
{

var a = document.getElementById(id);
if(a.style.display == "none")
{
  
 new Effect.BlindDown(id , {duration:0.5});

}
else
{
  new Effect.BlindUp(id , {duration:0.5});
}
}




function submitreply(user,story,comment,code,error,reply,rephd,comme)
{
	
	var comm = document.getElementById(comment).value;
	var err = document.getElementById(error);
	var cod = document.getElementById(code).value;
	var replyhead = document.getElementById(rephd);
	var commeform = document.getElementById(comme);

	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	
var url = "../../../submitreply.php";
var params = "comment=" + comm + "&code=" + cod + "&user=" + user + "&story=" + story + "&reply=" + reply;
ajaxRequest.open("POST", url, true);

//Send the proper header information along with the request
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajaxRequest.setRequestHeader("Content-length", params.length);
ajaxRequest.setRequestHeader("Connection", "close");
	
	
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
		
		  var resp = ajaxRequest.responseText;
		if(resp == '0')
		   {
			   err.style.width = '100%';
			   err.style.float = 'left';
		  	   err.innerHTML = '<div style="font-family:arial;font-size:14px;font-weight:bold;color:#990000;padding-left:10px">The code you entered is wrong. Please retry.</div>';
		   }
		   else
		   {
			 
			  
			  replyhead.innerHTML = '<div style="padding:4px;font-family:arial;font-size:12px;color:white">Click here to expand/hide comment</div>';
			  
			  var xmlDoc = ajaxRequest.responseXML;
			  
			  var auth = xmlDoc.getElementsByTagName("author")[0].childNodes[0].nodeValue;
			  var av = xmlDoc.getElementsByTagName("avatar")[0].childNodes[0].nodeValue;
			  var commy = xmlDoc.getElementsByTagName("comment")[0].childNodes[0].nodeValue;
			  if(av == 'true')
			  {
				av = '<img src="http://mmarocks.com/avatars/default_small.jpg" width="15" height="15" />'; 
			  }
			  
			  

			  commeform.innerHTML = ''; 
			  commeform.style.background = '#fff';
			  commeform.style.border = '0px';
			  commeform.style.borderLeft = '1px solid #8DB5D7';
			  commeform.style.borderRight = '1px solid #fff';
			  commeform.style.height = '90px';
			  commeform.style.display = '';
			  
		
			  commeform.innerHTML = '<div style="float:right;margin-top:14px;width:98%;border-top:1px solid #447891;background:#9CBBDC;height:28px"><div style="float:left;padding:6px">' + av + '</div><div style="float:left;font-family:arial;font-size:11px;color:#333;padding-top:7px">by <a href="http://mmarocks.com/users/' + auth + '" style="color:#333"><strong>' + auth + '</strong></a> just now</div><div style="padding-top:4px;padding-right:4px;float:right;"><img src="http://mmarocks.com/images/arrowdown_dis.jpg" width="18" height="18" /></div><div style="padding-top:4px;padding-right:4px;float:right;"><img src="http://mmarocks.com/images/arrowup_dis.jpg" width="18" height="18" /></div><div style="float:right;padding-top:6px;padding-right:7px;font-family:arial;font-size:12px;font-weight:bold;color:#333">+1 vote</div></div><div id="rep_'+reply+'" style="width:98%;background:#EFDC92;height:28px;float:right"><div style="float:left;padding:6px;font-family:arial;font-size:11px;color:#333;"><a href="javascript://" style="color:#333" onclikc=""><strong>Click here</strong></a> to edit (available for <span id="count_'+reply+'">120</span> seconds)</div></div><div style="width:98%;float:right;"><div style="text-align:left;float:left;padding-top:9px;padding-left:7px;font-family:arial;font-size:12px;color:#333">' + commy + '</div></div>';
																																																																																																																																																																																																																																																								new Effect.BlindDown(commeform, {duration:0.2});
var t = 'rep_' + reply;
var g = 'count_' + reply;


setInterval(func2,1000,t,g);
																																																																																																																																																																																																																																													 
		   }
		}
	}
	
ajaxRequest.send(params);
}





function submitreply2(user,story,comment,error,reply,rephd,comme)
{
	
	var comm = document.getElementById(comment).value;
	var err = document.getElementById(error);
	var cod = 'ff';
	var replyhead = document.getElementById(rephd);
	var commeform = document.getElementById(comme);

	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	
var url = "../../../submitreply2.php";
var params = "comment=" + comm + "&code=" + cod + "&user=" + user + "&story=" + story + "&reply=" + reply;
ajaxRequest.open("POST", url, true);

//Send the proper header information along with the request
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajaxRequest.setRequestHeader("Content-length", params.length);
ajaxRequest.setRequestHeader("Connection", "close");
	
	
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
		
		  var resp = ajaxRequest.responseText;
		if(resp == '0')
		   {
			   err.style.width = '100%';
			   err.style.float = 'left';
		  	   err.innerHTML = '<div style="font-family:arial;font-size:14px;font-weight:bold;color:#990000;padding-left:10px">The code you entered is wrong. Please retry.</div>';
		   }
		   else
		   {
			 
			  
			  replyhead.innerHTML = '<div style="padding:4px;font-family:arial;font-size:12px;color:white">Click here to expand/hide comment</div>';
			  
			  var xmlDoc = ajaxRequest.responseXML;
			  
			  var auth = xmlDoc.getElementsByTagName("author")[0].childNodes[0].nodeValue;
			  var av = xmlDoc.getElementsByTagName("avatar")[0].childNodes[0].nodeValue;
			  var commy = xmlDoc.getElementsByTagName("comment")[0].childNodes[0].nodeValue;
			  if(av == 'true')
			  {
				av = '<img src="http://mmarocks.com/avatars/default_small.jpg" width="15" height="15" />'; 
			  }
			  
			  

			  commeform.innerHTML = ''; 
			  commeform.style.background = '#fff';
			  commeform.style.border = '0px';
			  commeform.style.borderLeft = '1px solid #8DB5D7';
			  commeform.style.borderRight = '1px solid #fff';
			  commeform.style.height = '90px';
			  commeform.style.display = '';
			  
		
			  commeform.innerHTML = '<div style="float:right;margin-top:14px;width:98%;border-top:1px solid #447891;background:#9CBBDC;height:28px"><div style="float:left;padding:6px">' + av + '</div><div style="float:left;font-family:arial;font-size:11px;color:#333;padding-top:7px">by <a href="http://mmarocks.com/users/' + auth + '" style="color:#333"><strong>' + auth + '</strong></a> just now</div><div style="padding-top:4px;padding-right:4px;float:right;"><img src="http://mmarocks.com/images/arrowdown_dis.jpg" width="18" height="18" /></div><div style="padding-top:4px;padding-right:4px;float:right;"><img src="http://mmarocks.com/images/arrowup_dis.jpg" width="18" height="18" /></div><div style="float:right;padding-top:6px;padding-right:7px;font-family:arial;font-size:12px;font-weight:bold;color:#333">+1 vote</div></div><div id="rep_'+reply+'" style="width:98%;background:#EFDC92;height:28px;float:right"><div style="float:left;padding:6px;font-family:arial;font-size:11px;color:#333;"><a href="javascript://" style="color:#333" onclikc=""><strong>Click here</strong></a> to edit (available for <span id="count_'+reply+'">120</span> seconds)</div></div><div style="width:98%;float:right;"><div style="text-align:left;float:left;padding-top:9px;padding-left:7px;font-family:arial;font-size:12px;color:#333">' + commy + '</div></div>';
																																																																																																																																																																																																																																																								new Effect.BlindDown(commeform, {duration:0.2});
var t = 'rep_' + reply;
var g = 'count_' + reply;


setInterval(func2,1000,t,g);
																																																																																																																																																																																																																																													 
		   }
		}
	}
	
ajaxRequest.send(params);
}



	
	
	function fetchreply(user,story,comment,code,error,reply,rephd,comme)
{
	
	var comm = document.getElementById(comment).value;
	var err = document.getElementById(error);
	var cod = document.getElementById(code).value;
	var replyhead = document.getElementById(rephd);
	var commeform = document.getElementById(comme);

	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	
	
var url = "../../../submitreply.php";
var params = "comment=" + comm + "&code=" + cod + "&user=" + user + "&story=" + story + "&reply=" + reply;
ajaxRequest.open("POST", url, true);

//Send the proper header information along with the request
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajaxRequest.setRequestHeader("Content-length", params.length);
ajaxRequest.setRequestHeader("Connection", "close");
	
	
	
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
		
		  var resp = ajaxRequest.responseText;
		if(resp == '0')
		   {
			   err.style.width = '100%';
			   err.style.float = 'left';
		  	   err.innerHTML = '<div style="font-family:arial;font-size:14px;font-weight:bold;color:#990000;padding-left:10px">The code you entered is wrong. Please retry.</div>';
		   }
		   else
		   {
			 
			  
			  replyhead.innerHTML = '<div style="padding:4px;font-family:arial;font-size:12px;color:white">Click here to expand/hide comment</div>';
			  
			  var xmlDoc = ajaxRequest.responseXML;
			  
			  var auth = xmlDoc.getElementsByTagName("author")[0].childNodes[0].nodeValue;
			  var av = xmlDoc.getElementsByTagName("avatar")[0].childNodes[0].nodeValue;
			  var commy = xmlDoc.getElementsByTagName("comment")[0].childNodes[0].nodeValue;
			  if(av == 'true')
			  {
				av = '<img src="http://mmarocks.com/avatars/default_small.jpg" width="15" height="15" />'; 
			  }
			  
			  

			  commeform.innerHTML = ''; 
			  commeform.style.background = '#fff';
			  commeform.style.border = '0px';
			  commeform.style.borderLeft = '1px solid #8DB5D7';
			  commeform.style.borderRight = '1px solid #fff';
			  commeform.style.height = '90px';
			  commeform.style.display = '';
			  
		
			  commeform.innerHTML = '<div style="float:right;margin-top:14px;width:98%;border-top:1px solid #447891;background:#9CBBDC;height:28px"><div style="float:left;padding:6px">' + av + '</div><div style="float:left;font-family:arial;font-size:11px;color:#333;padding-top:7px">by <a href="http://mmarocks.com/users/' + auth + '" style="color:#333"><strong>' + auth + '</strong></a> just now</div><div style="padding-top:4px;padding-right:4px;float:right;"><img src="http://mmarocks.com/images/arrowdown_dis.jpg" width="18" height="18" /></div><div style="padding-top:4px;padding-right:4px;float:right;"><img src="http://mmarocks.com/images/arrowup_dis.jpg" width="18" height="18" /></div><div style="float:right;padding-top:6px;padding-right:7px;font-family:arial;font-size:12px;font-weight:bold;color:#333">+1 vote</div></div><div id="rep_'+reply+'" style="width:98%;background:#EFDC92;height:28px;float:right"><div style="float:left;padding:6px;font-family:arial;font-size:11px;color:#333;"><a href="javascript://" style="color:#333" onclikc=""><strong>Click here</strong></a> to edit (available for <span id="count_'+reply+'">120</span> seconds)</div></div><div style="width:98%;float:right;"><div style="text-align:left;float:left;padding-top:9px;padding-left:7px;font-family:arial;font-size:12px;color:#333">' + commy + '</div></div>';
																																																																																																																																																																																																																																																								new Effect.BlindDown(commeform, {duration:0.2});
var t = 'rep_' + reply;
var g = 'count_' + reply;


setInterval(func2,1000,t,g);
																																																																																																																																																																																																																																													 
		   }
		}
	}
	
ajaxRequest.send(params);
}

	
	



var mydomainname = '.mmarocks.com';

function setCookie( name, value, expires, path, domain, secure ) 
{ 
var today = new Date(); today.setTime( today.getTime() ); 

if ( expires ) { Expires = expires * 1000 * 60 * 60 * 24; } 
var expires_date = new Date( today.getTime() + (expires) ); document.cookie = name + "=" +escape( value ) + ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + ( ( path ) ? ";path=" + path : "" ) + ( ( domain ) ? ";domain=" + domain : "" ) + ( ( secure ) ? ";secure" : "" ); } 




function getCookie(name) { var start = document.cookie.indexOf( name + "=" ); var len = start + name.length + 1; if ((!start) && (name != document.cookie.substring(0, name.length))) { return null; } if ( start == -1 ) { return null; } var end = document.cookie.indexOf( ';', len ); if ( end == -1 ) { end = document.cookie.length; } return unescape( document.cookie.substring( len, end ) ); } 




function first(author,storyid,myfirst){

	var ff = document.getElementById(myfirst);

		var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
		
		  ff.innerHTML = '&nbsp;<img src="http://mmarocks.com/images/no1green.jpg" border="0" width="50" height="16" />';


if(getCookie('myfirst'))
{

document.getElementById(getCookie('myfirst')).innerHTML = "&nbsp<a href='javascript://' onclick=\"first('" + getCookie('author') + "','" + getCookie('storyid') + "','" + getCookie('myfirst') + "')\"><img src='http://mmarocks.com/images/no1blue.jpg' border='0' width='50' height='16' /></a>";
}
			setCookie('author',author,999999999,'/',mydomainname);
			setCookie('storyid',storyid,999999999,'/',mydomainname);
			setCookie('myfirst',myfirst,999999999,'/',mydomainname);

		}
	}
	
	var author1 = document.getElementById(author).value;
	var storyid1 = document.getElementById(storyid).value;

    var queryString = "?author=" + author1 + "&storyid=" + storyid1 ;
	ajaxRequest.open("GET", "../../../../../../makegreen.php" + queryString , true);
	ajaxRequest.send(null); 
}



function vote(author,storyid,vote_console,votes,myfirst){
	var x = document.getElementById(votes);
	var ff = document.getElementById(myfirst);
	new Effect.Fade(x,{duration:0.1});
	
		var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById(vote_console);
			ajaxDisplay.innerHTML = '<div class="pages3">voted</div>';
			document.getElementById(votes).innerHTML = ajaxRequest.responseText;
			ff.innerHTML = "<a href='javascript://' onclick=\"first('" + author + "','" + storyid + "','" + myfirst + "')\"><img src='http://mmarocks.com/images/no1blue.jpg' border='0' width='50' height='16' /></a>";
			


			new Effect.Appear(x,{duration:0.1});
		}
	}
	
	var author1 = document.getElementById(author).value;
	var storyid1 = document.getElementById(storyid).value;

    var queryString = "?author=" + author1 + "&storyid=" + storyid1 ;
	ajaxRequest.open("GET", "../../../../../../vote.php" + queryString , true);
	ajaxRequest.send(null); 
}



function checklenght(lenght,ajaxDiv,len){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			var ajaxDisplay = document.getElementById(ajaxDiv);
			ajaxDisplay.innerHTML = ajaxRequest.responseText;
		}
	}
	var words = document.getElementById(lenght).value;


	var queryString = "?words=" + words + "&len=" + len;
	ajaxRequest.open("GET", "checkwords.php" + queryString, true);
	ajaxRequest.send(null); 
}

function enablebutton(button,button2,target){var string=target.value;button2.disabled=false;if(string.length>0){button.disabled=false;}else{button.disabled=true;}
var target2=$('commentcaptcha');}

function imageswap(image,sursa)
{
var a = document.getElementById(image);
a.src = sursa;
}

function showhide(id)
{

var a = document.getElementById(id);
if(a.style.display == "none")
{
  
 new Effect.BlindDown(id , {duration:0.5});
 new Effect.Appear('login-top2');	
}
else
{
  new Effect.Fade('login-top2');
  new Effect.BlindUp(id , {duration:0.5});
}
}


function check_username(username,ajaxDiv){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 1){
			document.getElementById(ajaxDiv).innerHTML = '<span style="font-family:arial;font-size:12px;font-weight:bold;color:#ccc">Loading...<br></span>';
		}
		
		if(ajaxRequest.readyState == 4){
			document.getElementById(ajaxDiv).innerHTML = ajaxRequest.responseText;
		}
	}
	
	var user = document.getElementById(username).value;
	
	ajaxRequest.open("GET", "check.php?user=" + user, true);
	ajaxRequest.send(null); 
}
