/*********************************************** * Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code ***********************************************/ var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no) var loadedobjects="" var rootdomain="http://"+window.location.hostname var bustcacheparameter="" function ajaxpage(url, containerid, hoveritem) { var page_request = false if (window.XMLHttpRequest) // if Mozilla, Safari etc page_request = new XMLHttpRequest() else if (window.ActiveXObject){ // if IE try { page_request = new ActiveXObject("Msxml2.XMLHTTP") } catch (e){ try{ page_request = new ActiveXObject("Microsoft.XMLHTTP") } catch (e){} } } else return false page_request.onreadystatechange=function(){ loadpage(page_request, containerid) } if (bustcachevar) //if bust caching of external page bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime() page_request.open('GET', url+bustcacheparameter, true) page_request.send(null) } function loadpage(page_request, containerid){ if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) { document.getElementById(containerid).innerHTML=page_request.responseText; } } function loadobjs(){ if (!document.getElementById) return for (i=0; i 400) { top = top - 310; } else{ top = top + 18; } //hp.style.top = (getOffsetTop(hoveritem) + 18)+'px'; //hp.style.left = (getOffsetLeft(hoveritem) - 50)+'px'; hp.style.top = (top)+'px'; hp.style.left = (105)+'px'; hp.style.visibility = "Visible"; } function ShowPopItem_noOffset(hoveritem,url) { ajaxpage(url, "contentarea"); hp = document.getElementById("contentarea"); //hp.style.top = (getOffsetTop(hoveritem))+'px'; //hp.style.left = (getOffsetLeft(hoveritem))+'px'; hp.style.visibility = "Visible"; } /* function ShowPopItem(url) { ajaxpage(""+url, "contentarea"); hp = document.getElementById("contentarea"); //alert("top="+getOffsetTop(hoveritem)+":Left="+getOffsetLeft(hoveritem)); hp.style.top = 300+'px'; hp.style.left =400+'px'; //doSomething(); hp.style.visibility = "Visible"; }*/ function searchSubmit() { var formObj = document.getElementById("search"); searchOpt = get_radio_value(document.search.Search_Radio); searchTxt = document.getElementById("txtSearch").value; calendar_id = 'calendar_id=1'; if(document.frmMonthCal) { calendar_id = document.frmMonthCal.xCriteria.value; } var curdate = new Date(); var pastDate = new Date(); pastDate.setMonth(pastDate.getMonth() -1); currentDateStr = (curdate.getMonth()+1)+'/'+curdate.getDate()+'/'+curdate.getFullYear(); pastDateStr = (pastDate.getMonth()+1)+'/'+pastDate.getDate()+'/'+pastDate.getFullYear(); if(searchOpt=='www') { window.location = "http://search.nasa.gov/search/search.jsp?nasaInclude="+searchTxt; } else { window.location = "ViewSearch.html?integral=0&opgFields=1&opgSearch=1&show_resources=0&&btnSubmit=Search&txtSearch="+searchTxt+"&criteria="+escape(calendar_id)+"&txtStart="+escape(pastDateStr)+"&txtEnd="+escape(currentDateStr); } } function findPosition( oLink ) { if( oLink.offsetParent ) { for( var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent ) { posX += oLink.offsetLeft; posY += oLink.offsetTop; } return [ posX, posY ]; } else { return [ oLink.x, oLink.y ]; } } /*function doSomething(e) { var posx = 0; var posy = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } alert('posx'+posx+'posy'+posx); }*/ function get_radio_value(elem) { for (var i=0; i < elem.length; i++) { if (elem[i].checked) { var rad_val = elem[i].value; } } return rad_val; } /* function ShowPopupTest(hoveritem) { ajaxpage("http://localhost:7001/hq_calendar/index.html", "contentarea"); hp = document.getElementById("contentarea"); hp.style.top = getOffsetTop(hoveritem) + 18; hp.style.left = getOffsetLeft(hoveritem) + 2; hp.style.visibility = "Visible"; } */ function HidePopup() { hp = document.getElementById("contentarea"); hp.innerHTML = " " hp.style.visibility = "Hidden"; } function getOffsetLeft (el) { var ol = el.offsetLeft; while ((el = el.offsetParent) != null) ol += el.offsetLeft; return ol; } function getOffsetTop (el) { var ot = el.offsetTop; while((el = el.offsetParent) != null) ot += el.offsetTop; return ot; } function printThis() { var agt = navigator.userAgent.toLowerCase(); if (window.print) { window.print(); } else if (agt.indexOf("mac") != -1) { alert("Press 'Cmd+p' on your keyboard to print article. "); } else { alert("Press 'Ctrl+p' on your keyboard to print article. "); } }