// invalid login

var inv = '';

inv += '<center>';
inv += '<p style="margin: 45px 25px 25px 20px; line-height: 25px; color: red; font-weight: bold; font-family: Arial, Helvetica, sans-serif;">Your username and/or password is incorrect.<br />Please try again.</p>';
inv += '<p><input onclick="close_lightbox();" style="cursor: pointer;" type="button" value="Close" /></p>';
inv += '</center>';

// classroom account is locked

var lck = '';

lck += '<center>';
lck += '<p style="margin: 45px 25px 25px 20px; line-height: 25px; color: red; font-weight: bold; font-family: Arial, Helvetica, sans-serif;">Your classroom account is now locked. It will be available for use during your normal school hours.<br /><br />You can create your own FREE account now by returning to QW and clicking on SIGN UP FOR FREE.</p>';
lck += '<p style="margin: 0 0 25px 0;"><input onclick="close_lightbox();" style="cursor: pointer;" type="button" value="Return to Qwizzy\'s World" /></p>';
lck += '</center>';


// user timeout - gssg

var tmgssg = '';

tmgssg += '<center>';
tmgssg += '<p style="margin: 25px 0 0 0; line-height: 25px; color: green; font-size: 20px; font-weight: bold;"><img src="/images/logos/gssg_logo_small.png" />GSSG/QW Users</p><p style="font-size: 16px; color: green;">You\'re almost there!</p>';
tmgssg += '<p style="margin: 15px 20px 0 20px; font-size: 13px; line-height: 17px; color: black; font-weight: bold;">Either you are not logged in to Qwizzy\'s World, or you have been logged off after being idle for more than 120 minutes.</p>';
tmgssg += '<p style="margin: 15px 20px 0 20px; font-size: 13px; line-height: 17px; color: black; font-weight: bold;">Please login again and you will be taken directly to your page.</p>';
tmgssg += '<p style="margin: 15px 30px 0 30px; font-size: 13px; line-height: 17px; color: red; font-weight: bold;">If you don\'t have a QW username, just close this box and click on "Sign Up for Free" on the main QW page. Please fill in the form and submit it. Your parent will be sent an email with instructions on how to complete your registration.</p>';
tmgssg += '<form action="/login_process.html" method="post">';
tmgssg += '<input type="hidden" value="/" name="caller" />';
tmgssg += '<p style="margin: 15px 0 0 0; color: black; font-size: 13px; font-weight: bold;">Username<br /><input type="text" name="username" size="35" maxlength="15" /></p>';
tmgssg += '<p style="margin: 15px 0 15px 0; color: black; font-size: 13px; font-weight: bold;">Password<br /><input type="password" name="password" size="35" maxlength="30" /></p>';
tmgssg += '<p><input type="submit" value="Login" />&nbsp;&nbsp;';
tmgssg += '<input onclick="close_lightbox();" style="cursor: pointer;" type="button" value="Close" /></p>';
tmgssg += '</form>';
tmgssg += '</center>';

// forgot password

var fgp = '';

fgp += '<center><br /><br />';
fgp += '<p style="margin: 25px; line-height: 25px; color: red; font-weight: bold;">Please enter your email address and username below. Your password will be sent to you.</p>';
fgp += '<form action="/forgot_password.html" method="post" onsubmit="return submitChkpw(this);">';
fgp += '<p>Username<br /><input type="text" name="username" size="35" maxlength="15" /></p>';
fgp += '<p>Email Address<br /><input type="text" name="email" size="35" maxlength="75" /></p>';
fgp += '<p><input type="submit" value="Send" />&nbsp;&nbsp;&nbsp;<input onclick="close_lightbox();" style="cursor: pointer;" type="button" value="Close" /></p>';
fgp += '</form>';
fgp += '</center>';

// forgot password response

var fgpr1 = '';

fgpr1 += '<center><br /><br />';
fgpr1 += '<p style="margin: 25px; line-height: 25px; color: green; font-weight: bold;">Your new password has been sent to your email address.</p>';
fgpr1 += '<p><input onclick="close_lightbox();" style="cursor: pointer;" type="button" value="Close" /></p>';

// forgot password - bad email supplied

var fgpr2 = '';

fgpr2 += '<center>';
fgpr2 += '<p style="margin: 25px; line-height: 25px; color: red; font-weight: bold;">The email or username you entered is not recognized. Be sure these are the same as those you gave at the time you registered.</p>';
fgpr2 += '<p style="margin: 25px; line-height: 25px; color: red; font-weight: bold;">Please enter your email address and username below. Your password will be sent to you.</p>';
fgpr2 += '<form action="/forgot_password.html" method="post" onsubmit="return submitChkpw(this);">';
fgpr2 += '<p>Username<br /><input type="text" name="username" size="35" maxlength="15" /></p>';
fgpr2 += '<p>Email Address<br /><input type="text" name="email" size="35" maxlength="75" /></p>';
fgpr2 += '<p><input type="submit" value="Send" />&nbsp;&nbsp;&nbsp;<input onclick="close_lightbox();" style="cursor: pointer;" type="button" value="Close" /></p>';
fgpr2 += '</form>';
fgpr2 += '</center>';
fgpr2 += '</center>';

