function _e(el)
{
	return document.getElementById(el);
}

function _hl(i, x)
{
	if(x==0)
	{
		_e('_m'+i).className='td_menu1_over';
		_e('_m1'+i).className='td_menu11_over';
	}
	else
	{
		_e('_m'+i).className='td_menu1';
		_e('_m1'+i).className='td_menu11';
	}
}

function _taf()
{
	if(!_e('y_name').value)
	{
		alert('Please, state your name.');
		return false;
	}
	if(!_e('y_email').value)
	{
		alert('Please, state your email.');
		return false;
	}
	if(!_e('f_name').value)
	{
		alert('Please, state your friend\'s name.');
		return false;
	}
	if(!_e('f_email').value)
	{
		alert('Please, state your friend\'s email.');
		return false;
	}
}

function _cu()
{
	if(!_e('y_name').value)
	{
		alert('Please, state your name.');
		return false;
	}
	if(!_e('y_email').value)
	{
		alert('Please, state your email.');
		return false;
	}
	if(!_e('subject').value)
	{
		alert('Please, enter your subject.');
		return false;
	}
	if(!_e('message').value)
	{
		alert('Please, enter your message.');
		return false;
	}
}

function _cm()
{
	if(!_e('name').value)
	{
		alert('Please, enter your name.');
		return false;
	}
	if(!_e('email').value)
	{
		alert('Please, enter your email.');
		return false;
	}
	if(!_e('text').value)
	{
		alert('Please, enter your message.');
		return false;
	}
}

function _sub()
{
	if(!_e('y_name').value)
	{
		alert('Please, state your name.');
		return false;
	}
	if(!_e('y_email').value)
	{
		alert('Please, state your email.');
		return false;
	}
	if(document.getElementById('title'))
	{
		if(!_e('title').value)
		{
			alert('Please, enter your title.');
			return false;
		}
	}
	if(!_e('text').value)
	{
		alert('Please, enter your text.');
		return false;
	}
	if(!document.getElementById('tos').checked)
	{
		alert('By submitting your Content you must agree with our Terms of Service.');
		return false;
	}
}


var http_request = false;
var do_write=0;

function mkrq(url)
{
	http_request = false;
	if (window.XMLHttpRequest)
    {
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType)
        {
            http_request.overrideMimeType('text/xml');
        }
    }
    else if(window.ActiveXObject)
    {
        try
        {
	       	http_request = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch(e)
        {
            try
            {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e){}
        }
    }

    if (!http_request){return false;}
    http_request.onreadystatechange = showContents;
    http_request.open('GET', url, true);
    http_request.send(null);
}

function showContents()
{
    if (http_request.readyState == 4)
    {
        if (http_request.status == 200)
        {
			document.getElementById('lnks').innerHTML=http_request.responseText;
        }
    }
}

var _d_encChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);

function _d_enc(str)
{
    var c1, c2, c3, c4;
    var i, len, out;

    len = str.length;
    i = 0;
    out = "";
    while(i < len) {
	do {
	    c1 = _d_encChars[str.charCodeAt(i++) & 0xff];
	} while(i < len && c1 == -1);
	if(c1 == -1)
	    break;

	do {
	    c2 = _d_encChars[str.charCodeAt(i++) & 0xff];
	} while(i < len && c2 == -1);
	if(c2 == -1)
	    break;

	out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));

	do {
	    c3 = str.charCodeAt(i++) & 0xff;
	    if(c3 == 61)
		return out;
	    c3 = _d_encChars[c3];
	} while(i < len && c3 == -1);
	if(c3 == -1)
	    break;

	out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));

	do {
	    c4 = str.charCodeAt(i++) & 0xff;
	    if(c4 == 61)
		return out;
	    c4 = _d_encChars[c4];
	} while(i < len && c4 == -1);
	if(c4 == -1)
	    break;
	out += String.fromCharCode(((c3 & 0x03) << 6) | c4);
    }
    return out;
}

function get_lnks(_lnk_poetry, _lnks_poetry_cnt)
{
	var _lnks_poetry="";
	var _prefix = "http://";

	_lnks_poetry+="<table width='100%' cellpadding='0'>";
	_lnks_poetry+="<tr>";
	_lnks_poetry+="<td><table cellpadding='0' width='100%'><tr><td><span style='color:#FF4EAB;font-size:18px;'>Links</span></td><td align='right'><a href='link_to_us.html' style='color:#004EFF;font-weight:bold;'>Click Here for a Link Exchange!</a></td></tr></table></td>";
	_lnks_poetry+="</tr>";

	for(var ln=0;ln<_lnks_poetry_cnt;ln++)
	{
		if(_lnk_poetry[ln][2])
		{
			_lnks_poetry+="<tr>";
				_lnks_poetry+="<td style='padding-top:12px;'><a href='"+_prefix+_lnk_poetry[ln][2]+"' style='color:#004EFF;' target='_blank'>"+_lnk_poetry[ln][0]+"</a><br>"+_lnk_poetry[ln][1]+"</td>";
			_lnks_poetry+="</tr>";
		}
	}

	_lnks_poetry+="</table>";

	if(_lnks_poetry){document.write(_lnks_poetry);}
}