var imgLoc = "images/"
var imgExt = ".jpg";
var fileExt = ".htm";

function chngFrm1(topright, topleft, bottomright, bottomleft) { 
frames['p7_image'].location.href = topleft;
frames['p8_image'].location.href = topright;
frames['p9_image'].location.href = bottomright;
frames['p10_image'].location.href = bottomleft; 
return false; 
}

function chngFrm2(top, bottom) { 
frames['p2_image'].location.href = top; 
frames['p3_image'].location.href = bottom; 
return false; 
}

function chngFrm3(self) { 
frames['p5_image'].location.href = self;
return false; 
}

function chngFrm4(top, bottom) { 
frames['p10_image'].location.href = top; 
frames['p9_image'].location.href = bottom; 
return false; 
}

function chngFrm5(self) { 
frames['p6_image'].location.href = self;
return false; 
}


function iprint(ptarget) { 
  ptarget.focus(); 
  ptarget.print(); 
} 


function newImage(arg) {
  if (document.images) {
    rslt = new Image();
    rslt.src = arg;
    return rslt;
  }
}
    
function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
    }
  }
}

//IFrame Height Calculator

function calcHeight1()
{
  //find the height of the internal page
  var the_height=
    document.getElementById('the_iframe1').contentWindow.
      document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById('the_iframe1').height=
      the_height;
}

function calcHeight2()
{
  //find the height of the internal page
  var the_height=
    document.getElementById('the_iframe2').contentWindow.
      document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById('the_iframe2').height=
      the_height;
}

function calcHeight3()
{
  //find the height of the internal page
  var the_height=
    document.getElementById('the_iframe3').contentWindow.
      document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById('the_iframe3').height=
      the_height;
}

function calcHeight4()
{
  //find the height of the internal page
  var the_height=
    document.getElementById('the_iframe4').contentWindow.
      document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById('the_iframe4').height=
      the_height;
}

function newWin(url) {
  // url of this function should have the format: "target,URL".
  if (url == "")
    return;
  window.open(url.substring(url.indexOf(",") + 1, url.length), 
	url.substring(0, url.indexOf(",")));
}

function ViewImage(ifile,ix,iy,ititle,itext) { 
var win;
var sWidth;
var sHeight;
var NS = (document.layers) ? 1 : 0;
win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
if (NS) {
sWidth = win.innerWidth;
sHeight = win.innerHeight;
} else {
sWidth = win.document.body.clientWidth;
sHeight = win.document.body.clientHeight;
}
if(sWidth!=ix || sHeight!=iy) {
win.close();
setTimeout("ViewImage('"+ifile+"',"+ix+","+iy+",'"+ititle+"','"+itext+"')", 250);
return;
}
win.document.open();
win.document.write("<html><head><title>"+ititle+"</title>");
win.document.write("<LINK href=css/home-new.css type=text/css rel=stylesheet></head><body>");
win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
win.document.write("<img src="+ifile+"><p class=news4 Align=center><b>"+itext+"</b></p></div></body></html>");
win.document.close();
}

function viewEvents(url, name) {
	var win = window.open(url,name,'width=640,height=550,resizable=no,scrollbars=no');
	win.focus();
     }

//Glow Links

function getonme() {
el = event.srcElement ;
if (el.getAttribute("litUp1") != null) {
el.className = "onme1" ;
}
}

function getoffme() {
el = event.srcElement ;
if (el.getAttribute("litUp1") != null) {
el.className = "offme";
}
}

document.onmouseover = getonme ;
document.onmouseout = getoffme ;

//Event0 functions

function changeImage()
{
  mainimage.src = imgLoc + list.options[list.selectedIndex].value + imgExt;
}

function prevImage()
{
	if(list.selectedIndex == 0)
	{
		list.selectedIndex = list.options.length-1;
	}
	else
	{
		list.selectedIndex--;
	}
	changeImage();
}

function nextImage()
{
	if(list.selectedIndex == list.options.length-1)
	{
		list.selectedIndex = 0;
	}
	else
	{
		list.selectedIndex++;
	}
	changeImage();
}

//Event1 functions

function changeImage1()
{
  mainimage1.src = imgLoc + list1.options[list1.selectedIndex].value + imgExt;
}

function prevImage1()
{
	if(list1.selectedIndex == 0)
	{
		list1.selectedIndex = list1.options.length-1;
	}
	else
	{
		list1.selectedIndex--;
	}
	changeImage1();
}

function nextImage1()
{
	if(list1.selectedIndex == list1.options.length-1)
	{
		list1.selectedIndex = 0;
	}
	else
	{
		list1.selectedIndex++;
	}
	changeImage1();
}

//Event2 functions

function changeImage2()
{
  mainimage2.src = imgLoc + list2.options[list2.selectedIndex].value + imgExt;
}

function prevImage2()
{
	if(list2.selectedIndex == 0)
	{
		list2.selectedIndex = list2.options.length-1;
	}
	else
	{
		list2.selectedIndex--;
	}
	changeImage2();
}

function nextImage2()
{
	if(list2.selectedIndex == list2.options.length-1)
	{
		list2.selectedIndex = 0;
	}
	else
	{
		list2.selectedIndex++;
	}
	changeImage2();
}

//Event3 functions

function changeImage3()
{
  mainimage3.src = imgLoc + list3.options[list3.selectedIndex].value + imgExt;
}

function prevImage3()
{
	if(list3.selectedIndex == 0)
	{
		list3.selectedIndex = list3.options.length-1;
	}
	else
	{
		list3.selectedIndex--;
	}
	changeImage3();
}

function nextImage3()
{
	if(list3.selectedIndex == list3.options.length-1)
	{
		list3.selectedIndex = 0;
	}
	else
	{
		list3.selectedIndex++;
	}
	changeImage3();
}

//Event4 functions

function changeImage4()
{
  mainimage4.src = imgLoc + list4.options[list4.selectedIndex].value + imgExt;
}

function prevImage4()
{
	if(list4.selectedIndex == 0)
	{
		list4.selectedIndex = list4.options.length-1;
	}
	else
	{
		list4.selectedIndex--;
	}
	changeImage4();
}

function nextImage4()
{
	if(list4.selectedIndex == list4.options.length-1)
	{
		list4.selectedIndex = 0;
	}
	else
	{
		list4.selectedIndex++;
	}
	changeImage4();
}
