﻿window.onresize = callout_middle;
window.onload = callout_middle;

function callout_middle(){
if (self.innerWidth)
	{
		frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		frameHeight = document.body.clientHeight;
	}
imgw = document.slide_image.width;
imgh = document.slide_image.height;	
var posH = (frameHeight/2)-(imgh/2)-35;
var posW = (890/2)-(imgw/2)-20;
if( posH < 0) var posH = '0';
		document.getElementById('callout').style.top=posH + 'px';
		document.getElementById('callout').style.left=posW + 'px';
		
}


function callout_show(){
		callout_middle();
		document.getElementById('callout').style.visibility="visible";
		document.getElementById('callout').style.display="block";
}


function callout_hide(){

		document.getElementById('callout').style.visibility="hidden";
		document.getElementById('callout').style.display="none";
}


function slide(path,img_w,img_h){
	document.loading.src='/images/site_images/callout/loading.gif';
	pic = new Image(img_w,img_h);
	pic.onload = nextImage;
	pic.src = path; 
		
	function nextImage() {
		document.slide_image.src= path;
		document.slide_image.width=img_w;
		document.slide_image.height=img_h;
		document.loading.src='/images/site_images/spacer.gif';
		callout_middle();
	}
}

///*********************************************************

function callout_movie_middle(){
if (self.innerWidth)
	{
		frameHeight = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientWidth)
	{
		frameHeight = document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		frameHeight = document.body.clientHeight;
	}
imgw = document.slide_image.width;
imgh = document.slide_image.height;	
var posH = (frameHeight/2)-(imgh/2)-35;
var posW = (890/2)-(imgw/2)-20;
if( posH < 0) var posH = '0';
		document.getElementById('callout_movie').style.top=posH + 'px';
		document.getElementById('callout_movie').style.left=posW + 'px';		
}

function callout_movie_show(){
		callout_movie_middle();
		document.getElementById('callout_movie').style.visibility="visible";
		document.getElementById('callout_movie').style.display="block";
}

function callout_movie_hide(){

		document.getElementById('callout_movie').style.visibility="hidden";
		document.getElementById('callout_movie').style.display="none";
}

