document.cookie = "copyright=2004;path=/;domain=mofunzone.com";
if (window != top) top.location.href = location.href;
function CheckDropDown(form_name,field_name)
{
if(document[form_name][field_name].value != 0)
{
if(! document[form_name]['submit'].value)
{
document[form_name].submit();
}
return true;
}
else
{
alert("Select a valid choice from the drop-down list.");
return false;
}
}
function display_review_form(game_id,game_category,clicked)
{
if(username)
{
if(game_category == 'site_news')
{
ajx_rv=0;
review_title = "Leave a Comment (500 Max Characters)";
}
else if (game_category == 9)
{
ajx_rv = 9;
review_title = "Please write your review below (500 Max Characters)";
}
else
{
ajx_rv=0;
review_title = "Please write your review below (500 Max Characters)";
}
cntnr_cntnt = '<div id="indx_gry_br">\
<p id="indx_gry_br_txt">\
 '+review_title+':\
</p>\
</div>\
<form name="game_review" action="/review.php" method="POST" onSubmit="return check_review_form();">\
<input type="hidden" name="id" value="'+game_id+'">\
<input type="hidden" name="category" value="'+game_category+'">\
<textarea onKeyUP="restrictLength(review, 500)" name="review" id="tll_a_frnd_txtarea" style="font-family: arial; font-size: 13px; margin-left: 10px; padding-left: 5px; overflow: auto; width: 450px; height 200px"></textarea>\
<p align="center" id="mrgn_t_10">\
<input name="submit" type="submit" value="Submit!">\
</p>\
</form>';
replace_content('dynmc_onln_gm',cntnr_cntnt);
}
else if(clicked)
{
alert('Error - You are not logged in, please login at the top of the page.');
document.qck_lgn.username.focus(); document.qck_lgn.username.select();
}
return false;
}
function display_share_form(game_title)
{
cntnr_cntnt = '<div id="indx_gry_br">\
<p id="indx_gry_br_txt">\
Tell A Friend About '+game_title+':\
</p>\
</div>\
<form name="tell_a_friend" method="post" action="/MAIL.php">\
<input type="hidden" name="type" value="2">\
<div id="indx_on_gms_dvB">\
<p id="indx_ltst_cat">\
<b id="mrgn_r_50">Your Email:</b> <input type="text" name="emailFROM" id="tll_a_frnd_txt_bx">\
</p>\
<br>\
<p id="indx_ltst_cat">\
<b id="mrgn_r_5">Friend\'s Email(s):</b> <input type="text" name="emailTO" id="tll_a_frnd_txt_bx">\
</p>\
<font size=1>Separate multiple emails with commas</font>\
</div>\
<div id="indx_on_gms_dvC">\
<p id="indx_ltst_cat">\
Add A Message: <font size="1" id="rmv_bld">(optional)</font>\
</p>\
<p>\
<textarea name="msg" id="tll_a_frnd_txtarea"></textarea>\
</p>\
<p id="mrgn_t_10">\
<input type="submit" value="Send to friend(s)">\
</p>\
</div>\
</form>';
replace_content('dynmc_onln_gm',cntnr_cntnt);
document.tell_a_friend.emailFROM.focus();
return false;
}
function check_review_form()
{
if(document.game_review.review.value.length < 10)
{
alert("Your comment/review is too short, write more.");
return false;
}
if(ajx_rv)
{
today = new Date();
document.getElementById('dynmc_onln_gm').style.display='none';
call_js('/reviewNEW.php?id='+document.game_review.id.value+'&category='+document.game_review.category.value+'&random='+today.getTime()+'&review='+document.game_review.review.value);
return false;
}
else
{
	return true;
}
}
function display_review_report_form(game_id,game_category,review_user,slot)
{
if(username)
{
cntnr_cntnt = '<p id="mrgn_t_10" align="center">\
<center>\
<form name="game_review_report" action="/review_report.php" method="POST" onSubmit="return CheckDropDown(\'game_review_report\',\'reason\');">\
<input type="hidden" name="id" value="'+game_id+'">\
<input type="hidden" name="category" value="'+game_category+'">\
<input type="hidden" name="review_user" value="'+review_user+'">\
<select name="reason" class="slctn" id="drpdwn_bx" style="background-color: #FF9999;">\
<option value="0" style="text-align: center">Choose a reason why:</option>\
<option value="1">1. Contains spam.</option>\
<option value="2">2. Contains swearing</option>\
<option value="3">3. Not in English.</option>\
<option value="4">4. Is an abuse.</option>\
<option value="5">5. Is inappropriate.</option>\
</select>\
<input name="submit" type="Submit" value="Report!">\
</form>\
</center>\
</p>';
document.getElementById('rprt_rvw_dv'+slot).style.display='inline';
replace_content('rprt_rvw_dv'+slot,cntnr_cntnt);
}
else
{
alert('Error - You are not logged in, please login at the top of the page.');
document.qck_lgn.username.focus(); document.qck_lgn.username.select();
}
return false;
}
function add_to_recently_played(id,title)
{
var cookie_date = new Date ( );
cookie_date.setTime (cookie_date.getTime() + 31536000000);
if(getCookie('recently_played_games'))
{
look_for = new RegExp('<option value="/online_games/'+id+'.shtml">'+title+'</option>', 'gi');
recently_played_games = getCookie('recently_played_games').replace(look_for, '');
document.cookie = 'recently_played_games=<option value="/online_games/'+id+'.shtml">'+title+'</option>'+recently_played_games+';expires='+cookie_date.toGMTString()+';path=/;domain=mofunzone.com';
}
else
{
document.cookie = 'recently_played_games=<option value="/online_games/'+id+'.shtml">'+title+'</option>;expires='+cookie_date.toGMTString()+';path=/;domain=mofunzone.com';
}
}
function rltd_gmz()
{
cnt = 0;
while(cnt < 10)
{
document.write('<p><a href="/online_games/'+rltd_gms[cnt]+'.shtml"><img src="http://sttcmfz.firecold.com/images/online_games/med/'+rltd_gms[cnt]+'.jpg" style="margin: 5px 0 0 0"><br>'+rltd_gms[cnt+1]+'</a></p>');
cnt=cnt+2;
}
}

