var strMenuId = 0;

function put(html)
{
    document.write(html);
}

function showWindow() {
    window.open('', 'DarkFutureInfo', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,height=513,width=780');
}

function changeStatus(sValue, sUrl, bConfirm)
{
    if(bConfirm == 1 && confirm(sValue)) {
        getXUrl(sUrl, true, true);
    } else if(bConfirm != 1) {
        $(sValue).slideDown();
        getXUrl(sUrl, true, true);
        setTimeout("$('"+sValue+"').slideUp();", 2000);
    }
	
    return false;
}

function showCachetime(date, nextcache) {
    put('<BR>');
    put('<TABLE border="0" cellpadding="0" cellspacing="1" align="center">');
    put('	<TR>');
    put('		<TD align="center"><span style="font-size: 10px; color: #a0a0a0;">This page was cached at '+date+'</span>');
    put('		&nbsp;</TD>');
    put('</TABLE>');
}

function main_0(strDate, strTime, page_status, lfs_checked, helpchat_checked, lfs_class, helpchat_class, lfs_wait)
{
    if(page_status == 1) {
        put('<div id="logged_in_as_guest"></div>')
    }
    put('<div id="snow"></div><div style="position: absolute; z-Index: 101;">');
    if(page_status == 2) {
        put('<a href="/e.php?p=USERS_PREREG.log_off">&laquo; Log out</a> &nbsp;<a href="/e.php?p=USERS_REG.profile"><img src="/images/moscow/profile.png" title="profile" align="absmiddle" /> Profile</a> &nbsp;<a href="/e.php?p=USERS_REG.settings"><img src="/images/moscow/settings.png" title="settings" align="absmiddle" /> Settings</a>');
        if(strDate != '' && strTime != '') {
            put(' &nbsp;|&nbsp; <span>'+strDate+', '+strTime+'</span>');
        }
        put('<div id="lfs" class="top_buttons '+lfs_class+'"><input type="checkbox" onClick="document.location.href=\'/e.php?p=USERS_REG.toggle_lfs\'"' +lfs_checked+' /> Looking for squad '+lfs_wait+'</div>');
        put('<div id="help_chat" class="top_buttons '+helpchat_class+'"><input type="checkbox" onClick="document.location.href=\'/e.php?p=USERS_REG.toggle_helpchat\'"' +helpchat_checked+' /> Available for help/chitchat</div>');
    } else if(page_status == 1) {
        if(strDate != '' && strTime != '') {
            put('<span>'+strDate+', '+strTime+'</span> | ');
        }

        put('<a href="/">frontpage</a> | <a href="/e.php?p=USERS_PREREG.register&show=1" target="DarkFutureInfo" onclick="showWindow();"><b>register</b></a> | <a href="/e.php?p=USERS_PREREG.send_password&show=1" target="DarkFutureInfo" onclick="showWindow();">forgot password?</a>');
        put('<form action="/e.php" method="post" style="margin-top: 10px;">');
        put('&nbsp;<input tabindex="1" type="text" name="name" class="text" value="" style="font-size: 13px; padding: 3px; width: 100px;" id="loginUsername" /><Br />');
        put('&nbsp;<input tabindex="2" type="password" name="pass" class="text" value="" style="font-size: 13px; padding: 3px; width: 100px; margin-top: 2px; " id="loginPassword" />');
        put('&nbsp;&nbsp;<input tabindex="3" type="submit" class="button" value="login" style="font-size: 13px; padding: 3px; height: 24px; margin-top: 2px; " />');
        put('<input type="hidden" name="doit" value="1" />');
        put('</form>');
        
    } else {
        put('<a href="/e.php?p=USERS_PREREG.log_off">&raquo; Log out</a>');
    }
    put('</div>');

    if(strDate) {
    // document.title	= "Dark-future.org - "+strDate+", "+strTime;
    } else {
    //document.title	= "Dark-future.org - Start your life as a gangster!";
    }

    put('<div id="topBar" style="position: absolute; text-align: right; float: right; z-Index: 101; right: 10px;">');
    if(page_status > 0) {
        put('<form action="/e.php?p=USERS_REG.search" method="post" style="margin: 0px;"><p style="margin: 0px;"><b>User search</b> &nbsp;<input type="text" name="name" style="font-size: 13px; padding: 3px; border: 1px solid #fff; color: #fff; background-color: #505050; width: 139px;" /><input type="submit" value=" Go " style="width: 0px; display: none;" /></form></p>');
        put('<p style="display: inline-block; margin-top: 60px; margin-right: 5px;">Powered by <a href="http://www.muntinternet.nl" target="_blank">Muntinternet.nl</a>');
    }

    put('</div>');
    put('<TABLE width="100%" border="0" align="center" cellpadding="0" cellspacing="1" style="height: 560px;">');
    put('	<TR>');
    put('		<TD class="logo" style="padding-top: 13px; padding-bottom: 0px; padding-left: 0px;">');
    if(page_status > 0) {
    // put('<div id="tell_a_friend"><a href="/e.php?p=MISC.tellafriend">Tell a friend & earn cash and tokens! &raquo;</a></div>');
    }
    put('	</TD></TR>');
    put('	<TR>');
    put('		<TD width="100%" height="100%" colspan="9" id="mainContent" class="spacer">');
    put('			<TABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">');
    put('				<TR>');
    put('					<TD rowspan="2" valign="top" class="menuBackground">');
    put('						<TABLE width="100%" height="100%" border="0" align="center" valign="top" cellpadding="0" cellspacing="0">');

}

function main_1(var_title, var_stock_ticker)
{
    put('						</TABLE>');
    put('					</TD>');
    put('					<TD rowspan="2" class="spacer" width="2">' + def_2px + '</TD>');
    put('					<TD rowspan="2" width="100%" height="100%" class="spacer" valign="top" style="padding-top: 0px;">');
    put('						<TABLE width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">');

    // Stocks ticker
    if(var_stock_ticker != 0)
    {
        put('<TR>');
        put('	<TD width="100%" height="1" class="spacer">' + def_1px + '</TD>');
        put('</TR>');
        put('<TR>');
        put('	<TD align="center">');

        var i = 0;
        while (i < var_stock_ticker.length)
        {
            if(var_stock_ticker[i][0] != 'broke')
            {
                put('<nobr><IMG src="' + def_path + '/images/' + var_stock_ticker[i][0] + '.gif">&nbsp;' + var_stock_ticker[i][1] + '%&nbsp;&nbsp;<A href="' + var_stock_ticker[i][2] + '">' + var_stock_ticker[i][3] + '</A></nobr>');
            }
            else
            {
                put('<nobr><IMG src="' + def_path + '/images/' + var_stock_ticker[i][0] + '.gif">&nbsp;&nbsp;' + var_stock_ticker[i][3] + '</nobr>');
            }

            i++;

            if(i < var_stock_ticker.length)
            {
                put('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ');
            }
        }

        put('	</TD>');
        put('</TR>');
    }

    put('							<TR>');
    put('								<TD width="100%" height="1" class="spacer">' + def_1px + '</TD>');
    put('							</TR>');
}

function main_2(var_user_id, var_crew_id, var_online_list, online_total, online_crew, var_buddies, var_ignored, var_city)
{
    put('								</TD>');
    put('							</TR>');
    put('							<TR>');
    put('								<TD width="100%" height="1" class="spacer">' + def_1px + '</TD>');
    put('							</TR>');

    var	crewcount = 0;
    var	i	= 0;
    while(i < var_online_list.length)
    {
        if(var_crew_id == var_online_list[i][2] && var_crew_id > 0 && var_online_list[i][1] != var_user_id)
        {
            crewcount++;
        }
        i++;
    }

    // Online list
    put('						<tr><td align="center" class="online"><div id="defaultWindow" style="width: 90%; text-align: justify;">');
    if(var_online_list == 0) {
    //put('						<h1>Looks like you\'re the only one online :/</h1>');
    } else {
        if (online_total || crewcount)
        {
            put('						<h1>There ' + ( online_total == 1 ? "is 1 user" : "are " + online_total + " users " ) + ' online' + (crewcount > 0 ? (crewcount < 1 ? "" : ', '+crewcount)+' '+(crewcount == 1 ? "crewmember" : "crewmembers") + ''  : ""));
        }
        put('								</h1><p class="onlineList">');


        i = 0;
        while(i < var_online_list.length) {
            var styles = "";
            var extra_class = '';
            if(var_user_id == var_online_list[i][1]) {
                extra_class = 'onlineListSelf';
            } else if(var_crew_id == var_online_list[i][2] && var_crew_id > 0) {
                extra_class = 'onlineListMember';
            }

            if(var_crew_id == var_online_list[i][2] && var_crew_id > 0 && var_buddies[var_online_list[i][1]] == true) {
                extra_class = 'onlineListCrewBuddy';
            } else if(var_buddies[var_online_list[i][1]] == true) {
                extra_class = 'onlineListBuddy';
            }

            if(var_ignored[var_online_list[i][1]] == true) {
                extra_class = 'onlineListIgnored';
            }
            if(var_user_id == var_online_list[i][1]) {
                extra_class = 'onlineListSelf';
            }
            put('<a class="' + var_online_list[i][0] + ' '+extra_class+'" style="'+styles+'" href="/user/' + var_online_list[i][3] + '">' + var_online_list[i][3] + '</a>');

            i++;

            if(i < var_online_list.length) {
                if(var_online_list[i-1]) {
                    put(var_online_list[i-1][4] != var_online_list[i][4] ? ' <b>] &nbsp; [</b>&nbsp;' :  ' <span class="spacer">|</span> ');
                } else {
                    put(' <b>][</b>&nbsp;');
                }
            }
        }

        put('</div></p>');



    }
    put('								</div></TD>');
    put('							</TR>');

    put('							<TR>');
    put('								<TD width="100%" height="1" class="spacer">' + def_1px + '</TD>');
    put('							</TR>');
    put('							<TR>');
    put('								<TH height="15" class="title_bottom">&nbsp;</TH>');
    put('							</TR>');
    put('						</TABLE>');
    put('					</TD>');
    put('					<TD rowspan="2" class="spacer" width="2">' + def_2px + '</TD>');
    put('					<TD rowspan="2" valign="top" class="menuBackground">');
    put('						<TABLE width="100%" height="100%" border="0" align="center" valign="top" cellpadding="0" cellspacing="0">');
}

function showOnline(kind) {


}

function main_3()
{
    put('						</TABLE>');
    put('					</TD>');
    put('				</TR>');
    put('			</TABLE>');
    put('		</TD>');
    put('	</TR>');
    put('</TABLE>');
    put('<p align="center" width="100%"><div style="text-align: center;">');

    put('<br /><a href="http://www.lighttpd.net/" target="_blank"><img src="'+def_path+'/images/powered/light_button.gif" alt="PHP is cached by APC" border="0"></a>&nbsp;');
    put('<a href="http://www.mysql.com/" target="_blank" title="Powered by MySQL 5"><img src="'+def_path+'/images/powered/mysql_button.gif" alt="Powered by MySQL 5" border="0"></a>&nbsp;');
    put('<a href="http://www.php.net/" target="_blank" title="Dark-future.org is powered by PHP"><img src="'+def_path+'/images/powered/php_power.gif" alt="Dark-future.org is powered by PHP" border="0"></a>&nbsp;');
    put('<a href="http://imageshack.us" target="_blank" title="External images are powered by ImageShack"><img src="'+def_path+'/images/powered/imageshack.png" border="0" alt="External images are powered by ImageShack" borer="0" /></a><br />');
    put('<br /><br />');

    //   var m3_u = (location.protocol=='https:'?'https://publish.fictivity.nl/delivery/ajs.php':'http://publish.fictivity.nl/delivery/ajs.php');
    //   var m3_r = Math.floor(Math.random()*99999999999);
    //   if (!document.MAX_used) document.MAX_used = ',';
    //   document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
    //   document.write ("?zoneid=4");
    //   document.write ('&amp;cb=' + m3_r);
    //   if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
    //   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
    //   document.write ("&amp;loc=" + escape(window.location));
    //   if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
    //   if (document.context) document.write ("&context=" + escape(document.context));
    //   if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
    //   document.write ("'><\/scr"+"ipt>");
    // put("<a href='http://publish.fictivity.nl/adclick.php?n=ad400dab' target='_blank'><img src='http://publish.fictivity.nl/adview.php?what=zone:4&amp;n=ad400dab' border='0' alt=''></a>");
    put('</div></p>');
}


function toggleMenu(strMenuId) {
    var object = document.getElementById(strMenuId);
    var object2 = document.getElementById(strMenuId+'_shortcut');

    if(object.style.display == '') {
        object.style.display = 'none';
        object2.style.display = '';
        setCookie("m_"+strMenuId, 'n');
    } else {
        object.style.display = '';
        object2.style.display = 'none';
        setCookie("m_"+strMenuId, '');
    }
}


function menu_top(var_class, var_title, var_shortcuts, var_id) {
    strMenuId = var_id;
    put('<TR class="'+var_class+'">');
    put('	<TD width="100%" id="'+strMenuId+'_shortcut" class="shortcut_top" style="display: '+(getCookie('m_'+strMenuId) == 'n' ? '' : 'none')+'; padding-left: 5px; padding-top: 3px;">');
    put('	<a href="javascript://" onClick="toggleMenu(\''+strMenuId+'\');"><img src="'+def_path+'/images/moscow/menu_expand.png" border="0" alt="Maximize menu '+var_title+'" align="absmiddle"></a>&nbsp;&nbsp;'+var_shortcuts+'</TD>');
    put('	<TD width="100%" id="'+strMenuId+'" style="display: '+(getCookie('m_'+strMenuId) == 'n' ? 'none' : '')+';">');
    put('		<TABLE cellpadding=0 cellspacing=0 width="100%">');
    put('			<TR>');
    put('				<TH align="left" height="15" class="title_top" nowrap onClick="toggleMenu(\''+strMenuId+'\');" style="padding-top: 5px;"><img src="'+def_path+'/images/moscow/menu_collapse.png" border="0" alt="Minimize menu '+var_title+'" align="absmiddle" style="margin-right: 3px;">&nbsp;<FONT class="' + var_class + '">' + var_title + '</FONT></TH>');
    put('			</TR>');
    put('			<TR>');
    put('				<TD width="100%" valign="top"><ul class="paddedMenu">');

}

function menu_item(var_class, var_href, var_title) {
    put('<li class="' + var_class + '"><a href="' + var_href + '">' + var_title + '</a></li>');
}

function menu_bottom() {
    put('					</ul>');
    put('				</td>');
    put('			</tr>');
    put('		</table>');
    put('	</td>');
    put('</tr>');
}

function menu_finish() {
    put('<tr>');
    put('	<td width="100%" height="100%" valign="top" class="padded">' + def_1px + '</td>');
    put('</tr>');
}

function menu_info(var_class, var_info) {
    put('<div class="' + var_class + '">' + var_info + '</div>');
}

function menu_spacer() {
}

function messagebox(var_title, var_message, var_buttons, var_topmargin, var_class)
{
    if(var_class == '') {
        put('<div id="messageBox" '+(var_topmargin > 0 ? 'style="top: '+var_topmargin+'"' : '')+'>');
    } else {
        put('<div id="'+var_class+'" '+(var_topmargin > 0 ? 'style="top: '+var_topmargin+'"' : '')+'>');
    }
    if(!var_title) {
        put('	<h2>' + var_title + '</h2>');
    }
    put('	<p>' + var_message + '</p>');

    if(var_buttons)	{
        put('<div class="">');
        var	i		= 0;
        while(i < var_buttons.length) {
            put('	<form action="' + var_buttons[i][1] + '" method="post" style="margin: 0px; float: left;">');
            // Ok
            if(var_buttons[i][0] == 'ok') {
                put('		<INPUT class="" id="buttonOK" type="image" src="/images/v15/message_box_button_ok.png" value="">&nbsp;');
                put('		<INPUT type="hidden" name="button" value="ok">');
            }
            // Cancel
            else if(var_buttons[i][0] == 'cancel')
            {
                put('		<INPUT class="" id="buttonOK" type="image" src="/images/v15/message_box_button_cancel.png" value="">&nbsp;');
                //put('		<INPUT class="button" style="width:60; height: 18px;" type="submit" value="Cancel">&nbsp;');
                put('		<INPUT type="hidden" name="button" value="cancel">');
            }
            // Yes
            else if(var_buttons[i][0] == 'yes')
            {
                put('		<INPUT class="button" style="height: 18px;" type="submit" value="Yes">&nbsp;');
                put('		<INPUT type="hidden" name="button" value="yes">');
            }
            // No
            else if(var_buttons[i][0] == 'no')
            {
                put('		<INPUT class="button" style="height: 18px;" type="submit" value="No">&nbsp;');
                put('		<INPUT type="hidden" name="button" value="no">');
            }
            // Custom
            else if(var_buttons[i][0] == 'custom')
            {
                put('		<INPUT class="button" style="height: 28px;" type="submit" value="' + var_buttons[i][2] + '">&nbsp;');
                put('		<INPUT type="hidden" name="button" value="' + var_buttons[i][3] + '">');
            }
            put('	</form>');
            i++;
        }
        put('</div>');
    }
    put('</div>');
}

function pages(var_cur_page, var_per_page, var_count, var_url, var_class)
{
    var var_select_count = 0;

    if(var_count > 300) {
        var_select_count = var_count;
        var_count = 300;
    }
    if(var_cur_page == undefined) {
        var_cur_page = 0;
    }

    var i		= 0;
    var pages	= Math.ceil(parseInt(var_count) / parseInt(var_per_page));

    var chr		= '&';

    if(var_url.indexOf('?') == -1) {
        chr	= '?';
    }

    if(var_class != '') {
        var_class	= ' class="' + var_class + '"';
    }

    if(pages > 1) {
        if(var_select_count < 1) {
            if(var_cur_page > 0) {
                put('<A href="' + var_url + chr + 'pag=' + (parseInt(var_cur_page) - 1) + '"' + var_class + '>&lt;&lt;</A> ');
            } else {
                put('&lt;&lt; ');
            }
        }

        while(i < pages) {
            if(var_cur_page == i) {
                put((i + 1) + ' ');
            } else {
                put('<A href="' + var_url + chr + 'pag=' + i + '"' + var_class + '>' + (i+1) + '</A> ');
            }
            i++;
        }

        if(var_select_count < 1) {
            if(var_cur_page < pages - 1) {
                put('<A href="' + var_url + chr + 'pag=' + (parseInt(var_cur_page) + 1) + '"' + var_class + '>&gt;&gt;</A>');
            } else {
                put('&gt;&gt;');
            }
        }
    } else {
        put('&nbsp;');
    }

    if(var_select_count > 0) {
        put(' &nbsp; &nbsp; &nbsp; ');
        if(var_cur_page > 0) {
            put('<A href="' + var_url + chr + 'pag=' + (parseInt(var_cur_page) - 1) + '"' + var_class + '>&lt;&lt;</A> ');
        } else {
            put('&lt;&lt; ');
        }
        put('<select style="width: 60px;" id="pageSelection" onChange="changePage(\''+var_url+'\',\''+chr+'\',this);">');
        var pages	= Math.ceil(parseInt(var_select_count) / parseInt(var_per_page));
        for(i = 1, count = pages; i <= count; i++) {
            if(var_cur_page == (i-1)) {
                put('<option value="'+(i-1)+'" selected>'+i+'</option>');
            } else {
                put('<option value="'+(i-1)+'">'+i+'</option>');
            }
        }
        put('</select>');
        if(var_cur_page < pages - 1) {
            put(' <A href="' + var_url + chr + 'pag=' + (parseInt(var_cur_page) + 1) + '"' + var_class + '>&gt;&gt;</A>');
        } else {
            put(' &gt;&gt;');
        }
    }
}

function pages_ajax(var_cur_page, var_per_page, var_count, var_url, var_class)
{
    var var_select_count = 0;
    var sPagesContent = '';

    if(var_count > 300) {
        var_select_count = var_count;
        var_count = 300;
    }
    if(var_cur_page == undefined) {
        var_cur_page = 0;
    }

    var i		= 0;
    var pages	= Math.ceil(parseInt(var_count) / parseInt(var_per_page));

    var chr		= '&';

    if(var_url.indexOf('?') == -1) {
        chr	= '?';
    }

    if(var_class != '') {
        var_class	= ' class="' + var_class + '"';
    }

    if(pages > 1) {
        if(var_select_count < 1) {
            if(var_cur_page > 0) {
                sPagesContent +=  ('<a onClick="return getXUrl(\'' + var_url + chr + 'pag=' + (parseInt(var_cur_page) - 1) + '\');" href="' + var_url + chr + 'pag=' + (parseInt(var_cur_page) - 1) + '"' + var_class + '>&lt;&lt;</A> ');
            } else {
                sPagesContent +=  ('&lt;&lt; ');
            }
        }

        while(i < pages) {
            if(var_cur_page == i) {
                sPagesContent +=  ((i + 1) + ' ');
            } else {
                sPagesContent +=  ('<a onClick="return getXUrl(\'' + var_url + chr + 'pag=' + i + '\');" href="' + var_url + chr + 'pag=' + i + '"' + var_class + '>' + (i+1) + '</A> ');
            }
            i++;
        }

        if(var_select_count < 1) {
            if(var_cur_page < pages - 1) {
                sPagesContent +=  ('<a onClick="return getXUrl(\'' + var_url + chr + 'pag=' + (parseInt(var_cur_page) + 1) + '\');" href="' + var_url + chr + 'pag=' + (parseInt(var_cur_page) + 1) + '"' + var_class + '>&gt;&gt;</A>');
            } else {
                sPagesContent +=  ('&gt;&gt;');
            }
        }
    } else {
        sPagesContent +=  ('&nbsp;');
    }

    if(var_select_count > 0) {
        sPagesContent +=  (' &nbsp; &nbsp; &nbsp; ');
        if(var_cur_page > 0) {
            sPagesContent +=  ('<a onClick="return getXUrl(\'' + var_url + chr + 'pag=' + (parseInt(var_cur_page) - 1) + '\');" href="' + var_url + chr + 'pag=' + (parseInt(var_cur_page) - 1) + '"' + var_class + '>&lt;&lt;</A> ');
        } else {
            sPagesContent +=  ('&lt;&lt; ');
        }
        sPagesContent +=  ('<select style="width: 60px;" id="pageSelection" onChange="changePage(\''+var_url+'\',\''+chr+'\',this, true);">');
        var pages	= Math.ceil(parseInt(var_select_count) / parseInt(var_per_page));
        for(i = 1, count = pages; i <= count; i++) {
            if(var_cur_page == (i-1)) {
                sPagesContent +=  ('<option value="'+(i-1)+'" selected>'+i+'</option>');
            } else {
                sPagesContent +=  ('<option value="'+(i-1)+'">'+i+'</option>');
            }
        }
        sPagesContent +=  ('</select>');
        if(var_cur_page < pages - 1) {
            sPagesContent +=  (' <a onClick="return getXUrl(\'' + var_url + chr + 'pag=' + (parseInt(var_cur_page) + 1) + '\');" href="' + var_url + chr + 'pag=' + (parseInt(var_cur_page) + 1) + '"' + var_class + '>&gt;&gt;</A>');
        } else {
            sPagesContent +=  (' &gt;&gt;');
        }
    }

    return sPagesContent;
}

function changePage(var_url,chr,object, load_ajax){
    if(object) {
        if(load_ajax == true) {
            getXUrl(var_url+chr+'pag='+object.value);
        } else {
            document.location.href=var_url+chr+'pag='+object.value;
        }
    }
}

function manual_external() {
    put('<p align="center">If the manual doesn\'t open by itself. Click <a href="#" onClick="window.open(\'http://wiki.dark-future.org\');">here</a>.</p>');
    window.open('http://wiki.dark-future.org');
}

function check_request(var_check_img)
{
    put('<div id="defaultWindow" style="width: 300px;">');
    put('	<h1>Anti-scripting check</h1>');
    put('	<form name="check" method="post">');
    put('		<p>Enter the numbers corresponding with the characters and words in the field.</p>');
    put('</div>');
    put('<div id="defaultWindow" style="width: 300px; text-align: center; margin-bottom: 100px;">');
    put('		<IMG src="'+var_check_img+'" style="width: 240px; height: 50px;" border=1 bordercolor="#000000"></p>');
    put('		<INPUT class="text" name="requestCheck" id="requestCheck" type="text" style="width: 50px; font-size: 21px;" maxlength="3"> ');
    put('		<INPUT class="btn" type="submit" style="width: 50px; font-size: 21px;" value="ok">');
    put('</div>');
    put('	</form>');
    setTimeout('intIsElementInFocus = true; document.getElementById(\'requestCheck\').focus()', 100);
}

function showTable_V2(id, callFunction) {
    if(strHiliteId == id) {
        return;
    }

    if(!document.getElementById(id) && id) {
        return;
    }

    if(getCookie('sT') == 1) {
        for(i = 0, iCount = aNavigation.length; i < iCount; i++) {
            if(getCookie('n'+aNavigation[i][0]) == 1 && id == undefined) {
                id = aNavigation[i][0];
                break;
            }
        }
    }

    for(i = 0, iCount = aNavigation.length; i < iCount; i++) {
        if(id == undefined && aNavigation[i][2] == true) {
            id = aNavigation[i][0];
        }

        if(document.getElementById(aNavigation[i][0])) {
            document.getElementById(aNavigation[i][0]).style.display = 'none';
        }
        document.getElementById(aNavigation[i][0]+'_button').className = '';
        setCookie('n'+aNavigation[i][0], '');
    }

    strHiliteId = id;
    setCookie('n'+id, '1');
    if(document.getElementById(sFormId)) {
        document.getElementById(sFormId).reset();
    }
    document.getElementById(id+'_button').blur();
    document.getElementById(id).style.display = '';
    document.getElementById(id+'_button').className = 'active';

    if(callFunction != undefined) {
        eval(callFunction);
    }
}

var aTime = new Array();
function setProgressBar(id, idNo, iWidth, iTime, iProgress, prefix) {
    aTime[id] = iTime;
    iProgress = (100 - iProgress);
    iTotal = ((100/iProgress)*aTime[id]);
    setInterval("updateProgressBar('"+id+"', '"+idNo+"', "+iWidth+", "+iTotal+", '"+prefix+"')", 500);

    $(document).ready(function() {
        if(getCookie('sB') == 1) {
            for(var i = 0; i < 40; i++) {
                $("#"+id).animate({
                    opacity: 0
                }, 500).animate({
                    opacity: 1
                }, 500);
            }
        }
    });
    return '';
}

function updateProgressBar(id, idNo, iWidth, iTotal, prefix) {

    if($("#"+id) && $("#"+idNo)) {
    } else {
        return;
    }

    if(aTime[id] > 0) {
        aTime[id] = aTime[id] - 0.5;
        $("#"+id).css('width', Math.round(iWidth*(1-(aTime[id]/iTotal)))+'%');
    } else {
        if(getCookie('sB') == 1) {
            aTime[id] = aTime[id] - 0.5;
            if(aTime[id] % 4 == 0) {
                $("#"+id).css('width', '0%');
            } else {
                $("#"+id).css('width', '100%');
            }
        }
    }

    if(aTime[id] < 1) {
        $("#"+id).css('width', '100%');
        $("#"+idNo).html(prefix+" (ready)");
    } else {
        $("#"+idNo).html(prefix+" ("+Math.round(aTime[id])+"s)");
    }
}