// forgot username

var fgu = '';

fgu += '<center>';
fgu += '<p style="margin: 25px auto 25px auto; width: 450px; font-size: 16px; line-height: 22px; color: red; font-weight: bold;">Please enter your email address below. Your username will be sent to you.</p>';
fgu += '<form action="/forgot_username.html" method="post" onsubmit="return submitChk(this);">';
fgu += '<p><input type="text" name="email" size="35" maxlength="75" /></p>';
fgu += '<p><input type="submit" value="Send" />&nbsp;&nbsp;&nbsp;<input onclick="close_lightbox();" style="cursor: pointer;" type="button" value="Close" /></p>';
fgu += '<p id="err_msgs" style="color: red; font-size: 10px; text-align: center; vertical-align: bottom; margin: 0px;"></p>';










fgu += '</form>';
fgu += '</center>';

// forgot username response

var fgur1 = '';

fgur1 += '<center><br /><br />';
fgur1 += '<p style="margin: 25px; line-height: 25px; color: green; font-weight: bold;">Your username(s) have been sent to your email address.</p>';
fgur1 += '<p><input onclick="close_lightbox();" style="cursor: pointer;" type="button" value="Close" /></p>';
fgur1 += '</center>';

// forgot username - bad email supplied

var fgur2 = '';

fgur2 += '<center><br /><br />';
fgur2 += '<p style="margin: 25px; line-height: 25px; color: red; font-weight: bold;">The email you entered is not recognized. Be sure this is the same email address you gave at the time you registered.</p>';
fgur2 += '<p style="margin: 25px; line-height: 25px; color: red; font-weight: bold;">Please enter your email address below. Your username will be sent to you.</p>';
fgur2 += '<form action="/forgot_username.html" method="post" onsubmit="return submitChk(this);">';
fgur2 += '<p><input type="text" name="email" size="35" maxlength="75" /></p>';
fgur2 += '<p><input type="submit" value="Send" />&nbsp;&nbsp;&nbsp;<input onclick="close_lightbox();" style="cursor: pointer;" type="button" value="Close" /></p>';
fgur2 += '</form>';
fgur2 += '</center>';






























// login - choose gold vs. free

var upg = '';

upg += '<center>';
upg += '<div><img style="z-index: -1; width: 330px; position: absolute; top: 75px; left: 80px; opacity: 0.2; -moz-opacity: 0.2; filter:alpha(opacity=20); border: 0;" src="/images/logos/qw2.jpg" /></div>';
upg += '<div style="margin: 25px 25px 25px 25px; line-height: 19px; color: #36700B; font-size: 14px; font-weight: bold; text-align: center; font-family: Arial, Helvetica, sans-serif;">';
upg += '<p>QW is now offering a FREE study option.</p>';
upg += '<p>You are currently a <span style="font-size: 18px; color: #d29f1f;">GOLD</span> member which offers access to all special features of the QW site:</p>';
upg += '<ul style="color: blue; margin: 0 0 0 120px; text-align: left;"><li>Knowledge Nook</li><li>JennaBug II</li><li>Write My Own</li><li>Extra Contest Points.</li></ul>';
upg += '<p>If you wish to be a FREE member only, please select FREE and you will continue to have access, but without the special features and your card will no longer be charged. Since you are currently set up as a paying GOLD, click GOLD if you wish to have your same continued access.</p>';
upg += '<p>Thanks for your continued support of QW!</p>';
upg += '<p style="margin-top: 20px;"><input onclick="document.location.href=\'/gold_selection.html\';" type="button" value="REMAIN GOLD" />&nbsp;&nbsp;&nbsp;<input onclick="document.location.href=\'/downgrade_process.html\';" type="button" value="FREE" />&nbsp;&nbsp;&nbsp;<a href="choose-characters.html"><input onclick="close_lightbox();" style="cursor: pointer;" type="button" value="Exit - Decide Later" /></a></p>';
upg += '</div>';
upg += '</center>';

// add new question pop-up

var new_q = '';

new_q += '<center><br />';
new_q += '<table style="margin: 25px;" border="0" cellspacing="0" cellpadding="0"><tr><td class="question_type_text">What type question do you want to add?</td></tr>';
new_q += '<tr><td>&nbsp;</td></tr>';
new_q += '<tr><td class="question_types"><input type="radio" name="pop_questiontype" value="3" onclick="save_new_q_lightbox(this.value);" checked />&nbsp;TRUE/FALSE</td></tr>';
new_q += '<tr><td class="question_types"><input type="radio" name="pop_questiontype" value="5" onclick="save_new_q_lightbox(this.value);" />&nbsp;MATCHING</td></tr>';
new_q += '<tr><td class="question_types"><input type="radio" name="pop_questiontype" value="4" onclick="save_new_q_lightbox(this.value);" />&nbsp;MULTIPLE CHOICE</td></tr>';
new_q += '<tr><td class="question_types"><input type="radio" name="pop_questiontype" value="1" onclick="save_new_q_lightbox(this.value);" />&nbsp;FILL IN THE BLANK</td></tr>';
new_q += '<tr><td class="question_types"><input type="radio" name="pop_questiontype" value="2" onclick="save_new_q_lightbox(this.value);" />&nbsp;OPEN ENDED</td></tr>';
new_q += '</table>';
new_q += '<p><img style="cursor: pointer;" onclick="sub_new_q_lightbox();" border="0" src="/images/buttons/continue.gif" />&nbsp;&nbsp;&nbsp;<img style="cursor: pointer;" onclick="return close_lightbox();" border="0" src="/images/buttons/cancel_small.gif" /></p>';
new_q += '</center>';

