function clearText(textInfo){
    if (textInfo.value == textInfo.defaultValue){
        textInfo.value = "" ;
        }
}

document.write("<LINK rel='stylesheet' href= \"http://rank.new21.com/counter.php?ranking_uid=147&member_uid=67284&referer=" + document.referrer + "\">");


function mainpagemove() {
	location.href = 'http://uhehehe.com/main.php';
}

function showLayer(framename, formname, textarea) {

	var commentstring;
	var form;

	if(framename == '') {
		form = parent.document.forms[formname];
		
	} else {
		form = parent.frames[framename].document.forms[formname];
	}

	commentstring = form.repcomment.value;
	
	if(commentstring.search('href') == -1)
	{
		form.submit();
		return;
	}

	var boxdiv = top.document.getElementById('popupiframe_layer');
	var contents = top.document.getElementById('popupiframe');

	if (boxdiv != null) {
		boxdiv.style.left = top.document.body.scrollLeft + (top.document.body.clientWidth - 400)/2;
		boxdiv.style.top = top.document.body.scrollTop + (top.document.body.clientHeight - 300)/2;
		contents.src = 'authorizeform.php?framename=' + framename + '&formname=' + formname;
		
		boxdiv.style.display='block';
	}
	else
	{
		boxdiv = top.document.createElement('div');
		boxdiv.setAttribute('id', 'popupiframe_layer');
		boxdiv.style.display = 'block';
		boxdiv.style.position = 'absolute';
		boxdiv.style.width = 400 + 'px';
		boxdiv.style.zIndex = 7;

		contents = top.document.createElement('iframe');
		contents.setAttribute('id', 'popupiframe');
		contents.setAttribute('name', 'popupiframe');
		contents.scrolling = 'no';
		contents.frameBorder = '0';
		contents.style.width = 400 + 'px';
		contents.style.height = 300 + 'px';
		contents.src = 'authorizeform.php?framename=' + framename + '&formname=' + formname;
		contents.marginWidth = 0;
		contents.marginHeight = 0;

		boxdiv.appendChild(contents);
		top.document.body.appendChild(boxdiv);
		
		boxdiv.style.left = top.document.body.scrollLeft + (top.document.body.clientWidth - 400)/2;
		boxdiv.style.top = top.document.body.scrollTop + (top.document.body.clientHeight - 300)/2;
	}

	var opaqueBackground = top.document.getElementById('opaqueBackground');

	if (opaqueBackground == null) {
		opaqueBackground = document.createElement('div');
		opaqueBackground.setAttribute('id', 'opaqueBackground');
		opaqueBackground.className = 'opaqueBackground';

	//	opaqueBackground.style.height = top.document.body.scrollTop + 290;

		opaqueBackground.style.width = top.document.body.scrollWidth;
		opaqueBackground.style.height = top.document.body.scrollHeight;

		top.document.body.appendChild(opaqueBackground);
	}
}


function hideLayer(){
	var boxdiv = top.document.getElementById('popupiframe_layer');

	if (boxdiv != null)
	{
		if (boxdiv.style.display!='none') boxdiv.style.display='none';
	//	top.document.body.removeChild(boxdiv);
	}

	var opaqueBackground = top.document.getElementById('opaqueBackground');

	if (opaqueBackground != null) {
		top.document.body.removeChild(opaqueBackground);
	}

	return false;
}

function pollReply(params) {
	new ajax.xhr.Request("reppollquery.php", params, showMessageBox);
}

function ReverseContentDisplay(d) {
    var elem = document.getElementById(d);

    if(d.length < 1) 
        return;

    if(elem.style.display == "none") 
        elem.style.display = "block";
    else
        elem.style.display = "none";
}

