function postCatid(cat_id,pageno)
{
getobj('divSmsGallery').innerHTML='Loading...';
getData('http://'+seasmsurl+'/smsgallery/listsms.php','divTemp','cat_id='+cat_id+'&ajax=1&pageno='+pageno,'evalSmsMessage');
}

function evalSmsMessage()
{
getobj('divSmsGallery').innerHTML="";

eval(getobj('divTemp').innerHTML);
}

function writeSmsMessage(i,smstextbr,smsid)
{
var myvar='<div "id=divmain'+i+'" align="center"><table border=0 width=80% style="border-collapse: collapse" cellpadding="0" ><tr><td height="42" width="42"><img border="0" src="imagesnu/gallery/testback_top_tl.gif" width="42" height="42"></td><td height="42" background="imagesnu/gallery/testback_top_tm.gif">&nbsp;</td><td height="42" width="42"><img border="0" src="imagesnu/gallery/testback_top_tr.gif" width="42" height="42"></td></tr><tr><td width="42" background="imagesnu/gallery/testback_left_m.gif">&nbsp;</td><td bgcolor="#4DBFE1" align="right"><form method = POST><a onclick="abc('+i+');"><span class="gallerytext">'+smstextbr+'</span></a><input type=hidden name=smsid id=smsid'+i+' value="'+smsid+'"><br><br><input type=button  name=b1 id="b'+i+'" value="SEND" style="width: 50; height: 20; border-width: 1px; background-color: #FFCC66" onclick="abc('+i+');"><br><div id="div'+i+'"></div></form></td><td width="42" background="imagesnu/gallery/testback_right_m.gif">&nbsp;</td></tr><tr><td height="42" width="42" align="right" valign="top"><img border="0" src="imagesnu/gallery/testback_bottom_bl.gif" width="42" height="42"></td><td height="42" background="imagesnu/gallery/testback_bottom_bm.gif">&nbsp;</td><td height="42" width="42" align="left" valign="top"><img border="0" src="imagesnu/gallery/testback_bottom_br.gif" width="42" height="42"></td></tr></table></div><br><br>';
getobj('divSmsGallery').innerHTML+=myvar;
}

function writeSmsMenu(maxpageno,cat_id,pageno)
{
getobj("divSmsMenu1").innerHTML="";
if(!pageno) pageno=1;
getobj('divSmsMenu1').innerHTML+="<a href=\"#cat\" onClick='postCatid("+cat_id+",1);'><< First</a>&nbsp;|&nbsp;";
for(i=pageno-5;i<=pageno+5;i++)
	{
	if(i==pageno) getobj('divSmsMenu1').innerHTML+="<b>";
	if((i>0)&&(i<=maxpageno)) getobj('divSmsMenu1').innerHTML+="<a href=\"#cat\" onClick='postCatid("+cat_id+","+i+");'>"+i+"</a>&nbsp;|&nbsp;";
	if(i==pageno) getobj('divSmsMenu1').innerHTML+="</b>";
	}
getobj('divSmsMenu1').innerHTML+="<a href=\"#cat\" onClick='postCatid("+cat_id+","+maxpageno+");'>Last >></a>";
getobj("divSmsMenu2").innerHTML=getobj("divSmsMenu1").innerHTML;

}

function abc(i)
{
document.getElementById("b"+i).style.display = 'none';
document.getElementById('div'+i).innerHTML='<table border="0"><tr><td colspan="3"><div align="center"><strong>SELECT THE DESTINATION:</strong> <img style="cursor: pointer;" src="imagesnu/questionmark.gif" alt="help" width="15" height="15" onClick="alert(\'Where do you want to send the sms?\\nHINT: Click on India/Rest of The World Image below\');"></div></td></tr><tr><td valign="bottom"><div align="center" onClick="abcindia('+i+')" style="cursor: pointer;"><img src="imagesnu/india_mms.gif" alt="India" width="150" height="85" border="0" ><br>INDIA</div></td><td >&nbsp;</td><td  valign="bottom"><div align="center" onClick="abcworld('+i+')" style="cursor: pointer;"><img src="imagesnu/world_gallery.jpg" alt="Rest of the World" width="80" height="80" border="0"><br>WORLD</div></td></tr></table>';
}

function abcindia(i)
{
i=i.toString();
document.getElementById("b"+i).style.display = 'none';
document.getElementById('div'+i).innerHTML='<a>TO:&nbsp;</a><input type=text name=tono id="tono'+i+'"><br><a>Ur Name:&nbsp;</a><input type=text name=from id="from'+i+'"><br><input type=button name="S'+i+'" id="S'+i+'" value="SEND" style="width: 50; height: 20; border-width: 1px; background-color: #FFCC66" onClick="getData(\'http://'+seasmsurl+'/smsgallery/sendgallerysms.php\',\'div'+i+'\',\'smsid=\'+getme(\'smsid'+i+'\')+\'&to=\'+getme(\'tono'+i+'\')+\'&from=\'+getme(\'from'+i+'\')+\'&ajax=1&submit=1&i='+i+'\');getobj(\'div'+i+'\').innerHTML=\'Sending...\';">';
}

function abcworld(i)
{
i=i.toString();
document.getElementById("b"+i).style.display = 'none';
document.getElementById('div'+i).innerHTML='Select Operator:<br><div id="divSmsGalleryOperator">Loading...</div><br><a>TO:&nbsp;</a><input type=text name=tono id="tono'+i+'"><br><a>Ur Name:&nbsp;</a><input type=text name=from id="from'+i+'"><br><input type=button name="S'+i+'" id="S'+i+'" value="SEND" style="width: 50; height: 20; border-width: 1px; background-color: #FFCC66" onClick="var operator_world=getobj(\'operator_world\').options[getobj(\'operator_world\').selectedIndex].value;getData(\'http://'+seasmsurl+'/smsgallery/sendgallerysms.php\',\'div'+i+'\',\'smsid=\'+getme(\'smsid'+i+'\')+\'&to=\'+getme(\'tono'+i+'\')+\'&from=\'+getme(\'from'+i+'\')+\'&ajax=1&submit=1&operator_world=\'+operator_world+\'&i='+i+'\');getobj(\'div'+i+'\').innerHTML=\'Sending...\';">';
getData('http://'+seasmsurl+'/world/operators.php','divSmsGalleryOperator','','sortList');
}