/**
  * @author  Brandon Wamboldt
  * @package kats-designs-admin
  * @version 1.0.0
  * @date    October 18th, 2009
  *
  * This file is the intelluctual property of Northern Lights Technology. Any
  * unauthorized use, modifications, or distribution of this code is prohibted.
  *
  * http://northernlightstechnology.ca/legal
  */
  
var IE=document.all?true:false;if(!IE){document.captureEvents(Event.MOUSEMOVE);}var tempX,tempY;function getMouseX(e){if(IE){tempX=event.clientX+document.body.scrollLeft;}else{tempX=e.pageX;}if(tempX<0){tempX=0;}return tempX;}function getMouseY(e){if(IE){tempY=event.clientY+document.body.scrollTop;}else{tempY=e.pageY;}if(tempY<0){tempY=0;}return tempY;}

function getSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return myWidth;
}
  
function doGalleryJS(max_count) {
	var count = 0;
	var itemCur;

	while (count < max_count) {
		itemCur = document.getElementById('pitem' + count);
		
		itemCur.onmouseover = showInfo;
		if (itemCur.captureEvents) itemCur.captureEvents(Event.MOUSEOVER);
		itemCur.onmouseout = hideInfo;
		if (itemCur.captureEvents) itemCur.captureEvents(Event.MOUSEOUT);
		itemCur.onmousemove = moveInfo;
		if (itemCur.captureEvents) itemCur.captureEvents(Event.MOUSEMOVE);
		
		count++;
	}
	
	function showInfo(e) {
		if (!e) var e = window.event
		if (e.target === undefined){var targetv=e.srcElement.id;}else{var targetv=e.target.id;}
		targetv = targetv.substring(1);
		document.getElementById('i' + targetv).style.display = 'block';
		document.getElementById('i' + targetv).style.top = ((document.getElementById('i' + targetv).offsetHeight * -1) - 10) + 'px';
	}
	
	function hideInfo(e) {
		if (!e) var e = window.event
		if (e.target === undefined){var targetv=e.srcElement.id;}else{var targetv=e.target.id;}
		targetv = targetv.substring(1);
		document.getElementById('i' + targetv).style.display = 'none';
	}

	function moveInfo(e) {
		if (!e) var e = window.event
		if (e.target === undefined){var targetv=e.srcElement.id;}else{var targetv=e.target.id;}
		targetv = targetv.substring(1);
		var height=document.getElementById('i' + targetv).offsetHeight;
		//document.getElementById('i' + targetv).style.top = ((getMouseY(e)-10)-height) + 'px';
		//document.getElementById('i' + targetv).style.left = (getMouseX(e) - 200) + 'px';
	}
}
