function chkupdate()
{
 document.form1.action.value='Update';
 document.form1.submit();
 return true;
}
function ALLsearch()
{
document.form1.letter.value ='';
document.form1.submit();
return true;
 }
function getCheckCount()
{	
	var x=0;
	for(i=0;i < document.form1.elements.length;i++)
	{	if (document.form1.elements[i].id == 'iId' && document.form1.elements[i].checked == true) 
			{x++;}
	}
if(x ==0)
{
alert('Please select a record to enable/disable');
return false;
}
else
{
document.form1.action.value='changestatus';
document.form1.submit();
return true;
}
}



function getCheckCountk()
{	
	var x=0;
	for(i=0;i < document.form1.elements.length;i++)
	{	if (document.form1.elements[i].id == 'iId' && document.form1.elements[i].checked == true) 
			{x++;}
	}
if(x ==0)
{
alert('Please select a record to approve / reject');
return false;
}
else
{
document.form1.action.value='changestatus';
document.form1.submit();
return true;
}
}


function categorydelete(catid,prodno)
{
 var ans;
 if(prodno>0)
{
	if (prodno>1) 
	{ 
		productstr="products"; 
	}
	else 
	{ 
		productstr="product"; 
	}
alert("You are about to delete "+prodno+" "+productstr+" in this category, click ok to proceed ?");
//return false;	
}
else
{
 ans =  confirm("Do you really want to delete this record ?");
if (ans)
{ 
 document.form1.action.value='Delete';
 document.form1.DeleteId.value=catid;
 document.form1.submit();
 return true;
}
}
}


function openWin(id)
{
 var ans;
 ans =  confirm("Do you really want to delete this record ?");
if (ans)
{ 
 document.form1.action.value='Delete';
 document.form1.DeleteId.value=id;
 document.form1.submit();
 return true;
}

}



function openWinweekly(id)
{
 var ans;
 ans =  confirm("Do you really want to make weekly poll to this record ?");
if (ans)
{ 
 document.form1.action.value='Weekly';
 document.form1.DeleteId.value=id;
 document.form1.submit();
 return true;
}

}


function deletefrontrecs(id)
{
 var ans;
// ans =  confirm("Do you really want to delete this record ?");
//if (ans)
//{ 
 document.form1.action1.value='Delete';
 document.form1.DeleteId.value=id;
 document.form1.submit();
 return true;
//}

}


function deleterecs(id)
{
 var ans;
 ans =  confirm("Do you really want to delete this record ?");
if (ans)
{ 
 document.form1.action1.value='Delete';
 document.form1.DeleteId.value=id;
 document.form1.submit();
 return true;
}

}

function paging(page)
{
	form1.PageNo.value = page;	 
 //document.form1.search.value = '<?=$search;?>';
     form1.submit();
 }
 
 