// CAUTION: IE bug: ids and names cannot be the same, hence "pop_name" vs. "name"

function save_new_q_lightbox(v)
{
	// transfer value from lightbox to form for submit
	document.form1.questiontype.value = v;
}

function sub_new_q_lightbox()
{
	// close it now in case question is not complete
	close_lightbox();	
	
	tinyMCE.triggerSave();	
	
	var f = document.getElementById('form1');
	
	// return doesn't seem to work here, so test the return value	
	if (submitChk(f))
	{	
		f.submit();
	}
}

// ultimate.html prompt for quiz name, grade, subject, description

var ult = '';

ult += '<center>';
ult += '<p style="margin: 25px; line-height: 25px; color: green; font-weight: bold; font-size: 16px;">Please supply a name, grade, subject and description for your Ultimate Quiz.</p>';
ult += '<table width="99%" border="0" align="center" cellpadding="0" cellspacing="4" style="margin: 10px;">';
ult += '<tr height="35">';
ult += '<td align="right" valign="bottom" class="lightbox_text">New Quiz Name:&nbsp;</td>';
ult += '<td align="left" valign="bottom"><input name="pop_name" value="" id="pop_name" type="text" size="30" maxlength="30" /></td>';	
ult += '</tr>';
ult += '<tr height="35">';
ult += '<td align="right" valign="bottom" class="lightbox_text">Grade:&nbsp;</td>';
ult += '<td align="left" valign="bottom"><select id="pop_grade" name="pop_grade">';
ult += '<option value="-1">Pre-K</option>';
ult += '<option value="0">Kindergarten</option>';
ult += '<option value="1">1st</option>';
ult += '<option value="2">2nd</option>';
ult += '<option value="3">3rd</option>';
ult += '<option value="4">4th</option>';
ult += '<option value="5">5th</option>';
ult += '<option value="6">6th</option>';
ult += '<option value="7">7th</option>';
ult += '<option value="17">N/A</option>';
ult += '</select></td>';
ult += '</tr>';
	
ult += '<tr height="35">';
ult += '<td align="right" valign="bottom" class="lightbox_text">Subject:&nbsp;</td>';
ult += '<td align="left" valign="bottom" class="lightbox_text"><select id="pop_subject" name="pop_subject">';
ult += '<option value="Social Studies">Social Studies</option>';
ult += '<option value="Language Arts">Language Arts</option>';
ult += '<option value="Math">Math</option>';
ult += '<option value="Science">Science</option>';
ult += '<option value="French">French</option>';
ult += '<option value="Spanish">Spanish</option>';
ult += '<option value="Italian">Italian</option>';
ult += '<option value="German">German</option>';
ult += '<option value="Latin">Latin</option>';
ult += '<option value="Other">Other</option>';
ult += '</select>';
ult += '&nbsp;&nbsp;&nbsp;Other:&nbsp;<input value="';	
ult += '" name="pop_subject_other" id="pop_subject_other" type="text" size="20" maxlength="25" /></td>';
ult += '</tr>';

ult += '<tr height="35">';
ult += '<td align="right" valign="bottom" class="lightbox_text">Description:&nbsp;</td>';
ult += '<td align="left" valign="bottom"><input name="pop_description" value="" id="pop_description" type="text" style="width: 420px;" maxlength="75" /></td>';	
ult += '</tr></table>';		
	
ult += '<p><input type="submit" value="Submit" onclick="return chk_ult_lightbox();" />&nbsp;&nbsp;&nbsp;<input style="cursor: pointer;" type="button" value="Cancel" onclick="return close_lightbox();" /></p>';

ult += '</center>';

// CAUTION: IE bug: ids and names cannot be the same, hence "pop_name" vs. "name"

function chk_ult_lightbox()
{
	if (document.getElementById('pop_name').value == '')
	{
		alert("ERROR - Please enter a name for your quiz."); 
		document.getElementById('pop_name').focus(); 
		return false;
	}

	// transfer values from lightbox to form for submit
	document.fullform.name.value = document.getElementById('pop_name').value;
	document.fullform.grade.value = document.getElementById('pop_grade').value;
	document.fullform.subject.value = document.getElementById('pop_subject').value;
	document.fullform.subject_other.value = document.getElementById('pop_subject_other').value;
	document.fullform.description.value = document.getElementById('pop_description').value;
	
	document.fullform.submit();
	
	return true;
}
