xmlDoc=loadXMLDoc('catalogue.xml');

var pg_num_arr;
var pg_num_divid;
var no_of_pgs;
var pg_id;
function show()
{
	pg_num_arr=new Array();
	pg_num_divid=new Array();
	pg_id=new Array();
	frm=document.frm1;
	var str='';
	x=xmlDoc.getElementsByTagName("reward");
	//alert(document.getElementById('categ'));
	//alert(xmlDoc.getElementsByTagName("title")[0].childNodes[0].nodeValue)
	
	var max=0;
	for (i=0;i<x.length;i++)
	{
		txt=xmlDoc.getElementsByTagName("reward")[i].getAttribute("category");
		txt1=xmlDoc.getElementsByTagName("reward")[i].getAttribute("pointrange");
		//alert(txt+", "+txt1)
		if (frm.categ.selectedIndex!=0 && frm.points.selectedIndex==0)
		{
			if (frm.categ.options[frm.categ.selectedIndex].value==txt)
			{
				max++;
			}
		}
		if (frm.categ.selectedIndex==0 && frm.points.selectedIndex!=0)
		{
			if (frm.points.options[frm.points.selectedIndex].value==txt1)
			{
				max++;
			}
		}
		if (frm.categ.selectedIndex!=0 && frm.points.selectedIndex!=0)
		{
			if (frm.categ.options[frm.categ.selectedIndex].value==txt && frm.points.options[frm.points.selectedIndex].value==txt1)
			{
				max++;
			}
		}
		if (frm.categ.selectedIndex==1 && frm.points.selectedIndex!=0)
		{
			if (frm.points.options[frm.points.selectedIndex].value==txt1)
			{
				max++;
			}
		}
		if (frm.categ.selectedIndex==1 && frm.points.selectedIndex==0)
		{
				max++;
		}
	}
	//alert(max);
	no_of_pgs=Math.ceil(max/10);
	//alert(no_of_pgs)
	if(no_of_pgs!=0)
	{


		str='<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr valign="top"><td valign="top"><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td colspan="15"><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr bgcolor="#006F66"><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td width="3%" align="center" class="whitetxt"><b>Code</b></td><td colspan="2" width="1%"><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td><td width="480" height="25" colspan="2" class="whitetxt" align="center"><b>Item</b></td><td colspan="2"><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td><td width="10%" class="whitetxt" align="center"><b>Points</b></td><td colspan="2"><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="1" border="0" alt=""></td><td align="center" class="whitetxt"><b>Charge</b></td><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';

		//str+='<tr><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td valign="top"><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';

		str+='<tr><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td width="1" valign="top"></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td valign="top"><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td width="1" valign="top"></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td width="1" valign="top"></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="5" border="0" alt=""></td><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';

		pg_num=1;
		count=1;
		prevcount='';
		preloadimg='';
		for (i=0;i<x.length;i++)
		{
			txt=xmlDoc.getElementsByTagName("reward")[i].getAttribute("category");
			txt1=xmlDoc.getElementsByTagName("reward")[i].getAttribute("pointrange");
			//alert(txt1+", "+frm.points.options[frm.points.selectedIndex].value)
			//alert(txt+", "+frm.categ.options[frm.categ.selectedIndex].value)

			if (frm.categ.selectedIndex!=0 && frm.points.selectedIndex==0)
			{
				if (frm.categ.options[frm.categ.selectedIndex].value==txt && count<=10)
				{
					if (pg_num==1)
					{
						disp=' style="display:;';
					}
					else
					{
						disp=' style="display:none;';
					}
					if (count==1)
					{
						//str+='<tr id="pg'+pg_num+'"'+disp+'"><td colspan="4"><table width="100%">';
						str+='<tr id="item_pg'+pg_num+'"'+disp+'"><td colspan="16"><table cellpadding="0" cellspacing="0" border="0">';
					}
					v1=xmlDoc.getElementsByTagName("code")[i].childNodes[0].nodeValue;
					img_icon=xmlDoc.getElementsByTagName("productimage")[i].childNodes[0].nodeValue;
					v2=xmlDoc.getElementsByTagName("product")[i].childNodes[0].nodeValue;
					v3=xmlDoc.getElementsByTagName("points")[i].childNodes[0].nodeValue;
					v4=xmlDoc.getElementsByTagName("charge")[i].childNodes[0].nodeValue;
					//alert(img_icon);
					str+='<tr valign="top"><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td class="bodytxt1" width="26"><b>'+v1+'</b></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td valign="top" width="100" class="bodytxt1">'+img_icon+'</td><td class="bodytxt1" width="415">'+v2+'</td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td class="bodytxt1" align="center" width="72"><b>'+v3+'</b></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td class="bodytxt1" align="center" width="58"><b>'+v4+'</b></td><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';

					str+='<tr><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td valign="top"><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';
					//preloadimg+="'images/"+v1+".gif',";
					//alert(str);
					//alert(count);
					count++;
				}
			}
			if (frm.categ.selectedIndex==0 && frm.points.selectedIndex!=0)
			{
				if (frm.points.options[frm.points.selectedIndex].value==txt1 && count<=10)
				{
			//alert(count)
					if (pg_num==1)
					{
						disp=' style="display:;';
					}
					else
					{
						disp=' style="display:none;';
					}
					if (count==1)
					{
						//str+='<tr id="pg'+pg_num+'"'+disp+'"><td colspan="4"><table width="100%">';
						str+='<tr id="item_pg'+pg_num+'"'+disp+'"><td colspan="16"><table cellpadding="0" cellspacing="0" border="0">';
					}
					v1=xmlDoc.getElementsByTagName("code")[i].childNodes[0].nodeValue;
					img_icon=xmlDoc.getElementsByTagName("productimage")[i].childNodes[0].nodeValue;
					v2=xmlDoc.getElementsByTagName("product")[i].childNodes[0].nodeValue;
					v3=xmlDoc.getElementsByTagName("points")[i].childNodes[0].nodeValue;
					v4=xmlDoc.getElementsByTagName("charge")[i].childNodes[0].nodeValue;
					str+='<tr valign="top"><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td class="bodytxt1" width="26"><b>'+v1+'</b></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td valign="top" width="100" class="bodytxt1">'+img_icon+'</td><td class="bodytxt1" width="415">'+v2+'</td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td class="bodytxt1" align="center" width="72"><b>'+v3+'</b></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td class="bodytxt1" align="center" width="58"><b>'+v4+'</b></td><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';

					str+='<tr><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td valign="top"><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';
					//preloadimg+="'images/"+v1+".gif',";
					//alert(str);
					//alert(count);
					count++;
				}
			}
			if (frm.categ.selectedIndex!=0 && frm.points.selectedIndex!=0)
			{
				if (frm.categ.options[frm.categ.selectedIndex].value==txt && frm.points.options[frm.points.selectedIndex].value==txt1 && count<=10)
				{
					if (pg_num==1)
					{
						disp=' style="display:;';
					}
					else
					{
						disp=' style="display:none;';
					}
					if (count==1)
					{
						//str+='<tr id="pg'+pg_num+'"'+disp+'"><td colspan="4"><table width="100%">';
						str+='<tr id="item_pg'+pg_num+'"'+disp+'"><td colspan="16"><table cellpadding="0" cellspacing="0" border="0">';
					}
					v1=xmlDoc.getElementsByTagName("code")[i].childNodes[0].nodeValue;
					img_icon=xmlDoc.getElementsByTagName("productimage")[i].childNodes[0].nodeValue;
					v2=xmlDoc.getElementsByTagName("product")[i].childNodes[0].nodeValue;
					v3=xmlDoc.getElementsByTagName("points")[i].childNodes[0].nodeValue;
					v4=xmlDoc.getElementsByTagName("charge")[i].childNodes[0].nodeValue;
					str+='<tr valign="top"><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td class="bodytxt1" width="26"><b>'+v1+'</b></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td valign="top" width="100" class="bodytxt1">'+img_icon+'</td><td class="bodytxt1" width="415">'+v2+'</td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td class="bodytxt1" align="center" width="72"><b>'+v3+'</b></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td class="bodytxt1" align="center" width="58"><b>'+v4+'</b></td><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';

					str+='<tr><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td valign="top"><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';
					//preloadimg+="'images/"+v1+".gif',";
					//alert(str);
					//alert(count);
					count++;
				}
			}

			//All categories
			if (frm.categ.selectedIndex==1 && frm.points.selectedIndex!=0)
			{
				if (frm.points.options[frm.points.selectedIndex].value==txt1 && count<=10)
				{
					if (pg_num==1)
					{
						disp=' style="display:;';
					}
					else
					{
						disp=' style="display:none;';
					}
					if (count==1)
					{
						//str+='<tr id="pg'+pg_num+'"'+disp+'"><td colspan="4"><table width="100%">';
						str+='<tr id="item_pg'+pg_num+'"'+disp+'"><td colspan="16"><table cellpadding="0" cellspacing="0" border="0">';
					}
					v1=xmlDoc.getElementsByTagName("code")[i].childNodes[0].nodeValue;
					img_icon=xmlDoc.getElementsByTagName("productimage")[i].childNodes[0].nodeValue;
					v2=xmlDoc.getElementsByTagName("product")[i].childNodes[0].nodeValue;
					v3=xmlDoc.getElementsByTagName("points")[i].childNodes[0].nodeValue;
					v4=xmlDoc.getElementsByTagName("charge")[i].childNodes[0].nodeValue;
					str+='<tr valign="top"><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td class="bodytxt1" width="26"><b>'+v1+'</b></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td valign="top" width="100" class="bodytxt1">'+img_icon+'</td><td class="bodytxt1" width="415">'+v2+'</td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td class="bodytxt1" align="center" width="72"><b>'+v3+'</b></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td class="bodytxt1" align="center" width="58"><b>'+v4+'</b></td><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';

					str+='<tr><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td valign="top"><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';
					//preloadimg+="'images/"+v1+".gif',";
					//alert(str);
					//alert(count);
					count++;
				}
			}

			if (frm.categ.selectedIndex==1 && frm.points.selectedIndex==0)
			{
				if (count<=10)
				{
					if (pg_num==1)
					{
						disp=' style="display:;';
					}
					else
					{
						disp=' style="display:none;';
					}
					if (count==1)
					{
						//str+='<tr id="pg'+pg_num+'"'+disp+'"><td colspan="4"><table width="100%">';
						str+='<tr id="item_pg'+pg_num+'"'+disp+'"><td colspan="16"><table cellpadding="0" cellspacing="0" border="0">';
					}
					v1=xmlDoc.getElementsByTagName("code")[i].childNodes[0].nodeValue;
					img_icon=xmlDoc.getElementsByTagName("productimage")[i].childNodes[0].nodeValue;
					v2=xmlDoc.getElementsByTagName("product")[i].childNodes[0].nodeValue;
					v3=xmlDoc.getElementsByTagName("points")[i].childNodes[0].nodeValue;
					v4=xmlDoc.getElementsByTagName("charge")[i].childNodes[0].nodeValue;
					//alert("v4"+v4 +" ,count"+ count)
					str+='<tr valign="top"><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td class="bodytxt1" width="26"><b>'+v1+'</b></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td valign="top" width="100" class="bodytxt1">'+img_icon+'</td><td class="bodytxt1" width="415">'+v2+'</td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td class="bodytxt1" align="center" width="72"><b>'+v3+'</b></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td>';

					str+='<td class="bodytxt1" align="center" width="58"><b>'+v4+'</b></td><td width="1%"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';

					str+='<tr><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td valign="top"><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td style="background-image: url(\'images/dotline_v.gif\');" width="1" valign="top"><img src="images/dotline_v.gif" width="1" height="3" border="0" alt=""></td><td width="10"><img src="images/spacer.gif" width="10" height="1" border="0" alt=""></td><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td><td width="5"><img src="images/spacer.gif" width="5" height="1" border="0" alt=""></td></tr>';
					//preloadimg+="'images/"+v1+".gif',";
					//alert(str);
					//alert(count);
					count++;
				}
			}
			//alert("count"+count+"no_of_pgs" + no_of_pgs+" "+ "pg_num" + pg_num)
			if (count==11)
			{
			//alert(count)
				count=1;
				pg_num++;
				str+='</table></td></tr>';
			}
		}
		if (count!=11 && no_of_pgs!=(pg_num-1))
		{
			//alert("sec"+count)
			str+='</table></td></tr>';
		}
		str+='<tr><td><img src="images/spacer.gif" width="1" height="10" border="0" alt=""></td></tr></table></td></tr></table></td></tr></table>';
		//alert(str);
		document.getElementById('list').innerHTML=str;
		//document.frm1.content.value=str;
		str2='<table cellpadding="5" cellspacing="0" border="0"><tr>';
		if (no_of_pgs!=1)
		{
			str2+='<td id="prev" class="bodytxt1"><a href="javascript:;" onclick="show_pg(\'item_pg1\');" class="bodytxt1">&lt;&lt; Back</a></td>'
		}
		//alert(no_of_pgs);
		for (j=1;j<=no_of_pgs;j++)
		{
			str2+='<td class="bodytxt1" id="pgid'+j+'"';
			if (j>10)
			{
				str2+=' style="display:none;"><a href="javascript:;" onclick="show_pg(\'item_pg'+j+'\');" class="bodytxt1" id="pgnum_div'+j+'">'+j+'</a></td>';
			}
			else
			{
				str2+='><a href="javascript:;" onclick="show_pg(\'item_pg'+j+'\');" class="bodytxt1" id="pgnum_div'+j+'">'+j+'</a></td>';
			}

			pg_num_arr[j-1]='item_pg'+j;
			pg_num_divid[j-1]='pgnum_div'+j;
			pg_id[j-1]='pgid'+j;
		}
		//alert(pg_id.length)
		//alert(str2)
		if (no_of_pgs!=1)
		{
			str2+='<td id="next" class="bodytxt1"><a href="javascript:;" onclick="show_pg(\'item_pg2\');" class="bodytxt1">Next &gt;&gt;</a></td></tr></table>';
		}
	//alert(str2);
		document.getElementById('pg_nav').innerHTML=str2;
	}
	else
	{
		document.getElementById('list').innerHTML="No results found";
		document.getElementById('pg_nav').innerHTML='';
	}
	
		//pgs_display=no_of_pgs/10;
		//alert(pgs_display);
		//pgs_display=pgs_display+' ';
		//alert(preloadimg);
		//alert("pg round"+pgs_display.substr(0,1));
		//alert("pg"+pgs_display.substr(2,1));
	//preloadimg=preloadimg.substr(0,preloadimg.length-1);
	//preloadimg+="'images/tab_left_mid_bg.gif','images/tab_top_left_cur.gif','images/tab_top_mid_bg.gif','images/charge_plus1.gif','images/dotline_v.gif'"
	//alert(preloadimg);
	//var mmimage="MM_preloadImages("+preloadimg+")";
	//eval(mmimage);
	show_pg('item_pg1');
}

