//=====================================================================
// DOM Image Rollover v3
//=====================================================================
// 	How to use:
// 	1 : Place this script RIGHT ABOVE the closing body tag
// 	2 : * For images that need rollovers, edit/add a "class" attribute
// 	      with the string "domroll your_rollover_image.jpg"
// 	    * If you already have a class attribute on that image:
// 	      &lt;img class="original class domroll image.jpg other stuff"&gt;
//
//	Example: &lt;img src="off.gif" class="domroll on.gif"&gt;
//=====================================================================
// copyright Chris Poole
// http://chrispoole.com
// domroll@chrispoole.com
// demo: http://chrispoole.com/scripts/dom_image_rollover/
//=====================================================================


function domRollover() {
	if (navigator.userAgent.match(/Opera (\S+)/)) {
		var operaVersion = parseInt(navigator.userAgent.match(/Opera (\S+)/)[1]);
	}
	if (!document.getElementById||operaVersion <7) return;
	var imgarr=document.getElementsByTagName('img');
	var imgPreload=new Array();
	var imgSrc=new Array();
	var imgClass=new Array();
	for (i=0;i<imgarr.length;i++){
		if (imgarr[i].className.indexOf('domroll')!=-1){
			imgSrc[i]=imgarr[i].getAttribute('src');
			imgClass[i]=imgarr[i].className;
			imgPreload[i]=new Image();
			if (imgClass[i].match(/domroll (\S+)/)) {
				imgPreload[i].src = imgClass[i].match(/domroll (\S+)/)[1]
			}
			imgarr[i].setAttribute('xsrc', imgSrc[i]);
			imgarr[i].onmouseover=function(){
				this.setAttribute('src',this.className.match(/domroll (\S+)/)[1])
			}
			imgarr[i].onmouseout=function(){
				this.setAttribute('src',this.getAttribute('xsrc'))
			}
		}
	}
}
domRollover();



//Tooltip Scripts


// This portion of the code should be placed in the head section of the document.
// Script tags for the external JavaScipt files should be placed just before the end of the document.

// leave in page to avoid errors if onmouseovers/outs before page completely loaded
function doTooltip(e, msg) {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.show(e, msg);
}

function hideTip() {
  if ( typeof Tooltip == "undefined" || !Tooltip.ready ) return;
  Tooltip.hide();
}

// preload images that will be displayed in tooltip
// put images to preload in this array
var preload_list = new Array("tooltip_print.gif","tooltip_bookmark.gif","tooltip_txt.gif");
var path_to_images = "/livingwithuc/images/";

if (document.images) {
	var image_list = new Array();
	for (var preload_counter=0; preload_counter<preload_list.length; preload_counter++) {
  	image_list[preload_counter] = new Image();
		image_list[preload_counter].src = path_to_images + preload_list[preload_counter];
  }
}

// variables for tooltip content
// name them whatever you want, add as many as you need
var tip1 = '<img src="/livingwithuc/images/tooltip_print.gif" alt="Print this page" border="0">';
var tip2 = '<img src="/livingwithuc/images/tooltip_bookmark.gif" alt="Bookmark this page" border="0">';
var tip3 = '<img src="/livingwithuc/images/tooltip_txt.gif" alt="Resize Text" border="0">';




// dynamic drive pop-up draggable div

var dragapproved=false
var minrestore=0
var initialwidth,initialheight
var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all

function iecompattest(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}


function loadwindow(url,width,height){
if (!ie5&&!ns6)
window.open("","width=width,height=height,scrollbars=1")
else{
document.getElementById("dwindow").style.display=''
document.getElementById("dwindow").style.zIndex='40'
document.getElementById("dwindow").style.position='absolute'
document.getElementById("dwindow").style.width=initialwidth=width+"px"
document.getElementById("dwindow").style.height=initialheight=height+"px"
//document.getElementById("dwindow").style.left="30px"
//document.getElementById("dwindow").style.top=ns6? window.pageYOffset*1+30+"px" : iecompattest().scrollTop*1+30+"px"
}
}

function closeit(){
document.getElementById("dwindow").style.display="none"
}
