function arc_init() {
//get all the urls in cat div
cata = ge('cat_box');
tgs = cata.getElementsByTagName('a');

//change urls to javascript for ajax
for (var i = 0; i < tgs.length; i++) {

ahf = ge(tgs[i].id)
ahf.href = "javascript:catchange('" + tgs[i].id + "')"

}

//get all urls in main area
acar = ge('right_col')
tgs2 = acar.getElementsByTagName('a');

//change urls to javascript for ajax
for (var i = 0; i < tgs2.length; i++) {

//get the act and gme from query string
get = tgs2[i].href

act = get.substr(38,4);

get_s = get.search(/&id/)
gme = get.slice(47, get_s);

ahf = ge(tgs2[i].id)
ahf.href = "javascript:" + act + "('" + tgs2[i].id + "', '" + gme + "')"

}

}
addLoadEvent(arc_init)


function vcom(ID, gme) {
mp = ge('rbody');
com = ge('com_'+ID);

//grab comment info
tgs = com.getElementsByTagName('span');

t_el1 = tgs[0].firstChild.data;
t_el2 = tgs[2].firstChild.data;
t_el3 = tgs[3].firstChild.data;

tgs = com.getElementsByTagName('b');
b_el1 = tgs[0].firstChild.data;

com_p = ge('p_'+ID).innerHTML;

//delete comments
if (mp.hasChildNodes())
{
while( mp.firstChild ) {
    //delete all the stat info 
    mp.removeChild( mp.firstChild );
}
}

//recreate comment
cstring = "<div id=\"com_1\">";
cstring += "<div class=\"arc_imp_title\">";
cstring += "<span class=\"arc_comm\">"+t_el1+"<span> Comments</span></span>";
cstring += "<span class=\"snum\">"+t_el2+"</span> <b class=\"gtitl\">"+b_el1+"</b><br />";
cstring += "<span class=\"arc_blog_imp\">"+t_el3+"</span></div>";
cstring += "<div class=\"arc_comtab\">";
cstring += "</div>";
cstring += "<div><p class=\"arc_bcomment\">"+com_p+"</p></div></div>";
cstring += "<h4 class=\"arc_h3\">Gamers have said...</h4>";
mp.innerHTML = cstring;

vcom_http(ID, gme)

}

function vcom_http(ID, gme) {
mp = ge('rbody');

mp.style.height="";
cdiv = dce('div')
cdiv.id = "sub_com";
mp.appendChild(cdiv);

//server update code
http_request = false;

        // Mozilla/Safari
        if (window.XMLHttpRequest) {
                http_request = new XMLHttpRequest();
                http_request.overrideMimeType('text/xml');
        }
        // IE
        else if (window.ActiveXObject) {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
        }


        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
  
 var url = 'http://www.gamerzlink.com/templates/php/arc_com_get.php?gme='+gme;
  http_request.onreadystatechange = alertContents;
    http_request.open('GET', url, true);
 http_request.send(null);

    function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
//grab returning XML data
comment_l = http_request.responseXML.getElementsByTagName('cmt');
var ustring="";

for(i=0; i<comment_l.length; i++){
 id = comment_l[i].getAttribute('id')

 cID = comment_l[i].getElementsByTagName('cID')[0].firstChild.nodeValue;
 gzID = comment_l[i].getElementsByTagName('gzID')[0].firstChild.nodeValue;
 related = comment_l[i].getElementsByTagName('related')[0].firstChild.nodeValue;
 name = comment_l[i].getElementsByTagName('name')[0].firstChild.nodeValue;
 comment = comment_l[i].getElementsByTagName('comment')[0].firstChild.nodeValue;
 time = comment_l[i].getElementsByTagName('time')[0].firstChild.nodeValue;
 posted = comment_l[i].getElementsByTagName('posted')[0].firstChild.nodeValue;

//display comments
ustring += "<div><div class=\"utbar\">";
ustring += "<span class=\"u_spn1\">"+name+" posted...</span>";
ustring += "<span class=\"u_spn2\">Posted on: " + posted + " @ " + time+"</span></div>";
ustring += "<div class=\"u_p1\"><p>"+comment+"</p></div></div>";
 
}//end for

ustring += "<div id=\"bfrm\"></div>";

cdiv.innerHTML = ustring;
bottom_form(ID, gme)

            } else {
                alert('There was a problem with the request.');
            }
        }
    }
}//end vcom_http