var prevpg='0';
var prevpgnumber='';
function show_pg(obj)
{
//alert(pg_num_arr.length);
//alert(pg_num_arr[pg_num_arr.length-1]);
//alert(pg_num_divid.length);

	var pgnumber;
	for (i=0;i<pg_num_arr.length;i++)
	{
//alert(pg_num_divid[i]);
		var pg_num_id=document.getElementById(pg_num_arr[i]);
		var pg_num_divid_id=document.getElementById(pg_num_divid[i]);
		if (obj==pg_num_arr[i])
		{
			pgnumber=i;
			pg_num_id.style.display='';
			pg_num_divid_id.style.fontWeight='bold';
			//alert(i);
			if (i>=0 && no_of_pgs!=1)
			{
				document.getElementById('prev').innerHTML='<a href="javascript:;" onclick="show_pg(\''+pg_num_arr[i-1]+'\');" class="lbluetxt1">&lt;&lt; Back</a>';
				if ((i+1)==1)
				{
					document.getElementById('prev').innerHTML='<a href="javascript:;" onclick="show_pg(\''+pg_num_arr[i]+'\');" class="lbluetxt1">&lt;&lt; Back</a>';
				}
			}
			if (i<=pg_num_arr.length && no_of_pgs!=1)
			{
				//alert(i +" ,"+pg_num_arr.length);
				document.getElementById('next').innerHTML='<a href="javascript:;" onclick="show_pg(\''+pg_num_arr[i+1]+'\');" class="lbluetxt1">Next &gt;&gt;</a>';
				if ((i+1)==no_of_pgs)
				{
					//alert(no_of_pgs +", "+ (i+1))
					document.getElementById('next').innerHTML='<a href="javascript:;" onclick="show_pg(\''+pg_num_arr[i]+'\');" class="lbluetxt1">Next &gt;&gt;</a>';
				}
			}
		}
		else
		{//alert(pg_num_arr[i]);
			pg_num_id.style.display='none';
			pg_num_divid_id.style.fontWeight='normal';
		}
		
	}
	var pgdivider=new Array(10,20,30,40,50,60,70);
	var pgdivider2=new Array(9,19,29,39,49,59,69);
	
	for (k=0;k<pgdivider.length;k++)
	{
		//alert("pgnumber"+pgnumber+"prevpgnumber"+prevpgnumber);
		if (pgnumber==pgdivider[k] && pgnumber>prevpgnumber)
		{
			//alert("pgnumber"+pgnumber+"prevpgnumber"+prevpgnumber+"greater");
			for (j=0;j<pgnumber;j++)
			{
				if (j<pg_num_arr.length)
				{
					var pgs_prev=document.getElementById(pg_id[j]);
					pgs_prev.style.display='none';
				}
			}
			for (j=pgnumber;j<(pgnumber+10);j++)
			{
				if (j<pg_num_arr.length)
				{
					var pgs_next=document.getElementById(pg_id[j]);
					pgs_next.style.display='';
				}
			}
		}
		if (pgnumber==pgdivider2[k] && pgnumber<prevpgnumber)
		{
			//alert("pgnumber"+pgnumber+"prevpgnumber"+prevpgnumber+"lesser");
			for (j=pgnumber;j<pg_num_arr.length;j++)
			{
				if (j<pg_num_arr.length)
				{
					var pgs_prev=document.getElementById(pg_id[j]);
					pgs_prev.style.display='none';
				}
			}
			for (j=pgnumber;j>(pgnumber-10);j--)
			{
				if (j<pg_num_arr.length)
				{
					var pgs_next=document.getElementById(pg_id[j]);
					pgs_next.style.display='';
				}
			}
		}
	}
	for (a=0;a<pg_num_arr.length;a++)
	{
		if (pg_num_arr[a]==obj)
		{
			prevpgnumber=a;
		}
	}
	if ((pgnumber+1)==no_of_pgs && no_of_pgs!=1)
	{
		//alert(no_of_pgs +", "+ (i+1))
		document.getElementById('next').innerHTML='';
	}
}