﻿function openPopWindow(url,height,width) {

	if ((navigator.appName== "Netscape" && parseInt(navigator.appVersion) > 3)|| (navigator.appName.indexOf("Microsoft") != -1 && parseInt(navigator.appVersion) > 3)) {
		loupe = window.open(url ,"smallPop",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + width + ',height=' + height);
	  loupe.focus();
	}
	return false;
}

var hiresimage = "";

function setHiresImage(image) {
	hiresimage = image;
}

function popWindow() {
	openPopWindow("/PicturePop.aspx?image=" + hiresimage,600,630);
	return false;
}

function swapImage(sourceImageID, newURL, sourceCaptionID, newCaption, popImageHLID, popImage) {
	document.getElementById(sourceImageID).setAttribute("src",newURL);
	document.getElementById(sourceCaptionID).innerHTML = newCaption;
	setHiresImage(popImage)
	return false;
}

function submitFormOnEnterKey(e, buttonid)
{ 
  var bt = document.getElementById(buttonid); 
  if (typeof bt == 'object')
  { 
    if(navigator.appName.indexOf("Netscape")>(-1))
    { 
      if (e.keyCode == 13) // Enter key code
      { 
        bt.click(); 
        return false; 
      } 
    } 
    if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
    {
      if (event.keyCode == 13) // Enter key code
      { 
        bt.click(); 
        return false; 
      } 
    } 
  } 
} 
function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
		this.obj = document.all[name];
		this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function invi(flag)
{
	if (!DHTML) return;
	var x = new getObj('text');
	x.style.visibility = (flag) ? 'hidden' : 'visible'
}

function showLoginForm(showPanelID, hidePanelID, focusID) {
	var showID = new getObj(showPanelID);
	showID.style.display = 'inline';
	var tfocus = new getObj(focusID);
	tfocus.obj.focus();
	var hideID = new getObj(hidePanelID);
	hideID.style.display = 'none';
	return false;
}