function bottom_form(ID, gme) {
bfrm = ge('bfrm')

fstring = "<div id=\"leave_div_"+ID+"\" class=\"ubot_ndv\">";
fstring += "<div><p class=\"ubot_pfp\">Share what you think about this, enter your comment about this topic.  Let us know what you think.  Login or join us to keep track of your comments.</p><form>";
fstring += "<div id=\"arc_inputs\" style=\"margin-left:2em;\"><label for=\"name\">Name:</label><input type=\"text\" name=\"name\" value=\"\" size=\"30\" maxlength=\"100\" id=\"name_"+ID+"\" onfocus=\"form_on('name_"+ID+"')\" onblur=\"form_off('name_"+ID+"')\" /><br /><label for=\"email\">E-mail:</label><input type=\"text\" name=\"email\" value=\"\" size=\"30\" maxlength=\"100\" id=\"email_"+ID+"\" onfocus=\"form_on('email_"+ID+"')\" onblur=\"form_off('email_"+ID+"')\" /><br /><label for=\"comment\">Comment:</label><textarea name=\"comment\" rows=\"6\" cols=\"42\" wrap=\"virtual\" id=\"comment_"+ID+"\" onfocus=\"form_on('comment_"+ID+"')\" onblur=\"form_off('comment_"+ID+"')\"></textarea><br /></div>";
fstring += "<input type=\"hidden\" name=\"gme\" value=\""+gme+"\" />";
fstring += "<div id=\"arc_sub\"><input type=\"button\" value=\"Leave Comment\" id=\"fsub\" onclick=\"com_add(this.form, '"+ID+"', '2')\" class=\"abtn\" onmouseover=\"this.className='abtn abtnhov'\" onmouseout=\"this.className='abtn'\" /></div>";
fstring += "</form></div>";
bfrm.innerHTML = fstring;

}//end bottomform

function catchange(cat) {

mp = ge('rbody');

if (cat == "gmnews")
{
news_http('gmnews')
}
else
{
cat_http(cat)
}
}//end catchage

function cat_http(cat) {

mp = ge('rbody');

//choose url with random date to fix IE cache
if (cat == "arti")
{
var url = 'http://www.gamerzlink.com/templates/php/arc_arti_get.php?Date='+escape(new Date());
}
else
{
var url = 'http://www.gamerzlink.com/templates/php/arc_cat_get.php?cat='+cat+'&Date='+escape(new Date());
}

//server update code
http_request = false;

        // Mozilla/Safari
        if (window.XMLHttpRequest) {
                http_request = new XMLHttpRequest();
                http_request.overrideMimeType('text/xml');
        }
        // IE
        else if (window.ActiveXObject) {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
        }


        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
http_request.onreadystatechange = alertContents;
http_request.open('GET', url, true);
http_request.send(null);

    function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
//grab returning XML data
comment_l = http_request.responseXML.getElementsByTagName('cmt');

//change category header
catn = comment_l[0].getAttribute('cat')
cttl = ge('cat_title');
cttl.innerHTML = "Archives : "+catn;



//get right side and clear it
ar = ge('date_box_i');

if (ar.hasChildNodes())
{
while( ar.firstChild ) {
    //delete all the stat info 
    ar.removeChild(ar.firstChild );
}
}

getDates(cat)

if(comment_l.length == 0 || comment_l.length == 1)
{
mp.style.height="70em";
}
else
{
mp.style.height="";
}

//clear comments for new category
if (mp.hasChildNodes())
{
while( mp.firstChild ) {
    //delete all the stat info 
    mp.removeChild( mp.firstChild );
}
}

var cstring="";

for(i=0; i<comment_l.length; i++){
 id = comment_l[i].getAttribute('id')

if (cat == "arti")
{
 cID = comment_l[i].getElementsByTagName('arID')[0].firstChild.nodeValue;
 btitle = comment_l[i].getElementsByTagName('title')[0].firstChild.nodeValue;
 comment = comment_l[i].getElementsByTagName('main_text')[0].firstChild.nodeValue;
}
else
{
 cID = comment_l[i].getElementsByTagName('cID')[0].firstChild.nodeValue;
 comment = comment_l[i].getElementsByTagName('comment')[0].firstChild.nodeValue;
 btitle = comment_l[i].getElementsByTagName('btitle')[0].firstChild.nodeValue;
}

 gzID = comment_l[i].getElementsByTagName('gzID')[0].firstChild.nodeValue;
 gme_name = comment_l[i].getElementsByTagName('gme_name')[0].firstChild.nodeValue;
 name = comment_l[i].getElementsByTagName('name')[0].firstChild.nodeValue;
 time = comment_l[i].getElementsByTagName('time')[0].firstChild.nodeValue;
 posted = comment_l[i].getElementsByTagName('posted')[0].firstChild.nodeValue;
 coms = comment_l[i].getElementsByTagName('coms')[0].firstChild.nodeValue;

//create comment
cstring += "<div id=\"com_"+id+"\">";
cstring += "<div class=\"arc_imp_title\">";
cstring += "<span class=\"arc_comm\">"+coms+"</span><span class=\"arc_comm2\">Comments</span>";
cstring += "<span class=\"snum\">"+id+".</span> <b class=\"gtitl\">"+btitle+"</b><br />";
cstring += "<span class=\"arc_blog_imp\" id=\"$sid\">Posted by " + name + " on " + posted + " @ " + time + "</span></div>";

if(0 == coms) {
cstring += "<div class=\"arc_comtab\" id=\"l_"+id+"\"><a href=\"javascript:lcom('" + id + "', '" + gme_name + "');\">Leave Comment</a>";
} else {
cstring += "<div class=\"arc_comtab\" id=\"l_"+id+"\"><a href=\"javascript:vcom('" + id + "', '" + gme_name + "');\">View Comments</a>";
}

cstring += "</div>";
cstring += "<div><p class=\"arc_bcomment\" id=\"p_"+id+"\">"+comment+"</p></div></div>";

 } 
mp.innerHTML = cstring;

            } else {
                alert('There was a problem with the request.');
            }
        }
    }
}//end cat_http

