//var ie6 = (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1) && (navigator.userAgent.toLowerCase().indexOf('msie 7') == -1);

/*if (ie6)
    document.execCommand('BackgroundImageCache', false, true); */
var qTipTag = "a";
var qTipX = 5; //This is qTip's X offset//
var qTipY = -10; //This is qTip's Y offset//

//There's No need to edit anything below this line//
tooltip = {
  name : "intersitialPopup",
  offsetX : qTipX,
  offsetY : qTipY,
  tip : null
}

tooltip.init = function() {
    //var tipNameSpaceURI = "http://www.w3.org/1999/xhtml";
    if (!tipContainerID) { var tipContainerID = "intersitialPopup"; }
    var tipContainer = document.getElementById(tipContainerID);

    if (!tipContainer) {
        tipContainer = document.createElement("div");
        tipContainer.id = tipContainerID;
        tipContainer.className = "yellowTooltip";
        var a = document.getElementById("main");
        a.appendChild(tipContainer);
        //document.getElementsByTagName("body").item(0).appendChild(tipContainer);
    }

    if (!document.getElementById) return;
    this.tip = document.getElementById(this.name);
    //if (this.tip) document.onmousemove = function(evt) { tooltip.move(evt) };

    var a, sTitle, elements;

    var elementList = qTipTag.split(",");
    for (var j = 0; j < elementList.length; j++) {
        elements = document.getElementsByTagName(elementList[j]);
        if (elements) {
            for (var i = 0; i < elements.length; i++) {
                a = elements[i];
                sTitle = a.getAttribute("qtitle");
                if (sTitle) {
                    a.setAttribute("tiptitle", sTitle);
                    a.removeAttribute("qtitle");
                    //a.removeAttribute("alt");
                    a.onmouseover = function(evt) { tooltip.show(this.getAttribute('tiptitle'), evt) };
                    a.onmouseout = function() { tooltip.hide() };
                }
            }
        }
    }
}

tooltip.move = function(evt) {
    var x = 0, y = 0;
    if (document.all) {//IE
        x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
        y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
        x += window.event.clientX;
        y += window.event.clientY;

    } else {//Good Browsers
        x = evt.pageX;
        y = evt.pageY;
    }
    var divh = document.getElementById('intersitialPopup').offsetHeight;   
    //alert(this.offsetX);
    //setXY(this.tip, x - 22, y - this.tip.offsetHeight + this.offsetY);
    document.getElementById("intersitialPopup").style.left = (x ) + "px";
    document.getElementById("intersitialPopup").style.top = (y ) - divh + "px";

}

