/*
* Author Praveen
* Date : 31/12/2007
*
*/

//arguments
//----------
//variable for exam year and name : examName,examyear
//isNew : if new results are out
//await : if results are pending to be published
//formname : action jsp of the form
//charwidth :  character width for textbox
function get_banner(examName,isNew,await,formname,exyear,charwidth){
	var newCode, innerTable,imagepath;
	imagepath = "images/new1.gif";
	if(isNew == "yes"){
		newCode = " <td width='40' height='33'><img src='" + imagepath +" ' width='25' height='14'></td>" 
	}
	else{
		newCode = "<td width='40' height='33'></td>"
	}
	
	if(await == "yes"){
		innerTable = 	"<table width=\"80%\" height=\"100%\" border=\"0\" cellspacing=\"4\" cellpadding=\"0\">"+
                      	"<tr>"+
                        " <td width=\"32%\" align=\"center\" class=\"body\"><img src=\""+imagepath+"\" width=\"25\" height=\"14\"></td>"+
                        " <td width=\"68%\" align=\"center\" class=\"body\"><strong>AWAIT RESULTS </strong></td>"+
                      	"</tr>"+
                    	"</table>";
	}
	else{
		innerTable = 	"<table width='80%'  border='0' cellspacing='4' cellpadding='0'>" +
				  		"<tr>" +
						" <td align='center' class='body'>Enter your Index Number</td>" +
						"</tr>" +
						"<tr>" +
						" <td align='center'><input name='indexno' type='text' class='box1' size='7' maxlength='"+charwidth+"'></td>" +
						"</tr>" +
						"<tr>" +
						" <td align='center'>"+
						"  <table width='100%' cellpadding='0' cellspacing='0'>" +
						"   <tr>"+
						      newCode +
						"     <td align='left'><input name='submit' type='submit' value='Submit'>" +
						"      <input name='action' type='hidden' value='result'>" +
						"      <input name='exyear' type='hidden' value='"+ exyear + "'>" +
						"     </td>" +
						"   </tr>" +
						"  </table>"+
						" </td>" +
						"</tr>" +
						"</table>";
	}
	
		var editorHTML =  "<table width='100%'  border='0' cellspacing='0' cellpadding='0'>" +
						  "	<tr>" +
						  "	  <td height='4' align='center' bgcolor='#FFFFFF'></td>" +
						  " </tr>" +
						  " <tr>" +
						  "   <td height='22' align='center' bgcolor='#BDCAC4'><strong class='body'>" + examName +" EXAMINATION " + exyear + "</strong></td>" +
						  " </tr>" +
						  " <tr> " +
						  "   <td align='center' bgcolor='#EAF3F0'>" +
						  "		<form action='" + formname + "' method='POST' name='examform' id='examform'>" +
						  innerTable + 
						  "		</form>" +
						  "   </td>" +
						  " </tr>" +
						  "</table>";
			
	return editorHTML;
}
document.write(get_banner('GCE A/L','yes','no','exam_AL.jsp','2009','7'));
document.write(get_banner('GRADE V','no','no','exam_GV.jsp','2009','7' )); 
document.write(get_banner('GCE O/L','no','no','exam_OL.jsp','2008','8'));