function news_http(cat) {

mp = ge('arc_area');

//server update code
http_request = false;

        // Mozilla/Safari
        if (window.XMLHttpRequest) {
                http_request = new XMLHttpRequest();
                http_request.overrideMimeType('text/xml');
        }
        // IE
        else if (window.ActiveXObject) {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
        }


        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
//url with random date to fix IE cache
var url = 'http://www.gamerzlink.com/v4/templates/php/arc_news_get.php?Date='+escape(new Date());
http_request.onreadystatechange = alertContents;
http_request.open('GET', url, true);
http_request.send(null);

    function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
//grab returning XML data
comment_l = http_request.responseXML.getElementsByTagName('cmt');

//change category header
cttl = ge('cat_title');
cttl.removeChild( cttl.firstChild );
cttl.appendChild(document.createTextNode("Archives : Game News"));


if(comment_l.length == 0 || comment_l.length == 1)
{
mp.style.height="70em";
}

//get right side and clear it
ar = ge('date_box_i');

if (ar.hasChildNodes())
{
while( ar.firstChild ) {
    //delete all the stat info 
    ar.removeChild(ar.firstChild );
}
}

getDates(cat)

//clear comments for new category
if (mp.hasChildNodes())
{
while( mp.firstChild ) {
    //delete all the stat info 
    mp.removeChild( mp.firstChild );
}
}

//create top BR
br = dce('br');
mp.appendChild(br);

for(i=0; i<comment_l.length; i++){
 id = comment_l[i].getAttribute('id')

 gn_id = comment_l[i].getElementsByTagName('gn_id')[0].firstChild.nodeValue;
 time = comment_l[i].getElementsByTagName('time')[0].firstChild.nodeValue;
 gn_date = comment_l[i].getElementsByTagName('gn_date')[0].firstChild.nodeValue;
 gn_title = comment_l[i].getElementsByTagName('gn_title')[0].firstChild.nodeValue;
 gn_source = comment_l[i].getElementsByTagName('gn_source')[0].firstChild.nodeValue;
 gn_report = comment_l[i].getElementsByTagName('gn_report')[0].firstChild.nodeValue;
 gn_surl = comment_l[i].getElementsByTagName('gn_surl')[0].firstChild.nodeValue;
 gn_story = comment_l[i].getElementsByTagName('gn_story')[0].firstChild.nodeValue;
 coms = comment_l[i].getElementsByTagName('coms')[0].firstChild.nodeValue;
 gme_name = comment_l[i].getElementsByTagName('gme_name')[0].firstChild.nodeValue;
 
//create comment
div1 = dce('div');
div1.id="com_"+id;
div1.className="acrbarmain";
mp.appendChild(div1);

 spn1 = dce('span')
 spn1.className="arc_mtotal";
 spn1.appendChild(document.createTextNode(coms));
 div1.appendChild(spn1);

 spn2 = dce('span')
 spn2.className="bbartitle";
 div1.appendChild(spn2);

  b1 = dce('b')
  spn2.appendChild(b1);

   spn3 = dce('span')
   spn3.appendChild(document.createTextNode(gn_title));
   b1.appendChild(spn3);

  br = dce('br');
  spn2.appendChild(br);

  spn4 = dce('span');
  spn4.className="blog1";
  spn4.appendChild(document.createTextNode("Posted by: "  + gn_report + " (" + gn_date + " @ " + time + ")"));
  spn2.appendChild(spn4);

div2 = dce('div');
mp.appendChild(div2);

 p1 = dce('p');
 p1.className="bbcom";
 p1.id = "p_"+id;
 p1.innerHTML = gn_story;
 div2.appendChild(p1);

 p2 = dce('p');
 p2.className="bbsource";
 p2.id = "p2_"+id;
 p2.innerHTML = "Source: <a href=\"" + gn_surl + "\" class=\"bbsource\" target=\"_blank\">" + gn_source + "</a>";
 div2.appendChild(p2);

if(0 == coms)
{

div3 = dce('div')
div3.className="arc_combot2";
div3.id = "l_"+id;
div3.innerHTML = "<a href=\"javascript:lcom('" + id + "', '" + gme_name + "');\">Leave Comment</a>";
mp.appendChild(div3);

}
else
{

div3 = dce('div')
div3.className="arc_combot";
div3.innerHTML = "<a href=\"javascript:vcom('" + id + "', '" + gme_name + "');\">View Comments</a>";
mp.appendChild(div3);

}

 } 

            } else {
                alert('There was a problem with the request.');
            }
        }
    }
}//end news_http