tooltip.show = function(text, evt) {
    if (!this.tip) return;
    var tipcontent;
    switch (text) {
        case "1":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Allergic reaction:</div><p>A local or generalized reaction of an organism following contact with a specific allergen to which it has been previously exposed and sensitized.</p></div></div>";
            break;
        case "2":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Antibody:</div><p>A protein in the body that helps fight infection. Antibodies have also been used to fight cancer.</p></div></div>";
            break;
        case "3":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Antiemetic:</div><p>A remedy that tends to control nausea and vomiting.</p></div></div>";
            break;
        case "4":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Benign:</div><p>Not cancerous, does not invade nearby tissues or spread to other parts of the body.</p></div></div>";
            break;
        case "5":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Biological Therapy:</div><p>Treatment to boost or restore the ability of the immune system to fight cancer, infections, and other diseases.  Also used to lessen certain side effects that may be caused by some cancer treatments.</p></div></div>";
            break;
        case "6":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Cell:</div><p>The individual unit that makes up the tissues of the body. All living things are made up of 1 or more cells.</p></div></div>";
            break;
        case "7":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Chemotherapy:</div><p>Treatment with anticancer drugs.</p></div></div>";
            break;
        case "8":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Clinical trial:</div><p>A research study that evaluates the effectiveness of new interventions in people. Each study is designed to evaluate new methods of screening, prevention, diagnosis, or treatment of cancer.</p></div></div>";
            break;
        case "9":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Electrolytes:</div><p>Electrolytes are primarily responsible for the movement of nutrients into the cells and waste out of cells. Some examples of electrolytes are potassium, magnesium, and calcium.</p></div></div>";
            break;
        case "10":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Epidermal growth factor receptor (EGFR):</div><p>A receptor found on both normal and tumor cells that is important for cell growth.</p></div></div>";
            break;
        case "11":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Interstitial lung disease (ILD):</div><p>Injury to the lungs.</p></div></div>";
            break;
        case "12":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Intravenous (IV) infusion:</div><p>A type of injection in which a drug is administered over a period of time directly into the blood through a vein.</p></div></div>";
            break;
        case "13":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Malignant:</div><p>Cancerous; a growth with a tendency to invade and destroy nearby tissue and spread to other parts of the body.</p></div></div>";
            break;
        case "14":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Metastasis:</div><p>The spread of cancer from one part of the body to another. Cells in the metastatic (secondary) tumor are the same type as those in the original (primary) tumor.</p></div></div>";
            break;
        case "15":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Monoclonal antibodies:</div><p>Laboratory-produced substances that can locate and bind to specific proteins and cells wherever they are in the body. Many monoclonal antibodies are being evaluated for purposes of cancer detection or therapy.</p></div></div>";
            break;
        case "16":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Multidisciplinary team:</div><p>A team that includes a number of doctors and other healthcare professionals who are experts in different specialties.</p></div></div>";
            break;
        case "17":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Oncologist:</div><p>A doctor who specializes in treating patients with cancer.</p></div></div>";
            break;
        case "18":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Platinum agents:</div><p>Particular types of chemotherapy agents that are derived from the metal platinum and kill cells that are growing.</p></div></div>";
            break;
        case "19":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Primary tumor site:</div><p>Organ or site of the body in which a cancer first appears. Where cancers start is called the primary site; cancers may then spread (metastasize) to other parts of the body.</p></div></div>";
            break;
        case "20":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Radiation dermatitis:</div><p>Skin irritation caused by radiation therapy.</p></div></div>";
            break;
        case "21":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Radiation oncologist:</div><p>A physician specializing in the use of radiation to treat disease, especially cancer.</p></div></div>";
            break;
        case "22":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Radiation therapy (also called radiotherapy):</div><p>Radiation therapy uses high-energy radiation from x-rays, neutrons, and other sources to kill cancer cells and shrink tumors.</p></div></div>";
            break;
        case "23":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Side effect:</div><p>An unwanted effect caused by a drug. All drugs, even common over-the-counter drugs, have the potential to cause side effects.</p></div></div>";
            break;
        case "24":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Squamous cell carcinoma:</div><p>Cancer that begins in thin, flat cells that make up the lining of many areas of the body, including the oral cavity.</p></div></div>";
            break;
        case "25":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Targeted therapy:</div><p>A type of treatment that uses drugs or other substances, such as monoclonal antibodies, to identify and attack specific cancer cells.  Targeted therapy may have fewer side effects than other types of cancer treatment.</p></div></div>";
            break;
        case "26":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Tumor:</div><p>An abnormal mass of tissue that results from excessive cell division. Tumors perform no useful body function. They may be either benign (not cancerous) or malignant (cancerous).</p></div></div>";
            break;
        case "out":
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Please Note</div><p>You are about to leave the Bristol-Myers Squibb Company ERBITUX.com site. The site we are linking to is not controlled or endorsed by Bristol-Myers Squibb Company and we are not responsible for the content provided on that site. Your linking to any other off-site pages or other sites is at your own risk. </p></div></div>";
            break;
        default:
            tipcontent = "<div class='bottom'><div class='contents'><div class='title'>Error</div><p>Nothing was given. </p></div></div>";
    }

    this.tip.innerHTML = tipcontent;
    this.tip.style.display = "block";
    this.tip.style.visibility = "visible";    
    tooltip.move(evt);
}

tooltip.hide = function () {
	if (!this.tip) return;
	this.tip.innerHTML = "";
	this.tip.style.display = "none";
	this.tip.style.visibility = "hidden";
}

window.onload = function () {
	tooltip.init ();
}
