// This is to search in all categories
function searchAll(){
	var obj=document.browse;
	obj.txTitle.value = obj.keyword.value;
	if(obj.searchOption.type=="select-one" || obj.searchOption.type=="select-multiple")
		obj.searchOption.options[obj.searchOption.selectedIndex].value ="02";
	else
		document.browse.searchOption.value="02";
	if(siteSearch())
		obj.submit();
}
function siteSearch(){
	var obj=document.browse;
   	var aa=obj.keyword.value;
        if(aa.length==0){
                alert("Enter the search word");
		return false;
        }
	obj.pageno.value="1";
	return true;
}
function clearClick()
{
        document.browse.keyword.value="";
        document.browse.pageno.value="1";
        document.browse.submit();
}

function keysub(id,value)
{
        ar=value.split("/");
        if(ar.length>0) {
                document.browse.keywordid.value=ar[id];
                document.browse.pageno.value="1";
                document.browse.submit();
        }
}     
function assignValue(ch)
{
	document.browse.pagecat.value=ch;
}
function signin()
{
	document.browse.action='Index';
	document.browse.submit();
 
        if(document.browse.user.value=="")
        {
        	alert("plz enter username");
        }
        else
        {
        	if(document.browse.password.value=="")
                {
                	alert("plz enter password");
                }
                else
                {
                	document.browse.action='Index';
                	document.browse.submit();
                }
	}                                     
}
function setPreviousNext(val)
{
        document.form00.prenext.value=val;
        document.form00.submit();
}   
function changereq()
{
        if(document.form00.req.value=='100')
                document.form00.req.value ='102'
        else
                document.form00.req.value='101';
        document.form00.submit();
}  


function validate(val)
{
       var obj=document.browse;
	obj.cp.value=val;	
        obj.action="SignIn";
        obj.req.value="101";
        var var1 = obj.userid.value;
        var var2 = obj.password.value;
        var j =0;
 
 
        document.cookie = "name="+"77";
        var cook = document.cookie;
        if(cook.indexOf("77") == -1)
        {
                alert("Cookies Disabled Enable it manually");
                j=1;
        }
 
 
        if(j!=1)
                if(((var1==null)||(var1==""))||((var2==null)||(var2=="")))
                {
                        alert(" Either UserID or Password field Is Empty!");
                        obj.userid.focus();
                }
                else
                        obj.submit();
}
function goTo()
{
        var idx = document.browse.dropList.selectedIndex;
		// If '--------' is selected, it displays the first option in the drop down list
		  if(document.browse.dropList.options[idx].value=="#top")	
						document.browse.dropList.options[0].selected = true;
        location.href = document.browse.dropList.options[idx].value;
}

//This javascript functions are used for popup which displays category description in browse screen

function closePopup(){
if(typeof dPUW != "undefined")
	dPUW.close();
}
function set(count){
document.browse.count.value = count;
popup();
}
function popup(){

// Set the address, width, height, top
// and left dimensions for the popup
// window below.

PopUpURL    = "../html/tooltip.html";
PopUpLeft   =  250;
PopUpTop    =  250;
PopUpWidth  =  540;
PopUpHeight =  150;

popO='left='+PopUpLeft+',top='+PopUpTop+',width='+PopUpWidth+',height='+PopUpHeight+',scrollbars,resizable="yes"';

dPUW=window.open(PopUpURL,'nrc',popO);
return false;
}
////////////////////////////////////////////////////////////////////////////////////////////////
