<!--hide 

var sPhotogallery;
var sImageName;

function setFocus() {
  if (document.forms.length > 0) {
	var field = document.forms[0];
	for (i = 0; i < field.length; i++) {
	  if ((field.elements[i].type == "text") || (field.elements[i].type == "textarea") || (field.elements[i].type.toString().charAt(0) == "s")) {
		document.forms[0].elements[i].focus();
		break;
	  }
    }
  }
}

function confirmDelete() {
var message = "Delete record?";
  if (confirm(message)) {
    return true;
  } else {
    return false;
  }
}

function newwindow(url,name,width,height) 
{ 
	var url = url;
	var name = name;
	//var feature = "width="+width+",height="+height+",left=80,top=40,scrollbars=no,resizable=yes,toolbar=no";
	var feature = "width="+width+",height="+height+",left=80,top=40,scrollbars=yes,resizable=yes,toolbar=no";
	window.open(url,name,feature).focus();
} 

function showPhotogallery(name) {
	var url = "http://www.jfi.is/photogallery/";
	var name = name;
	var feature = "width=820,height=620,scrollbars=yes,resizable=yes";
	sPhotogallery = window.open(url,name,feature);
	//sPhotogallery.creator = self;
	sPhotogallery.focus();
	//window.open("http://www.lax-a.is/photogallery/", name, "width=820,height=620,scrollbars=yes,resizable=yes");
	//sPhotogallery = window.open("/photogallery/", name, "width=820,height=620,scrollbars=yes,resizable=yes");
}

function showPhotogallery2(name,imgname) {
	var url = "http://www.jfi.is/photogallery/";
	var name = name;
	var feature = "width=820,height=620,scrollbars=yes,resizable=yes,status=yes";
	sImageName = imgname;
	sPhotogallery = window.open(url,name,feature);
	sPhotogallery.creator = self;
	sPhotogallery.focus();
	//window.open("http://www.lax-a.is/photogallery/", name, "width=820,height=620,scrollbars=yes,resizable=yes");
	//sPhotogallery = window.open("/photogallery/", name, "width=820,height=620,scrollbars=yes,resizable=yes");
}

function showPhotogalleryGud(name,imgname) {
	var url = "http://www.jfi.is/photogallery/";
	var name = name;
	sImageName = imgname;
	var feature = "width=820,height=620,scrollbars=yes,resizable=yes";
	sPhotogallery = window.open(url,name,feature);
	sPhotogallery.creator = self;
	sPhotogallery.focus();
	//window.open("http://www.lax-a.is/news/photogallery/", name, "width=820,height=620,scrollbars=yes,resizable=yes");
	//sPhotogallery = window.open("/photogallery/", name, "width=820,height=620,scrollbars=yes,resizable=yes");
}

function remLink() {
  if (window.sPhotogallery && window.sPhotogallery.open && !window.sPhotogallery.closed)
    window.sPhotogallery.opener = null;
}

function resize(mynd){
  if (document.images[mynd].width >= document.images[mynd].height){
	document.images[mynd].width=150;
  } 
  else {
	document.images[mynd].height=150;
  }
}

function sendaMyndOld(url) {
  if (window.name == "photogallery"){
    sendaMyndForm(url);
  } else {
    sendaMyndRitill(url);
  }
}

function sendaMyndForm(url) {
  if (window.opener && !window.opener.closed){
	//alert(window.opener.location.href);
	var img = opener.sImageName;
	if (img == 'image1'){
      window.opener.document.form.image1.value = url;}
	else if (img == 'image2'){
      window.opener.document.form.image2.value = url;}
	else if (img == 'image3'){
      window.opener.document.form.image3.value = url;}
	else{
      window.opener.document.form.image.value = url;}
	//opener.document.form1.imgUrl.value = url;
	//opener.imgName();
    window.close();
    return false;	
  }
}

function sendaMyndRitill(url) {
window.opener = "http://www.trophytrout.is/edit/page_edit.asp"; 
 	alert(window.opener.location.href);
 if (window.opener && !window.opener.closed){
	alert(window.opener.location.href);
	window.opener.document.form.imgUrl.value = "http://www.lax-a.is/photogallery/photos/"+url;
	window.opener.imgName();
    window.close();
    return false;	
  }
}

function sendaMyndGud(url) {
  if (window.opener && !window.opener.closed){
	if (window.name == "photogallery1"){
      window.opener.document.form.image1.value = url;
	  window.close();}
	else if (window.name == "photogallery2"){
      window.opener.document.form.image2.value = url;
	  window.close();}
	else if (window.name == "photogallery3"){
      window.opener.document.form.image3.value = url;
	  window.close();}
	else if (window.name == "photogallery"){
      window.opener.document.form.image.value = url;
	  window.close();}
	//opener.document.form1.imgUrl.value = url;
	//opener.imgName();
    //window.close();
    return false;	
  }
}
function onChange(object) {
    var Current = object.cat.selectedIndex;
    object.keywords.value = object.cat.options[Current].text;
}

function changeto(highlightcolor){
	source=event.srcElement
	if (source.tagName=="TR"||source.tagName=="TABLE")
		return
	while(source.tagName!="TD")
		source=source.parentElement
	if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
		source.style.backgroundColor=highlightcolor
}

function changeback(originalcolor){
	if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
		return
	if (event.toElement!=source)
		source.style.backgroundColor=originalcolor
}

//Athugar hvort strengur sem kemur inn se númerískur
function isNumeric(numberIn)  {
  if (numberIn.value != "" ) {
    var sValidChars = "0123456789";  //Listi yfir takn sem ma nota
    var len = numberIn.length;
    var sChar;
    var iCount;
    var bResult = true;
    for (iCount = 0; iCount < len && bResult == true; iCount++)  {
      sChar = numberIn.charAt(iCount);
      if (sValidChars.indexOf(sChar) == -1)  {
        bResult = false
      }
    }
  return bResult;
  }
  return true;
}

-->  
