// JavaScript Document
// Author: Rajeev Jhanji
function Mod(a, b) { return a-Math.floor(a/b)*b }

function kundali(type,title,asc,sun,mon,mar,mer,jup,ven,sat,rah,ket,urn,nep,plu) {
	if (type=="south") {

	var S=new Array(13);
	for (i=1; i<13; i=i+1) {
		S[i]="";
		if (asc == i) S[i] = S[i] + "Asc ";
		if (sun == i) S[i] = S[i] + "Sun ";
		if (mon == i) S[i] = S[i] + "Mon ";
		if (mar == i) S[i] = S[i] + "Mar ";
		if (mer == i) S[i] = S[i] + "Mer ";
		if (jup == i) S[i] = S[i] + "Jup ";
		if (ven == i) S[i] = S[i] + "Ven ";
		if (sat == i) S[i] = S[i] + "Sat ";
		if (rah == i) S[i] = S[i] + "Rah ";
		if (ket == i) S[i] = S[i] + "Ket ";
		if (urn == i) S[i] = S[i] + "Urn ";
		if (nep == i) S[i] = S[i] + "Nep ";
		if (plu == i) S[i] = S[i] + "Plu";
		//document.write("S" + i + ": " + S[i] + "<br>");
	}

//	alert('south');
		document.write('<table width="240" height="240" border="0" cellpadding="0" cellspacing="0" background="images/kundalisouth' + asc +'.gif" class="kundali">');
		document.write('  <tr> ');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[12] + '</td>');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[1] + '</td>');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[2] + '</td>');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[3] + '</td>');
		document.write('  </tr>');
		document.write('  <tr>');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[11] + '</td>');
		document.write('    <td height="120" colspan="2" rowspan="2" align="center" valign="middle">' + title + '</td>');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[4] + '</td>');
		document.write('  </tr>');
		document.write('  <tr>');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[10] + '</td>');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[5] + '</td>');
		document.write('  </tr>');
		document.write('  <tr>');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[9] + '</td>');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[8] + '</td>');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[7] + '</td>');
		document.write('    <td width="60" height="60" align="center" valign="middle">' + S[6] + '</td>');
		document.write('  </tr>');
		document.write('</table>');
	} 
	else if (type=="north") {
//	alert('north');
	var H=new Array(12) 
	for (i=0; i<12; i=i+1) {
		H[i]="";
		if (i==3 || i==5 || i==9 || i==11) {
			if (Mod(sun-asc+1,12) == i) H[i] = H[i] + "Su ";
			if (Mod(mon-asc+1,12) == i) H[i] = H[i] + "Mo ";
			if (Mod(mar-asc+1,12) == i) H[i] = H[i] + "Ma ";
			if (Mod(mer-asc+1,12) == i) H[i] = H[i] + "Me ";
			if (Mod(jup-asc+1,12) == i) H[i] = H[i] + "Ju ";
			if (Mod(ven-asc+1,12) == i) H[i] = H[i] + "Ve ";
			if (Mod(sat-asc+1,12) == i) H[i] = H[i] + "Sa ";
			if (Mod(rah-asc+1,12) == i) H[i] = H[i] + "Ra ";
			if (Mod(ket-asc+1,12) == i) H[i] = H[i] + "Ke ";
			if (Mod(urn-asc+1,12) == i) H[i] = H[i] + "Ur ";
			if (Mod(nep-asc+1,12) == i) H[i] = H[i] + "Ne ";
			if (Mod(plu-asc+1,12) == i) H[i] = H[i] + "Pl";
			//document.write("H" + i + ": " + H[i] + "<br>");
		} else {
			if (Mod(sun-asc+1,12) == i) H[i] = H[i] + "Sun ";
			if (Mod(mon-asc+1,12) == i) H[i] = H[i] + "Mon ";
			if (Mod(mar-asc+1,12) == i) H[i] = H[i] + "Mar ";
			if (Mod(mer-asc+1,12) == i) H[i] = H[i] + "Mer ";
			if (Mod(jup-asc+1,12) == i) H[i] = H[i] + "Jup ";
			if (Mod(ven-asc+1,12) == i) H[i] = H[i] + "Ven ";
			if (Mod(sat-asc+1,12) == i) H[i] = H[i] + "Sat ";
			if (Mod(rah-asc+1,12) == i) H[i] = H[i] + "Rah ";
			if (Mod(ket-asc+1,12) == i) H[i] = H[i] + "Ket ";
			if (Mod(urn-asc+1,12) == i) H[i] = H[i] + "Urn ";
			if (Mod(nep-asc+1,12) == i) H[i] = H[i] + "Nep ";
			if (Mod(plu-asc+1,12) == i) H[i] = H[i] + "Plu";
			//document.write("H" + i + ": " + H[i] + "<br>");
		}
	}
		document.write('<table width="240" height="240" border="0" cellpadding="0" cellspacing="0" background="images/kundalinorth' + asc +'.gif" class="kundali">');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td colspan="6" rowspan="4">' + H[2] +'</td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td colspan="6" rowspan="4">' + H[0] +'</td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td colspan="6" rowspan="6">' + H[1] +'</td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td colspan="4" rowspan="4">' + H[3] +'</td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td colspan="4" rowspan="4">' + H[11] +'</td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td colspan="6" rowspan="6">' + H[4] +'</td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td colspan="6" rowspan="6">' + H[10] +'</td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td colspan="6" rowspan="6">' + H[7] +'</td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td colspan="4" rowspan="4">' + H[5] +'</td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td colspan="4" rowspan="4">' + H[9] +'</td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td colspan="6" rowspan="4">' + H[6] +'</td>');
		document.write('    <td colspan="6" rowspan="4">' + H[8] +'</td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('  <tr align="center" valign="middle"> ');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('    <td width="10" height="10"></td>');
		document.write('  </tr>');
		document.write('</table>');

	}
}