function getDates(cat) {
ar = ge('date_box_i');

//server update code
http_request = false;

        // Mozilla/Safari
        if (window.XMLHttpRequest) {
                http_request = new XMLHttpRequest();
                http_request.overrideMimeType('text/xml');
        }
        // IE
        else if (window.ActiveXObject) {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
        }


        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
//url with random date to fix IE cache
var url = 'http://www.gamerzlink.com/templates/php/arc_dates_get.php?cat='+cat+'&Date='+escape(new Date());
http_request.onreadystatechange = alertContents;
http_request.open('GET', url, true);
http_request.send(null);

    function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
//grab returning XML data
comment_l = http_request.responseXML.getElementsByTagName('dte');

//function to find unique dates for right side
var u=[];
function isUnique(dt) {
for(var i=0; i<u.length; i++) {
    if (dt==u[i]) {
        return false;
        }
    }
u.push(dt);
return true;
}//end isunique


for(i=0; i<comment_l.length; i++){
 id = comment_l[i].getAttribute('id')

 year = comment_l[i].getElementsByTagName('year')[0].firstChild.nodeValue;
 month = comment_l[i].getElementsByTagName('month')[0].firstChild.nodeValue;

//grab unique dates for right side

if(isUnique(year)) {
  udiv = dce('div')
  ar.appendChild(udiv);

  up = dce('h5')
  up.style.fontSize="1.2em";
  up.style.marginBottom="0";
  up.style.color="#4B5E72";
  up.appendChild(document.createTextNode(year));
  udiv.appendChild(up);
}

if(isUnique(month)) {

var months=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');

month = month.substr(0,2);
dm = Number(month) - 1;

months = months[dm];

  uspn = dce('span')
  uspn.style.marginLeft = "5px";
  udiv.appendChild(uspn);

  uah = dce('a')
  uah.href="javascript:datechange('"+cat+"','"+month+"','"+year+"')";
  uah.style.color = "#ffffff";
  uah.appendChild(document.createTextNode(months));
  uspn.appendChild(uah);
  uspn.appendChild(document.createTextNode(" "));

}

} 

            } else {
                alert('There was a problem with the request.');
            }
        }
    }
}//end getDates

