

function reportSize() {
  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;
	  }
	}
  }
}

function setInnerWidth(w,h){
	window.resizeTo(800,800);
	reportSize();
	var oX = 800-myWidth;
	var oY = 800-myHeight;
	window.resizeTo( (w+oX) , (h+oY) );
}

function showImage(url, name, targetId) {
	
	var targ = $(targetId).empty();
//	$("ajaxloading").addClass('on');
	$("ajaxloading").setStyle('visibility', 'visible');
	
	new Ajax('/ajax.php', {
			 method: 'get',
			 update: $(targetId), 
			 data: 'action='+targetId+'&name='+name+'&src='+url+'',
			 nComplete: $("ajaxloading").setStyle('visibility', 'hidden')
	}).request()
}
var showImages = new Array();
var imgNum =1;

function nextImg(imagesArray,image) {
	imgNum=$("imgNum").innerHTML-1;
	if (imgNum<imagesArray.length-1) {
		$(image).src = imagesArray[imgNum+1];
		imgNum=imgNum+1;
	} else {
		$(image).src = imagesArray[0];
		imgNum=0;
	}
	$("imgNum").innerHTML=imgNum+1;
}
function prevImg(imagesArray,image) {
	imgNum=$("imgNum").innerHTML-1;
	if (imgNum>0) {
		$(image).src = imagesArray[imgNum-1];
		imgNum=imgNum-1;
	} else {
		$(image).src = imagesArray[imagesArray.length-1];
		imgNum=imagesArray.length-1;
	}
	$("imgNum").innerHTML=imgNum+1;
}

function hideloader() {
	document.getElementById("").style.visibility='hidden';
}
function showloader() {
	document.getElementById("ajaxloading").style.visibility='visible';
}