function grahaspashta(asc,sun,mon,mar,mer,jup,ven,sat,rah) {
	var ascD=asc.split("~");
	var sunD=sun.split("~");
	var monD=mon.split("~");
	var marD=mar.split("~");
	var merD=mer.split("~");
	var jupD=jup.split("~");
	var venD=ven.split("~");
	var satD=sat.split("~");
	var rahD=rah.split("~");

	var asc0D, asc1D, asc2D, sun0D, sun1D, sun2D, mon0D, mon1D, mon2D
	var mar0D, mar1D, mar2D, mer0D, mer1D, mer2D, jup0D, jup1D, jup2D
	var ven0D, ven1D, ven2D, sat0D, sat1D, sat2D, rah0D, rah1D, rah2D

	if (ascD[0] >= 0 && ascD[0] <= 29) { asc0D=ascD[0] + '&deg;' } else { asc0D='' }
	if (ascD[1] >= 0 && ascD[1] <= 59) { asc1D=ascD[1] + '&#39;' } else { asc1D='' }
	if (ascD[2] >= 0 && ascD[2] <= 59) { asc2D=ascD[2] + '&quot;'} else { asc2D='' }

	if (sunD[0] >= 0 && sunD[0] <= 29) { sun0D=sunD[0] + '&deg;' } else { sun0D='' }
	if (sunD[1] >= 0 && sunD[1] <= 59) { sun1D=sunD[1] + '&#39;' } else { sun1D='' }
	if (sunD[2] >= 0 && sunD[2] <= 59) { sun2D=sunD[2] + '&quot;'} else { sun2D='' }

	if (monD[0] >= 0 && monD[0] <= 29) { mon0D=monD[0] + '&deg;' } else { mon0D='' }
	if (monD[1] >= 0 && monD[1] <= 59) { mon1D=monD[1] + '&#39;' } else { mon1D='' }
	if (monD[2] >= 0 && monD[2] <= 59) { mon2D=monD[2] + '&quot;'} else { mon2D='' }

	if (marD[0] >= 0 && marD[0] <= 29) { mar0D=marD[0] + '&deg;' } else { mar0D='' }
	if (marD[1] >= 0 && marD[1] <= 59) { mar1D=marD[1] + '&#39;' } else { mar1D='' }
	if (marD[2] >= 0 && marD[2] <= 59) { mar2D=marD[2] + '&quot;'} else { mar2D='' }

	if (merD[0] >= 0 && merD[0] <= 29) { mer0D=merD[0] + '&deg;' } else { mer0D='' }
	if (merD[1] >= 0 && merD[1] <= 59) { mer1D=merD[1] + '&#39;' } else { mer1D='' }
	if (merD[2] >= 0 && merD[2] <= 59) { mer2D=merD[2] + '&quot;'} else { mer2D='' }

	if (jupD[0] >= 0 && jupD[0] <= 29) { jup0D=jupD[0] + '&deg;' } else { jup0D='' }
	if (jupD[1] >= 0 && jupD[1] <= 59) { jup1D=jupD[1] + '&#39;' } else { jup1D='' }
	if (jupD[2] >= 0 && jupD[2] <= 59) { jup2D=jupD[2] + '&quot;'} else { jup2D='' }

	if (venD[0] >= 0 && venD[0] <= 29) { ven0D=venD[0] + '&deg;' } else { ven0D='' }
	if (venD[1] >= 0 && venD[1] <= 59) { ven1D=venD[1] + '&#39;' } else { ven1D='' }
	if (venD[2] >= 0 && venD[2] <= 59) { ven2D=venD[2] + '&quot;'} else { ven2D='' }

	if (satD[0] >= 0 && satD[0] <= 29) { sat0D=satD[0] + '&deg;' } else { sat0D='' }
	if (satD[1] >= 0 && satD[1] <= 59) { sat1D=satD[1] + '&#39;' } else { sat1D='' }
	if (satD[2] >= 0 && satD[2] <= 59) { sat2D=satD[2] + '&quot;'} else { sat2D='' }

	if (rahD[0] >= 0 && rahD[0] <= 29) { rah0D=rahD[0] + '&deg;' } else { rah0D='' }
	if (rahD[1] >= 0 && rahD[1] <= 59) { rah1D=rahD[1] + '&#39;' } else { rah1D='' }
	if (rahD[2] >= 0 && rahD[2] <= 59) { rah2D=rahD[2] + '&quot;'} else { rah2D='' }

	document.write('<table width="500" border="0" cellpadding="0" cellspacing="0" class="grahaspashta">');
	document.write('  <tr height="5">');
	document.write('    <td colspan="8"></td>');
	document.write('  </tr>');
	document.write('  <tr height="16">');
	document.write('    <td width="62" align="left" nowrap>Lagna</td>');
	document.write('    <td width="62" align="right" nowrap>' + asc0D + asc1D + asc2D + '</td>');
	document.write('    <td width="62" align="left" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>');
	document.write('    <td width="62" align="left" nowrap>Mars</td>');
	document.write('    <td width="62" align="right" nowrap>' + mar0D + mar1D + mar2D + '</td>');
	document.write('    <td width="62" align="left" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>');
	document.write('    <td width="62" align="left" nowrap>Venus</td>');
	document.write('    <td width="62" align="right" nowrap>' + ven0D + ven1D + ven2D + '</td>');
	document.write('  </tr>');
	document.write('  <tr height="16">');
	document.write('    <td width="62" align="left" nowrap>Sun</td>');
	document.write('    <td width="62" align="right" nowrap>' + sun0D + sun1D + sun2D + '</td>');
	document.write('    <td width="62" align="left" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>');
	document.write('    <td width="62" align="left" nowrap>Mercury</td>');
	document.write('    <td width="62" align="right" nowrap>' + mer0D + mer1D + mer2D + '</td>');
	document.write('    <td width="62" align="left" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>');
	document.write('    <td width="62" align="left" nowrap>Saturn</td>');
	document.write('    <td width="62" align="right" nowrap>' + sat0D + sat1D + sat2D + '</td>');
	document.write('  </tr>');
	document.write('  <tr height="16">');
	document.write('    <td width="62" align="left" nowrap>Moon</td>');
	document.write('    <td width="62" align="right" nowrap>' + mon0D + mon1D + mon2D + '</td>');
	document.write('    <td width="62" align="left" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>');
	document.write('    <td width="62" align="left" nowrap>Jupiter</td>');
	document.write('    <td width="62" align="right" nowrap>' + jup0D + jup1D + jup2D + '</td>');
	document.write('    <td width="62" align="left" nowrap>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>');
	document.write('    <td width="62" align="left" nowrap>Rahu</td>');
	document.write('    <td width="62" align="right" nowrap>' + rah0D + rah1D + rah2D + '</td>');
	document.write('  </tr>');
	document.write('</table>');
}