function datechange(cat, month, year) {

mp = ge('rbody');

//server update code
http_request = false;

        // Mozilla/Safari
        if (window.XMLHttpRequest) {
                http_request = new XMLHttpRequest();
                http_request.overrideMimeType('text/xml');
        }
        // IE
        else if (window.ActiveXObject) {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
        }


        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
//url with random date to fix IE cache
if (cat == "gmnews")
{
var url = 'http://www.gamerzlink.com/templates/php/arc_date_get_news.php?month='+month+'&year='+year+'&Date='+escape(new Date());
}
else
{
var url = 'http://www.gamerzlink.com/templates/php/arc_date_get.php?cat='+cat+'&month='+month+'&year='+year+'&Date='+escape(new Date());
}

http_request.onreadystatechange = alertContents;
http_request.open('GET', url, true);
http_request.send(null);

    function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
//grab returning XML data
comment_l = http_request.responseXML.getElementsByTagName('cmt');


if(comment_l.length == 0 || comment_l.length == 1)
{
mp.style.height="70em";
}
else
{
mp.style.height="";
}

//clear comments for new category
if (mp.hasChildNodes())
{
while( mp.firstChild ) {
    //delete all the stat info 
    mp.removeChild( mp.firstChild );
}
}

var cstring="";

if(cat == "gmnews")
{
//area for news
for(i=0; i<comment_l.length; i++){
 id = comment_l[i].getAttribute('id')

 gn_id = comment_l[i].getElementsByTagName('gn_id')[0].firstChild.nodeValue;
 time = comment_l[i].getElementsByTagName('time')[0].firstChild.nodeValue;
 gn_date = comment_l[i].getElementsByTagName('gn_date')[0].firstChild.nodeValue;
 gn_title = comment_l[i].getElementsByTagName('gn_title')[0].firstChild.nodeValue;
 gn_source = comment_l[i].getElementsByTagName('gn_source')[0].firstChild.nodeValue;
 gn_report = comment_l[i].getElementsByTagName('gn_report')[0].firstChild.nodeValue;
 gn_surl = comment_l[i].getElementsByTagName('gn_surl')[0].firstChild.nodeValue;
 gn_story = comment_l[i].getElementsByTagName('gn_story')[0].firstChild.nodeValue;
 coms = comment_l[i].getElementsByTagName('coms')[0].firstChild.nodeValue;
 gme_name = comment_l[i].getElementsByTagName('gme_name')[0].firstChild.nodeValue;

//create comment
div1 = dce('div');
div1.id="com_"+id;
div1.className="acrbarmain";
mp.appendChild(div1);

 spn1 = dce('span')
 spn1.className="arc_mtotal";
 spn1.appendChild(document.createTextNode(coms));
 div1.appendChild(spn1);

 spn2 = dce('span')
 spn2.className="bbartitle";
 div1.appendChild(spn2);

  b1 = dce('b')
  spn2.appendChild(b1);

   spn3 = dce('span')
   spn3.appendChild(document.createTextNode(gn_title));
   b1.appendChild(spn3);

  br = dce('br');
  spn2.appendChild(br);

  spn4 = dce('span');
  spn4.className="blog1";
  spn4.appendChild(document.createTextNode("Posted by: "  + gn_report + " (" + gn_date + " @ " + time + ")"));
  spn2.appendChild(spn4);

div2 = dce('div');
mp.appendChild(div2);

 p1 = dce('p');
 p1.className="bbcom";
 p1.id = "p_"+id;
 p1.innerHTML = gn_story;
 div2.appendChild(p1);

 p2 = dce('p');
 p2.className="bbsource";
 p2.id = "p2_"+id;
 p2.innerHTML = "Source: <a href=\"" + gn_surl + "\" class=\"bbsource\" target=\"_blank\">" + gn_source + "</a>";
 div2.appendChild(p2);

if(0 == coms)
{

div3 = dce('div')
div3.className="arc_combot2";
div3.id = "l_"+id;
div3.innerHTML = "<a href=\"javascript:lcom('" + id + "', '" + gme_name + "');\">Leave Comment</a>";
mp.appendChild(div3);

}
else
{

div3 = dce('div')
div3.className="arc_combot";
div3.innerHTML = "<a href=\"javascript:vcom('" + id + "', '" + gme_name + "');\">View Comments</a>";
mp.appendChild(div3);

}

 } 

}
else
{
//for all else
for(i=0; i<comment_l.length; i++){
 id = comment_l[i].getAttribute('id')

 cID = comment_l[i].getElementsByTagName('cID')[0].firstChild.nodeValue;
 gzID = comment_l[i].getElementsByTagName('gzID')[0].firstChild.nodeValue;
 gme_name = comment_l[i].getElementsByTagName('gme_name')[0].firstChild.nodeValue;
 name = comment_l[i].getElementsByTagName('name')[0].firstChild.nodeValue;
 comment = comment_l[i].getElementsByTagName('comment')[0].firstChild.nodeValue;
 btitle = comment_l[i].getElementsByTagName('btitle')[0].firstChild.nodeValue;
 time = comment_l[i].getElementsByTagName('time')[0].firstChild.nodeValue;
 posted = comment_l[i].getElementsByTagName('posted')[0].firstChild.nodeValue;
 coms = comment_l[i].getElementsByTagName('coms')[0].firstChild.nodeValue;
 
 
//create comment
cstring += "<div id=\"com_"+id+"\">";
cstring += "<div class=\"arc_imp_title\">";
cstring += "<span class=\"arc_comm\">"+coms+"</span><span class=\"arc_comm2\">Comments</span>";
cstring += "<span class=\"snum\">"+id+".</span> <b class=\"gtitl\">"+btitle+"</b><br />";
cstring += "<span class=\"arc_blog_imp\" id=\"$sid\">Posted by " + name + " on " + posted + " @ " + time + "</span></div>";

if(0 == coms) {
cstring += "<div class=\"arc_comtab\" id=\"l_"+id+"\"><a href=\"javascript:lcom('" + id + "', '" + gme_name + "');\">Leave Comment</a>";
} else {
cstring += "<div class=\"arc_comtab\" id=\"l_"+id+"\"><a href=\"javascript:vcom('" + id + "', '" + gme_name + "');\">View Comments</a>";
}

cstring += "</div>";
cstring += "<div><p class=\"arc_bcomment\" id=\"p_"+id+"\">"+comment+"</p></div></div>";

 } 
mp.innerHTML = cstring;
 
}//end if

            } else {
                alert('There was a problem with the request.');
            }
        }
    }
 
}//end date_change

