var isNav4, isIE4, isNav;
var range = "";
var styleObj = "";
if (parseInt(navigator.appVersion.charAt(0)) >= 4) {
  if (navigator.appName == "Netscape") {
  	isNav4 = true;
  	insideWindowWidth = window.innerWidth;
  } else {
  	isIE4 = true;
  	range = "all.";
  	styleObj = ".style";
  }
}


if (navigator.appName == "Netscape") {
  	isNav = true;
}

// Convert object name string or object reference
// into a valid object reference
function getObject(obj) {
	var theObj
	if (typeof obj == "string") {
		theObj = eval("document." + range + obj + styleObj)
	} else {
		theObj = obj
	}
	return theObj
}


function nothing(){}

//open main page from splash screen
function openMainFrame() {
window.open("main/mainframe.html", "newWindow", "toolbar=no,location=yes,directories=no,resizable=yes,status=yes,menubar=yes,toolbar=no,width=650,height=520");
self.close();
}


//show messages in status bar
function msg(str) {
	window.status=str;
	return true;
}


//child to child reference and linking, this can be used for linking to molecule content from embed button
function sectionLink(leftL,rightL) {
	if (isNav) {
		parent.right.location.href = rightL;
		parent.left.location.href = leftL;
	} else {
		parent.document.all.left.location.href = leftL;
		parent.document.all.right.location.href = rightL;
	}
}



// Setting the visibility of an object to visible
function show(obj) {
	var theObj = getObject(obj)
	theObj.visibility = "visible"
}

// Setting the visibility of an object to hidden
function hide(obj) {
	var theObj = getObject(obj)
	theObj.visibility = "hidden"
}




//resize bug fix
function winResize(width, height) {
	if (isNav4) {
		if (window.innerWidth>width || window.innerHeight>height) {
			window.innerWidth=width;
			window.innerHeight=height;
			history.go(0);
		}
	} /*else {
		if (document.body.clientWidth>width || document.body.clientHeight>height) {
			document.body.clientWidth=width;
			document.body.clientHeight=height;
			}
	} */
}


