// here we define global variable var ajaxdestination=""; function simpleGet(what, where) { try { xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { /* do nothing */ } ajaxdestination=where; xmlhttp.onreadystatechange = triggered; // when request finished, call the function to put result to destination DIV xmlhttp.open("GET", what); xmlhttp.send(null); return false; } function triggered() { // put data returned by requested URL to selected DIV if (xmlhttp.readyState == 4) if (xmlhttp.status == 200) document.getElementById(ajaxdestination).innerHTML =xmlhttp.responseText; } function openwindow(url, width, height) { var recommend_page = encodeURI(document.location); var myRef = window.open(url + "?recommend_page=" + recommend_page, "mywin", "left=20,top=20,width=" + width + ",height=" + height + ",toolbar=0,status=0,location=0"); } function leaveSite( newURL ) { var result = confirm('You have selected a link to a website that exists outside of the Viramune.com Web site. Boehringer Ingelheim Pharmaceuticals, Inc. provides access to these sites as a service to Viramune.com visitors, and is not responsible or liable for the content and information presented within any external site.'); if (result) window.open(newURL); return false; } function addEvent( obj, type, fn ) { if ( obj.attachEvent ) { obj["e"+type+fn] = fn; obj[type+fn] = function() { obj["e"+type+fn]( window.event ); } obj.attachEvent( "on"+type, obj[type+fn] ); } else obj.addEventListener( type, fn, false ); } function removeEvent( obj, type, fn ) { if ( obj.detachEvent ) { obj.detachEvent( "on"+type, obj[type+fn] ); obj[type+fn] = null; } else obj.removeEventListener( type, fn, false ); } function externalLinks() { if (document.getElementById) { // Find all links var links = document.getElementsByTagName('a'); var link; for (var i = 0; i < links.length; i++) { link = links[i]; if(link.getAttribute('rel') == 'external' || link.href.substring(0, 10) == 'http://www' || link.href.substring(0, 13) == 'http://dasis3' || link.href.substring(0, 10) == 'http://kap') { if (link.getAttribute('rel') != 'safe') { links[i].onclick = function() { return leaveSite(this.href); } } } } // Now find all image map links var areas = document.getElementsByTagName('area'); var area; for (var i = 0; i < areas.length; i++) { area = areas[i]; if (area.getAttribute('href').substring(0, 10) == 'http://www') { areas[i].onclick = function() { return leaveSite(this.getAttribute('href')); } } } } } function adjustNavHeight() { var contentHeight = document.getElementById('content').clientHeight + 80; var nav = document.getElementById('nav'); nav.style.height = contentHeight + "px"; } addEvent(window, 'load', externalLinks); addEvent(window, 'load', adjustNavHeight);