function lcom(ID, gme) {
sdiv = ge('l_'+ID);

//delete leave comment button
if (sdiv.hasChildNodes())
{
while( sdiv.firstChild ) {
    //delete all the stat info 
    sdiv.removeChild( sdiv.firstChild );
}
}

fstring = "<div id=\"leave_div_"+ID+"\" class=\"cforma\">";
fstring += "<div><p class=\"arc_fp\">Share what you think about this, enter your comment about this topic.  Let us know what you think.  Login or join us to keep track of your comments.</p><form>";
fstring += "<div id=\"arc_inputs\"><label for=\"name\">Name:</label><input type=\"text\" name=\"name\" value=\"\" size=\"30\" maxlength=\"100\" id=\"name_"+ID+"\" onfocus=\"form_on('name_"+ID+"')\" onblur=\"form_off('name_"+ID+"')\" /><br /><label for=\"email\">E-mail:</label><input type=\"text\" name=\"email\" value=\"\" size=\"30\" maxlength=\"100\" id=\"email_"+ID+"\" onfocus=\"form_on('email_"+ID+"')\" onblur=\"form_off('email_"+ID+"')\" /><br /><label for=\"comment\">Comment:</label><textarea name=\"comment\" rows=\"6\" cols=\"42\" wrap=\"virtual\" id=\"comment_"+ID+"\" onfocus=\"form_on('comment_"+ID+"')\" onblur=\"form_off('comment_"+ID+"')\"></textarea><br /></div>";
fstring += "<input type=\"hidden\" name=\"gme\" value=\""+gme+"\" />";
fstring += "<div id=\"arc_sub\"><input type=\"button\" value=\"Cancel\" id=\"fsub\" onclick=\"com_cancel('" + ID + "', '" + gme + "')\" class=\"abtn\" onmouseover=\"this.className='abtn abtnhov'\" onmouseout=\"this.className='abtn'\" /><input type=\"button\" value=\"Leave Comment\" id=\"fsub\" onclick=\"com_add(this.form, '"+ID+"', '1')\" class=\"abtn\" onmouseover=\"this.className='abtn abtnhov'\" onmouseout=\"this.className='abtn'\" /></div>";
fstring += "</form></div>";
sdiv.innerHTML = fstring;

}

