var frameWrite = '';
function frameWriter(bottomFrame){	
	frameWrite = '';
	
	frameWrite += "<html><title>Columbia Interactive</title><head>"
	frameWrite += "<script language='JavaScript'>"
	frameWrite += "var bottomUrl = '"+bottomFrame+"'"
	frameWrite += "<\/script>"

	frameWrite += "</head>\n"
	frameWrite += "\n<frameset rows=\"57,*\" framespacing=\"0\" frameborder=\"0\" border=\"0\">\n"
	frameWrite +=    "\n<frame name=\"top\" marginwidth=\"10\" marginheight=\"10\" src=\"http://ci.columbia.edu/ci/top_frame.html\" scrolling=\"no\" framespacing=\"0\" frameborder=\"0\" border=\"0\">\n"
	frameWrite +=    "\n<frame name=\"bottom\" marginwidth=\"10\" marginheight=\"10\" src=\""+bottomFrame+"\" scrolling=\"auto\" framespacing=\"0\" frameborder=\"0\" border=\"0\">\n"
	frameWrite +=   "\n</frameset>"
	frameWrite += "\n</html>"

}

var bottomFrameLocation = '';

//Function for External Links

function goHere(bottomLoc){
	if(bottomLoc.indexOf('.ram', bottomLoc.length - 4) != -1 || bottomLoc.indexOf('.rm', bottomLoc.length - 3) != -1){
		location.href=bottomLoc;
	}
	else if(bottomLoc.indexOf('http://ci.columbia.edu/ci/', 0) != -1 && bottomLoc.indexOf('http://ci.columbia.edu/ci/tools', 0) == -1 ){
		location.href=bottomLoc;
	}
	else if(bottomLoc.indexOf('fathom.com/', 0) != -1 && bottomLoc.indexOf('fathom.com/story', 0) == -1){
                window.open(bottomLoc, '_blank');
        }
	
	else if(bottomLoc.indexOf('jtsa.edu/', 0) != -1){
                window.open(bottomLoc, '_blank');
        }
	else{
		frameWriter(bottomLoc);
		if(location.href.indexOf('columbiainteractive.columbia.edu') != -1){
			framePage = 'http://www.columbiainteractive.columbia.edu/ci/frame.html'
		}
		else{
			framePage = 'http://ci.columbia.edu/ci/frame.html'
		}
		
		frmWnd = window.open(framePage, 'framepage', "statusbar,status,menubar,titlebar,toolbar,location,width=800,height=400,resizable=yes,scrollbars=yes");
		frmWnd.focus();
	}
}



