function fshi()
{
	var x=confirm('Jeni te sigurte per fshirjen ?');
	if (x)
	{
	var isbn=document.all["isbn"].value;
	self.location="action.php?del=del&libri="+idlibri;
	}
	else

		return false;

}
function shto()
{
var titulli=document.all["titulli"].value;
var nentitulli=document.all["nentitulli"].value;
var subjekt=document.all["subjekt"].value;
var person=document.all["person"].value;
var seria=document.all["seria"].value;
var botues=document.all["botues"].value;
var vendbotim=document.all["vendbotim"].value;
var vitbotimi=document.all["vitbotimi"].value;
var issn=document.all["issn"].value;
var nrfaqe=document.all["nrfaqe"].value;
var edicion=document.all["edicion"].value;
var autor=document.all["autor"].value;
var isbn=document.all["isbn"].value;
var total=document.all["total"].value;
var nr= document.all["nr"].value;
var grupi=document.all["grupi"].value;
self.location="libri.php?titulli="+titulli+"&autor="+autor+"&isbn="+isbn+"&grupi="+grupi+"&total="+total+"&nentitulli="+nentitulli+"&subjekt="+subjekt+"&person="+person+"&issn="+issn+"&seria="+seria+"&vendbotim="+vendbotim+"&vitbotimi="+vitbotimi+"&botues="+botues+"&nrfaqe="+nrfaqe+"&nr="+nr+"&edicion="+edicion+"&q=entry";
}
function modifiko()
{
var titulli=document.all["titulli"].value;
var nentitulli=document.all["nentitulli"].value;
var subjekt=document.all["subjekt"].value;
var person=document.all["person"].value;
var seria=document.all["seria"].value;
var botues=document.all["botues"].value;
var vendbotim=document.all["vendbotim"].value;
var vitbotimi=document.all["vitbotimi"].value;
var issn=document.all["issn"].value;
var nrfaqe=document.all["nrfaqe"].value;
var edicion=document.all["edicion"].value;
var autor=document.all["autor"].value;
var isbn=document.all["isbn"].value;
var total=document.all["total"].value;
var grupi=document.all["grupi"].value;
var nr= document.all["nr"].value;
var idlibri=document.all["idlibri"].value;
self.location="libri.php?titulli="+titulli+"&autor="+autor+"&isbn="+isbn+"&grupi="+grupi+"&total="+total+"&nentitulli="+nentitulli+"&subjekt="+subjekt+"&person="+person+"&issn="+issn+"&seria="+seria+"&vendbotim="+vendbotim+"&vitbotimi="+vitbotimi+"&botues="+botues+"&nrfaqe="+nrfaqe+"&nr="+nr+"&edicion="+edicion+"&idlibri="+idlibri+"&q=update";
}

function prenoto(perdorues)
{

var oldisbn=document.all["oldisbn"].value;
self.location="action.php?isbn="+oldisbn+"&id="+perdorues+"&callby=libri";
}


function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag)
{
  // the highlightStartTag and highlightEndTag parameters are optional
  if ((!highlightStartTag) || (!highlightEndTag)) {
    highlightStartTag = "<font style='color:#ffffff'>";
    highlightEndTag = "</font>";
  }


  var newText = "";
  var i = -1;
  var lcSearchTerm = searchTerm.toLowerCase();
  var lcBodyText = bodyText.toLowerCase();

  while (bodyText.length > 0) {
    i = lcBodyText.indexOf(lcSearchTerm, i+1);
    if (i < 0) {
      newText += bodyText;
      bodyText = "";
    } else {
      // skip anything inside an HTML tag
      if (bodyText.lastIndexOf(">", i) >= bodyText.lastIndexOf("<", i)) {
        // skip anything inside a <script> block
        if (lcBodyText.lastIndexOf("/script>", i) >= lcBodyText.lastIndexOf("<script", i)) {
          newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;
          bodyText = bodyText.substr(i + searchTerm.length);
          lcBodyText = bodyText.toLowerCase();
          i = -1;
        }
      }
    }
  }

  return newText;
}


function highlightSearchTerms( treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)
{
  // if the treatAsPhrase parameter is true, then we should search for
  // the entire phrase that was entered; otherwise, we will split the
  // search string so that each word is searched for and highlighted
  // individually
  var searchText=document.all["kerkim"].value;
  if (treatAsPhrase) {
    searchArray = [searchText];
  } else {
    searchArray = searchText.split(" ");
  }

  if (!document.body || typeof(document.body.innerHTML) == "undefined") {
    if (warnOnFailure) {
      alert("Sorry, for some reason the text of this page is unavailable. Searching will not work.");
    }
    return false;
  }

  var bodyText = document.body.innerHTML;
  for (var i = 0; i < searchArray.length; i++) {
    bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);
  }

  document.body.innerHTML = bodyText;
  return true;
}

function shtogrup()
{
	var emri=document.all["emri"].value;
	var keywords=document.all["keywords"].value;
		if (emri==null || keywords==null)
		{
		alert ('Te gjitha fushat duhen plotesuar');
		return false;
		}
		else
		{
		self.location="grup.php?q=entry&emri="+emri+"&keywords="+keywords;
		}
}

function modifikogrup()
{
	var emri=document.all["emri"].value;
	var keywords=document.all["keywords"].value;
	var id=document.all["id"].value;
	if (emri==null || keywords==null)
		{
		alert ('Te gjitha fushat duhen plotesuar');
		return false;
		}
		else
		{
		
		}
		alert ("emri="+emri+":keywords="+keywords+":id="+id)
	self.location="grup.php?q=update&emri="+emri+"&keywords="+keywords+"&id="+id;
}