function form_on(ID) {
ge(ID).style.backgroundColor = "#FFFFF0";
}

function form_off(ID) {
ge(ID).style.backgroundColor = "";

}

function com_cancel(ID, gme) {

main = ge('leave_div_'+ID);
mp = main.parentNode
mp.removeChild( main )



sdiv = ge('l_'+ID);
sdiv.style.height="25px";
sdiv.innerHTML = "<a href=\"javascript:lcom('" + ID + "', '" + gme + "');\">Leave Comment</a>";


}//end com_cancel

function com_add(frm, ID, fnum){

nme = frm.elements[0].value;
eml = frm.elements[1].value;
cmt = frm.elements[2].value;
gme = frm.elements[3].value;

//email validation/////
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(eml)){

}
else
{
eml = "";
}
///////////

if("" == nme || "" == eml ||"" == cmt)
{
main = ge('leave_div_'+ID);

main.getElementsByTagName('p')[0].firstChild.data = "Oops, please make sure to fill out the entire form if you want to submit a comment. Dont worry, all e-mail addresses are kept private.";
main.getElementsByTagName('p')[0].style.color = "red";

if (cmt == "")
{
 gcom = ge('comment_'+ID);
 gcom.style.backgroundColor = "#F3D0D0";
 gcom.onkeypress = function () { cval('comment_'+ID);  }
 gcom.onfocus = "";

}
if (eml == "")
{
 gcom = ge('email_'+ID);
 gcom.style.backgroundColor = "#F3D0D0";
 gcom.onkeypress = function () { cval('email_'+ID);  }
 gcom.onfocus = "";
}
if (nme == "")
{
 gcom = ge('name_'+ID);
 gcom.style.backgroundColor = "#F3D0D0";
 gcom.onkeypress = function () { cval('name_'+ID);  }
 gcom.onfocus = "";
}

}
else
{
httpr(ID, gme, nme, eml, cmt, fnum)
}//end if

}//end com_add


/*
function com_add2(frm, ID){

nme = frm.elements[0].value;
eml = frm.elements[1].value;
cmt = frm.elements[2].value;
gme = frm.elements[3].value;

//email validation/////
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(eml)){

}
else
{
eml = "";
}
///////////

if("" == nme || "" == eml ||"" == cmt)
{
main = ge('leave_div_'+ID);

main.getElementsByTagName('p')[0].firstChild.data = "Oops, please make sure to fill out the entire form if you want to submit a comment. Dont worry, all e-mail addresses are kept private.";
main.getElementsByTagName('p')[0].style.color = "red";

if (cmt == "")
{
 gcom = ge('comment_'+ID);
 gcom.style.backgroundColor = "#F3D0D0";
 gcom.onkeypress = function () { cval('comment_'+ID);  }
 gcom.onfocus = "";

}
if (eml == "")
{
 gcom = ge('email_'+ID);
 gcom.style.backgroundColor = "#F3D0D0";
 gcom.onkeypress = function () { cval('email_'+ID);  }
 gcom.onfocus = "";
}
if (nme == "")
{
 gcom = ge('name_'+ID);
 gcom.style.backgroundColor = "#F3D0D0";
 gcom.onkeypress = function () { cval('name_'+ID);  }
 gcom.onfocus = "";
}

}
else
{
httpr2(ID, gme, nme, eml, cmt)
}//end if

}//end com_add2
*/

function cval(gID) {
gcom = ge(gID);
gcom.style.backgroundColor = "#FFFFF0";
gcom.onfocus = function () { form_on(gID); }
}

