String.prototype.trim=function (){return this.replace(/[\xa0]/gi, "");}

function addcat(){
	if(document.all("form").cat.value==""){
		alert(document.all("cat_err").value);
       	document.all("form").cat.focus();
    	return false;		
	}
     document.all("form").submit();
}
function editcat(){
	if(document.all("form").parentName.value==""){
		alert(document.all("cat_err").value);
       	document.all("form").parentName.focus();
    	return false;		
	}
	document.all("form").act.value="edit";
	//alert(document.all("form").act.value);
    document.all("form").submit();
}

function modifynews(obj)
{
	if(document.all(obj).nam.value==""){
		alert(document.all("nam_err").value);
       	document.all(obj).nam.focus();
    	return false;		
	}
     document.all(obj).submit();
}

function addnews()
{
	if(document.all("form").nam.value==""){
		alert(document.all("nam_err").value);
       	document.all("form").nam.focus();
    	return false;		
	}
     document.all("form").submit();
}

function modifykeyword(obj)
{
	if(document.all(obj).key.value==""){
		alert(document.all("key_err").value);
       	document.all(obj).key.focus();
    	return false;		
	}
     document.all(obj).submit();
}

function addkeyword()
{
	if(document.all("form").key.value==""){
		alert(document.all("key_err").value);
       	document.all("form").key.focus();
    	return false;		
	}
     document.all("form").submit();
}

function modifyaut(obj)
{
	if(document.all(obj).nam.value==""){
		alert(document.all("nam_err").value);
       	document.all(obj).nam.focus();
    	return false;		
	}
     document.all(obj).submit();
}

function addaut()
{
	if(document.all("form").nam.value==""){
		alert(document.all("nam_err").value);
       	document.all("form").nam.focus();
    	return false;		
	}
     document.all("form").submit();
}

function uploadico(){	
	if(document.all("form").nam.value=="")
      {
        alert(document.all("nam_err").value);
       	document.all("form").nam.focus();
        return;
      }
      if(document.all("form").filNam.value=="")
      {
        alert(document.all("file_err").value);
        return;
      }
      document.all("form").submit();
}
function modifyico(obj){	
	if(document.all(obj).nam.value==""){
		alert(document.all("nam_err").value);
       	document.all(obj).nam.focus();
    	return false;		
	}
    document.all(obj).submit();
}

function uploadtemp(){	

	if(document.all("form").nam.value=="")
      {
        alert(document.all("nam_err").value);
       	document.all("form").nam.focus();
        return;
      }
      if(document.all("form").filNam.value=="")
      {
        alert(document.all("file_err").value);
        return;
      }
      document.all("form").submit();
}
function modifytemp(obj){	
	if(document.all(obj).nam.value==""){
		alert(document.all("nam_err").value);
       	document.all(obj).nam.focus();
    	return false;		
	}
    document.all(obj).submit();
}