
// preload rollovers
preload("Images/Nav/globalHome_o.gif");
preload("Images/Nav/globalContact_o.gif");
preload("Images/Nav/mainManufacturers.gif");
preload("Images/Nav/mainOperators_o.gif");
preload("Images/Nav/mainPartners_o.gif");
preload("Images/Nav/mainProductInformation_o.gif");
preload("Images/Nav/mainSoleusTeam_o.gif");
preload("Images/Nav/soleus_web_home_o.gif");
preload("Images/Home/lnkWatch_o.gif");
preload("Images/Home/lnkReadMore_o.gif");
preload("Images/Home/lnkNews_o.gif");
// handle rollovers
function mOver(Image) {
	if(Image) {

		if(Image.src.indexOf("_o") == -1) {
   			
		Image.src = Image.src.replace(".gif", "_o.gif");
		
	    }
	   
	 }
	 if(lastImage) {
		lastImage.src = lastImage.src.replace("_o.gif", ".gif");
		}
		
	lastImage = Image;
}

var lastImage;

// simple preload function
function preload(sPath) {
	var o = new Image();
	o.src = sPath;
	return o;
}

function openWindow(location, width, height, title, scrollbar) {
window.open( location, "_blank", "height=" +height + ", width=" + width + "toolbar=no, menubar=no, location=no, status=no, resizable=no, scrollbars=" + scrollbar ,  false);
return false;
}

var initialContentHeight;

function onLoadHeight() {

	var maxHeight
	maxHeight=200;
	

	maxHeight=Math.max(maxHeight,getDivSize("content")- 16);
	maxHeight=Math.max(maxHeight,getDivSize("contentSide") +34);
	initialContentHeight = maxHeight;
	maxHeight=Math.max(maxHeight,getWindowHeight() - 296);
	document.getElementById("content").style.height = maxHeight + "px";	
	
}

function onResizeHeight() {
var maxHeight = initialContentHeight;
maxHeight=Math.max(maxHeight,getWindowHeight() - 296);
document.getElementById("content").style.height = maxHeight + "px";	
}

function adjustHeightHome() {
var maxHeight;
maxHeight=Math.max(getWindowHeight(),getDivSize("container")- 0);
document.getElementById("shadow").style.height = maxHeight + "px";	
}

// determine height for <div> element 
function getDivSize(DivID) {	
	d= document.getElementById(DivID)
	var divHeight = 0
	if(d.offsetHeight)
		{ 
		 divHeight=d.offsetHeight; 
		} 
		else if(d.style.pixelHeight)
		{ 
		 divHeight=d.style.pixelHeight; 
		} 
	return divHeight;
	
}

//get height of the window
function getWindowHeight() {
var windowHeight=0;
if (typeof(window.innerHeight)=='number') {
windowHeight=window.innerHeight;
}
else {
if (document.documentElement&& document.documentElement.clientHeight) {
windowHeight=
document.documentElement.clientHeight;
}
else {
if (document.body&&document.body.clientHeight) {
windowHeight=document.body.clientHeight;
}
}
}
return windowHeight;
}

// Soleus in Action JS
function showPic (whichpic) { 
	if (document.getElementById) { 
		document.getElementById('placeholder').src = whichpic.href; 
		if (whichpic.title) { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title; 
		} else { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; 
		} 
		return false; 
	} else { 
		return true; 
	} 
}