var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1
var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1

function loadMiddle() {
	if (ie){
		top.frames['middle'].location.href='./middle.html';
		//window.alert('Explorer!');
	}
	else if (dom){
		top.parent.middle.location.href='./middle.html';
		//window.alert('Moz!');
	}
}

function loadMiddleB() {
	if (ie){
		top.frames['middle'].location.href='./rel.3/middle.html';
		//window.alert('Explorer!');
	}
	else if (dom){
		top.parent.middle.location.href='./rel.3/middle.html';
		//window.alert('Moz!');
	}
}

function loadMiddle_2() {
	if (ie){
		top.frames['middle'].location.href='./middle_2.html';
		//window.alert('Explorer!');
	}
	else if (dom){
		top.parent.middle.location.href='./middle_2.html';
		//window.alert('Moz!');
	}
}

function loadMiddle_3() {
	if (ie){
		top.frames['middle'].location.href='./middle_3.html';
		//window.alert('Explorer!');
	}
	else if (dom){
		top.parent.middle.location.href='./middle_3.html';
		//window.alert('Moz!');
	}
}

function loadMiddle_3B() {
	if (ie){
		top.frames['middle'].location.href='./rel.3/middle_3.html';
		//window.alert('Explorer!');
	}
	else if (dom){
		top.parent.middle.location.href='./rel.3/middle_3.html';
		//window.alert('Moz!');
	}
}

function loadMiddle_3C() {
	if (ie){
		top.frames['middle'].location.href='../middle_3.html';
		//window.alert('Explorer!');
	}
	else if (dom){
		top.parent.middle.location.href='../middle_3.html';
		//window.alert('Moz!');
	}
}

function loadNews() {
	if (ie){
		top.frames['contents'].location.href='./contents.html';
		//window.alert('Explorer!');
	}
	else if (dom){
		top.parent.contents.location.href='./contents.html';
		//window.alert('Moz!');
	}
}

function loadNewsB() {
	if (ie){
		top.frames['contents'].location.href='./rel.3/contents.html';
		//window.alert('Explorer!');
	}
	else if (dom){
		top.parent.contents.location.href='./rel.3/contents.html';
		//window.alert('Moz!');
	}
}

function loadBook() {
	if (ie){
		top.frames['contents'].location.href='../thebook_enter.html';
		//window.alert('Explorer!');
	}
	else if (dom){
		top.parent.contents.location.href='../thebook_enter.html';
		//window.alert('Moz!');
	}
}

function soundOff() {
	if (ie){
		top.frames['sound'].location.href='../sound_off.html';
		//window.alert('Explorer!');
	}
	else if (dom){
		parent.sound.location.href='../sound_off.html';
		//window.alert('Moz!');
	}
}

//@#@#@@@@@@@################################@@@@@@@@@@@@@@

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
		var obj = top.frames.document.getElementById(szDivID);
		obj.style.visibility = iState ? "visible" : "hidden";
}

//@#@#@@@@@@@################################@@@@@@@@@@@@@@

//newWindows
function openMovie() {
	if (ie){
		top.frames['sound'].location.href='./sound_off.html';
		//window.alert('Explorer!');
	}
	else if (dom){
		parent.sound.location.href='./sound_off.html';
		//window.alert('Moz!');
	}
	scwd=screen.availWidth-10  //-10 ,,, -5
	schg=screen.availHeight-28 //-30 ,,, -5
	newWindow = window.open('./thebook/rise.html','rise','resizable=no,toolbar=no,location=no,scrollbars=no,left=0,top=0,width='+scwd+',height='+schg)
}

function newWin(html,name,w,h) {
	x = (screen.availWidth - w) / 2
	y = (screen.availHeight - h - 100) / 2
	win = window.open(html,name,'width='+w+',height='+h+','+'resizable=no,toolbar=no,location=no,scrollbars=no')
	win.moveTo(x,y)
	win.focus()
}

function newWinScroll(html,name,w,h) {
	x = (screen.availWidth - w) / 2
	y = (screen.availHeight - h - 100) / 2
	win = window.open(html,name,'width='+w+',height='+h+','+'resizable=yes,toolbar=no,location=no,scrollbars=yes')
	win.moveTo(x,y)
	win.focus()
}

function newWinScroll(html,name,w,h) {
	x = (screen.availWidth - w) / 2
	y = (screen.availHeight - h - 100) / 2
	win = window.open(html,name,'width='+w+',height='+h+','+'resizable=yes,toolbar=no,location=no,scrollbars=yes')
	win.moveTo(x,y)
	win.focus()
}
