isIE = document.all;

isNN = !document.all&&document.getElementById;





function changecover(layername,on) {

if (on) {

	//alert(layername);

	//alert(document.getElementById(layername).style.visibility);

	isIE ? document.all(layername).style.visibility = 'visible' :document.getElementById(layername).style.visibility = 'visible';

} else if (!on) {

	//alert(layername+': hidden');

	isIE ? document.all(layername).style.visibility = 'hidden' : document.getElementById(layername).style.visibility = 'hidden';

}

}



function thematicCovers(){

	/*changecover('cover3',true);

	changecover('cover4',true);

	changecover('cover5',true);

	changecover('cover6',true);

	changecover('cover4',true);	*/

	return;

}



function coverLayercall() {

top.changecover('cover5a',false);

top.changecover('cover4a',false);

}



function testMe() {

alert('test');

}



function findSetPos3() {

  l3X = getOffsetLeft1(document.getElementById('cover5'));

	l3Y = getOffsetTop1(document.getElementById('cover5'));

	if (isIE) {

		document.all.cover5a.style.pixelTop	= l3Y + 20;

		document.all.cover5a.style.height		= 350 - 20;

	} else {

		document.getElementById('cover5a').style.top 		= l3Y + 20 + "px";

		document.getElementById('cover5a').style.height	= 350 - 20 + "px";

	}

}



/**** Auxillary Scripts ****/

function getOffsetLeft1(el) {

	var ol = el.offsetLeft;

	/* Loops for each iteration getting further and

	further ouside cells and layer to find absolute

	left position from top left corner*/

	while((el = el.offsetParent) != null)

		ol += el.offsetLeft;

	return ol;

}

function getOffsetTop1(el) {

	var ol = el.offsetTop;

	/* Loops for each iteration getting further and

	further ouside cells and layer to find absolute

	top position from top left corner*/

  while((el = el.offsetParent) != null) {

		ol += el.offsetTop;}

	return ol;

}



/*

top.document.getElementById('resultsSelector').style.width = 0;

top.document.getElementById('areaSelector').style.width    = 49%;

}

function changeType2() {

top.document.getElementById('areaSelector').style.display="none";

top.document.getElementById('resultsSelector').style.display="block";

}

function changeType3() {

top.document.getElementById('resultsSelector').style.display="none";

}*/



/**** Second and Third frame changes ****/

function changeType1() {

//top.document.getElementById('thematicSelector').style.width = '1px';

top.document.getElementById('thematicSelector').style.visibility = 'hidden';

//top.document.getElementById('dataSelector').style.width    = '99%';

top.document.getElementById('dataSelector').style.visibility = 'visible';

}

function changeType2() {

//top.document.getElementById('dataSelector').style.width = '1px';

top.document.getElementById('dataSelector').style.visibility = 'hidden';

//top.document.getElementById('thematicSelector').style.width    = '99%';

top.document.getElementById('thematicSelector').style.visibility = 'visible';

thematicCovers();

//setTimeout(runMe10,2000);

}

function changeType9() {

changeType2();

//alert('run');

//Enable following code on production site.  To do with needing same domain name for Javascript to work.

//changecover('cover7a',true);

}



function changeType3() {

//top.document.getElementById('thematicSelector').style.width	= '1px';

//top.document.getElementById('thematicSelector').style.visibility = 'hidden';

//top.document.getElementById('dataSelector').style.width    = '99%';

top.document.getElementById('dataSelector').style.visibility = 'visible';

}

		

//Below function for testing only, script needed in onLoad for Oracle page.

function runMe10(){

//top.document.getElementById('infocover').style.visibility = 'hidden';

top.changecover('cover7',false);

}



function invoke() {

	changeType2();

	changecover('cover3',true);

	changecover('cover4',true);

	changecover('cover5',true);

	changecover('cover6',true);

	changecover('cover7',true);

	frames['info'].location.href = '/thematics/info.jsp';

	frames['insetmaptool'].location.href = '/thematics/jsp/insetmap_dummy.jsp';

}