function httpr(ID, gme, nme, eml, cmt, fnum) {
//server update code////////////////////////////////////////////////////
http_request = false;

        // Mozilla/Safari
        if (window.XMLHttpRequest) {
                http_request = new XMLHttpRequest();
                http_request.overrideMimeType('text/xml');
        }
        // IE
        else if (window.ActiveXObject) {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
        }


        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
 
 var url = 'http://www.gamerzlink.com/useracts/leave_com.php';

    http_request.onreadystatechange = alertContents;
    http_request.open('POST', url, true);
    http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http_request.send('gme=' + gme + '&fld=' + ID + '&nme=' + nme + '&eml=' + eml + '&cmt=' + cmt);

function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
			
main = ge('leave_div_'+ID);

if (fnum == 1) {
mp = main.parentNode
mp.removeChild( main )

sdiv = ge('l_'+ID);
sdiv.innerHTML = "<a href=\"javascript:vcom('" + ID + "', '" + gme + "');\">View Comments</a>";

main = ge('com_'+ID);
spn = so_getText(main.getElementsByTagName('span')[0]);
spn = 1 + Number(spn);
main.getElementsByTagName('span')[0].firstChild.data = spn;	

} else {

cp = ge('sub_com');

//delete comments
if (cp.hasChildNodes())
{
while( cp.firstChild ) {
    //delete all the stat info 
    cp.removeChild( cp.firstChild );
}
}

mp = main.parentNode
mp.removeChild( main )

vcom_http2(ID, gme)

}




            } else {
                alert('There was a problem with the request.');
            }
        }
    }
}//end httpr

/*
function httpr2(ID, gme, nme, eml, cmt) {
//server update code////////////////////////////////////////////////////
http_request = false;

        // Mozilla/Safari
        if (window.XMLHttpRequest) {
                http_request = new XMLHttpRequest();
                http_request.overrideMimeType('text/xml');
        }
        // IE
        else if (window.ActiveXObject) {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
        }


        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
 
 var url = 'http://www.gamerzlink.com/useracts/leave_com.php';

    http_request.onreadystatechange = alertContents;
    http_request.open('POST', url, true);
    http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    http_request.send('gme=' + gme + '&fld=' + ID + '&nme=' + nme + '&eml=' + eml + '&cmt=' + cmt);

function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
	
cp = ge('sub_com');

//delete comments
if (cp.hasChildNodes())
{
while( cp.firstChild ) {
    //delete all the stat info 
    cp.removeChild( cp.firstChild );
}
}

main = ge('leave_div_'+ID);

mp = main.parentNode
mp.removeChild( main )

vcom_http2(ID, gme)

            } else {
                alert('There was a problem with the request.');
            }
        }
  
    }
}//end httpr2

*/

function vcom_http2(ID, gme) {

cdiv = ge('sub_com');

//server update code
http_request = false;

        // Mozilla/Safari
        if (window.XMLHttpRequest) {
                http_request = new XMLHttpRequest();
                http_request.overrideMimeType('text/xml');
        }
        // IE
        else if (window.ActiveXObject) {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
        }


        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
  
 var url = 'http://www.gamerzlink.com/templates/php/arc_com_get.php?gme='+gme;
  http_request.onreadystatechange = alertContents;
    http_request.open('GET', url, true);
 http_request.send(null);

    function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
//grab returning XML data
comment_l = http_request.responseXML.getElementsByTagName('cmt');
var ustring="";

for(i=0; i<comment_l.length; i++){
 id = comment_l[i].getAttribute('id')

 cID = comment_l[i].getElementsByTagName('cID')[0].firstChild.nodeValue;
 gzID = comment_l[i].getElementsByTagName('gzID')[0].firstChild.nodeValue;
 related = comment_l[i].getElementsByTagName('related')[0].firstChild.nodeValue;
 name = comment_l[i].getElementsByTagName('name')[0].firstChild.nodeValue;
 comment = comment_l[i].getElementsByTagName('comment')[0].firstChild.nodeValue;
 time = comment_l[i].getElementsByTagName('time')[0].firstChild.nodeValue;
 posted = comment_l[i].getElementsByTagName('posted')[0].firstChild.nodeValue;

ustring += "<div><div class=\"utbar\">";
ustring += "<span class=\"u_spn1\">"+name+" posted...</span>";
ustring += "<span class=\"u_spn2\">Posted on: " + posted + " @ " + time+"</span></div>";
ustring += "<div class=\"u_p1\"><p>"+comment+"</p></div></div>";
 
}//end for

ustring += "<div id=\"bfrm\"></div>";
cdiv.innerHTML = ustring;
bottom_form(ID, gme)

            } else {
                alert('There was a problem with the request.');
            }
        }
    }
}//end vcom_http2