function rt_ajx(gm,rtng)
{
	today = new Date();
	replace_content('gm_rt','Sending vote...');
	call_js('/gamerateNEW.php?random='+today.getTime()+'&gm='+gm+'&rtng='+rtng);
	return false;
}

function flash_zoom(d,e)
{
	obj = document.getElementById("flash_game_object");
	embed = document.getElementById("flash_game_embed");
	
	if (d==0) {
		nw = obj.width*0.9;
		nh = obj.height*0.9;
	}
	else if(d && e)
	{
		nw = d;
		nh = e;
	}
	else{
		nw = obj.width*1.1;
		nh = obj.height*1.1;
	}
	obj.width = nw;
	obj.height = nh;
	embed.width = nw;
	embed.height = nh;
	document.getElementById("prrll_gm").style.width = nw;
	document.getElementById("prrll_gm").style.height = nh;
}

function disableDiv(elm,adX,adY)
{
divIWantToGrayOut = document.getElementById(elm);
divIWantToGrayOut.style.position = 'relative';
grayOutDiv = document.createElement('div');
grayOutDiv.style.position='absolute';
grayOutDiv.style.top='0px';
grayOutDiv.style.left='0px';
grayOutDiv.style.opacity='.5';
grayOutDiv.style.mozOpacity = "0.5";
grayOutDiv.style.filter = "alpha(opacity=50)";
grayOutDiv.style.background='#dedede';
grayOutDiv.style.width='100%';
grayOutDiv.style.height='100%';
	divIWantToGrayOut.appendChild(grayOutDiv);

adDiv = document.createElement('div');
adDiv.style.position='absolute';
adDiv.style.top=adY+'px'; //math: (500-325)/2 ~content width minus adbox width, divide resulting number by 2
adDiv.style.left=adX+'px'; //math: (440-350)/2 ~content height minus adbox height, divide resulting number by 2
adDiv.style.background='white';
adDiv.style.width='325px';
adDiv.style.height='350px';
adDiv.style.border='1px solid #003300';

adDiv.innerHTML='<span><h3>Your Game is Loading...</h3></span><iframe src="/ads/pre_rll_med_rec.html" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" style="width: 300px; height: 250px"></iframe><div id="prrll_ld">Clicking this ad will open in a new window and will not interrupt loading your game :)</div><div id="prrll_bar" style="float: left;">.</div><div id="clr_l_font1px">&nbsp;</div>';

divIWantToGrayOut.appendChild(adDiv);
}

//prrll_ld
time2load=4;
max=70;
count = 0;
epoch_time_now=0;
function prrll_ld()
{
count++;

if(count == 1)
{
	ko = new Date();
	epoch_time_start = ko.getTime();
}
else
{
	ko = new Date();
	epoch_time_now = ko.getTime();
}

if(count>max || (epoch_time_now-epoch_time_start) > 10000) {
document.getElementById('prrll_bar').style.width = '300px';
document.getElementById('prrll_ld').innerHTML='<div onclick="close_prrll()" style="cursor: pointer; height: 50px;"><h3>Click to Close Ad</h3></div>';
return false;
}
document.getElementById('prrll_bar').style.width = 3*(Math.round(count/max*100*1)/1)+'px';
setTimeout('prrll_ld()',time2load*1000/max);
}

function close_prrll()
{
//adDiv.innerHTML='';
//adDiv.style.display='none';
//grayOutDiv.style.display='none';

divIWantToGrayOut.removeChild(adDiv);//new non-lag way
divIWantToGrayOut.removeChild(grayOutDiv);//new non-lag way
if(fixWmode > 0)
{
replace_content('prrll_gm',noWmode);
}
}
