
var xmlHttp;var dataDiv;var dataTable;var dataTableBody;var offsetEl;function createXMLHttpRequest(){if(window.ActiveXObject){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
else if(window.XMLHttpRequest){xmlHttp=new XMLHttpRequest();}}
function initVars(){dataDiv=document.getElementById("popup");}
function getCourseData(element){initVars();createXMLHttpRequest();offsetEl=element;var url="http://www.blinds.com/control/dictionary?term=sheer";xmlHttp.open("GET",url,true);xmlHttp.onreadystatechange=callback;xmlHttp.send(null);}
function callback(id){if(xmlHttp.readyState==4){if(xmlHttp.status==200){clearData();setOffsets();document.getElementById("popup").innerHTML=xmlHttp.responseText;}}}
function setData(courseData){setOffsets();var length=courseData.getElementsByTagName("length")[0].firstChild.data;var par=courseData.getElementsByTagName("par")[0].firstChild.data;var row,row2;var parData="Par: "+par
var lengthData="Length: "+length;row=createRow(parData);row2=createRow(lengthData);dataTableBody.appendChild(row);dataTableBody.appendChild(row2);}
function createRow(data){var row,cell,txtNode;row=document.createElement("tr");cell=document.createElement("td");cell.setAttribute("bgcolor","#FFFAFA");cell.setAttribute("border","0");txtNode=document.createTextNode(data);cell.appendChild(txtNode);row.appendChild(cell);return row;}
function setOffsets(){var width=10;var end=calculateOffsetTop(offsetEl,"offsetLeft");var top=calculateOffsetTop(offsetEl,"offsetTop");dataDiv.style.border="black 1px solid";dataDiv.style.left=end+width+"px";dataDiv.style.top=top+"px";}
function calculateOffsetTop(field,offset){return calculateOffset(field,offset);}
function calculateOffset(field,attr){var offset=0;while(field){offset+=field[attr];field=field.offsetParent;}
return offset;}
function clearData(){document.getElementById("popup").innerHTML="";}