﻿// JScript File
function displaySummary(vspan, vstr_side)
{
    var str_html = new String("");
    var str_title = new String();
    str_title = getObjInnerText(vspan);
    str_title = str_title.toLowerCase();
    str_title = str_title.replace(/^\s+|\s+$/g,"");
    
    var div = document.getElementById("divListItemSummary");
    for (var idx = 0; idx < div.getElementsByTagName("*").length; idx++){
        if (div.getElementsByTagName("*")[idx].className == "imgcontainer") {
            div.getElementsByTagName("*")[idx].className = "hidden";
            break;
        }
    }
    
    var str_img_id = new String("");    
    switch (str_title){    
        case "asthma":
            str_html += "Employs techniques to reduce or eliminate stress, ";
            str_html += "promotes relaxation, and reprogrammes specific behaviour patterns.";
            break;
        case "bed wetting":
            str_html += "To encourage a dry bed at nights.";
            break;
        case "blushing":
            str_html += "To reduce this stress response and deal with embarrassment.";
            break;
        case "blood pressure":
            str_html += "Using specific relaxation techniques to help lower blood pressure.";
            break;
        case "confidence":
            str_html += "Rebuilding true inner confidence and eliminating uneccessary fears.";
            str_img_id = "divImgWomanSmiling";
            break;
        case "coping with change":
            str_html += "Learning how to ride life's highs and lows without u-neccessary anxiety. ";
            str_html += "Dealing with specific events.";
            break;
        case "creativity":
            str_html += "Releases blocked potential in areas of writing, painting, and the performing arts; ";
            str_html += "motivates production and promotes the use of the trance state as an aid to insight.";
            break;
        case "direction in life":
            str_html += "How to take up the reigns and regain control, motivation and direction for the future.";
            break;
        case "eating problems":
            str_html += "Individually tailored work due to the complex nature of this condition.";
            break;
        case "examination nerves/phobias":
            str_html += "Specific coping mechanisms to take you through the previously feared situation ";
            str_html += "in a safe way.";
            break;
        case "effective learning/memory":
            str_html += "Improves study habits, enhances memory, instils positive attitude towards ";
            str_html += "learning and provides a calm effective state of mind for improved performance ";
            str_html += "in examinations. Great for preparation for driving tests etc as well as academic exams.";
            str_img_id = "divEffectiveLearningMemory";
            break;
        case "executive stress":
            str_html += "Learning how to let go of stress and achieve more.";
            break;
        case "frustration":
            str_html += "Learning how to deal with the little and big frustrations and anger in situations or ";
            str_html += "with people.";
            break;
        case "goal setting and achieving potential":
            str_html += "How to start living successfully today by harnessing the power of your mind.";
            break;
        case "grief":
            str_html += "Dealing with all stages of grief, bringing resolution and enabling you to move ";
            str_html += "forward with your life.";
            break;
        case "irritable bowel syndrome":
            str_html += "Alongside medical treatment specific techniques to address the anxiety component ";
            str_html += "of the condition.";
            break;
        case "learning difficulties":
            str_html += "Learn how to improve your ability to retain and recall information.";
            break;
        case "migraine":
            str_html += "Alongside any medical treatments specific techniques to help ease and deal ";
            str_html += "with the discomfort.";
            break;
        case "nail biting":
            str_html += "A single session to eliminate this unwanted habit.";
            break;
        case "natural childbirth":
            str_html += "Supports and reinforces effective breathing and relaxation techniques, ";
            str_html += "programmes pain control, establishes communication with the child and ";
            str_html += "promotes a positive post birth phase.";
            break;
        case "nightmares":
            str_html += "Learning how to deal with and reduce occurence of disturbing dreams by ";
            str_html += "working with the material in a state of relaxation.";
            break;
        case "performance nerves/stage fright":
            str_html += "Enabling you to perform at your best in specific situations.";
            break;
        case "phobias":
            str_html += "Conquers irrational or exaggerated fears of, for example, riding in a lift, "
            str_html += "air travel, crowds, animals or disease.";
            break;
        case "obsessive compulsions":
            str_html += "Reprogramming the mind to let go of the need to carry out such behaviours.";
            break;
        case "pain reduction":
            str_html += "Controls pain in chronic conditions such as arthritis or back pain; ";
            str_html += "introduces techniques for reducing pain or surgery, injury or disease.";
            str_img_id = "divPainReduction";
            break;
        case "panic attacks":
            str_html += "Using specific techniques to address and reduce the occurrence of anxiety attacks.";
            break;
        case "preparation for birth/parenthood":
            str_html += "Empowering your mind for the changes ahead and to have a positive birth experience.";
            str_img_id = "divPregnantWoman";
            break;
        case "psychogenic infertility issues":
            str_html += "Trying to concieve or having problems keeping pregnancy? Using deep states of ";
            str_html += "relaxation to allow every chance for the body to become and stay pregnant. ";
            str_html += "Individual support can be given right through the process as needed.";
            break;
        case "public speaking":
            str_html += "Make that speech and enjoy the experience by reducing anxiety and fear.";
            break;
        case "relationships":
            str_html += "Various approaches for each individual case in looking at the relationship in question.";
            break;
        case "rejection feelings":
            str_html += "Learning to deal with rejection and moving on with your life.";
            break;
        case "sales performance":
            str_html += "Learn how to achieve more under pressure and maximise your potential for success.";
            str_img_id = "divSalesPerformance";
            break;
        case "self-esteem and motivation":
            str_html += "Improves self-projection, changes attitudes and past negative behaviour, ";
            str_html += "increases confidence and self-acceptance; programs for specific goals, ";
            str_html += "instils feelings of comfort with regard to success."
            break;
        case "skin disorders":
            str_html += "Alongside any medical treatments specific techniques to reduce stress which ";
            str_html += "often exacerbates. Can also help with reducing itching and the urge to scratch."; 
            break;
        case "sleep problems":
            str_html += "Learn how to reprogramme your mind for a better nights sleep.";
            break;
        case "smoking cessation":
            str_html += "Eliminates the smoking habit and provides procedures for permanent ";
            str_html += "behaviour modification. Two sessions spaced a week apart with CDs ";
            str_html += "for home use. Guarantee: Should the client start smoking again within ";
            str_html += "a three month period a FREE extra session is offered to get back on track. ";
            str_html += "For further details please to the Stop Smoking page by clicking on ";
            str_html += "'Smoking Cessation'.";
            str_img_id = "divImgStopSmoking";
            break; 
        case "sports performance":
            str_html += "Refines athletic performance by allowing strong focus on areas that need improvement, ";
            str_html += "creates a sense of success in the execution of skills, increases stamina and co-ordination, "
            str_html += "puts the competitive spirit in perspective, and enhances overall attitude."
            str_img_id = "divImgMarathonRunner";
            break;
        case "stage fright":
            str_html += "Specific techniques to address this so you can give your best performance ";
            str_html += "whilst enjoying the experience.";
            break;
        case "stress":
            str_html += "Learning to deal with stress, fear and anxiety in any situation.";
            str_img_id = "divStress";
            break;
        case "tension":
            str_html += "Learning to deal with tension of all types in all situations.";
            break;
        case "travel fright":
            str_html += "Using specific techniques to deal with fears around all types of travel.";
            break;
        case "weight control":
            str_html += "Motivates weight loss, changes attitudes to and reforms eating habits, ";
            str_html += "and establishes a means to maintain the new weight.";
            break;
       default:
            str_html += "Summary to be written."
            break;
    }
    
    document.getElementById("pSummary").innerHTML = str_html;
    if (str_img_id != "" ){document.getElementById(str_img_id).className = "imgcontainer";}
    
    var row = vspan.parentNode.parentNode;
    var divListItemSummary = document.getElementById("divListItemSummary");
    
    if (window.navigator.appName.toLowerCase() == "netscape"){
        if (vstr_side.toLowerCase() == "left"){
            var img = row.childNodes[1].childNodes[0];}
        else {var img = row.childNodes[1].childNodes[2];}
    }
    else {
        if (vstr_side.toLowerCase() == "left"){
            var img = row.children[0].children[0];}
        else {var img = row.children[0].children[1];}
    }
    
    var num_row_count = new Number();
    num_row_count = row.parentNode.rows.length;
   
    vspan.className = "listitemselected";
    divListItemSummary.className = "listitemsummary";
    if (vstr_side.toLowerCase() == "left"){
        img.className = "visiblespeechleft";}
    else {img.className = "visiblespeechright";}
    
    var row_position = getElementPosition(row);
    var num_top = new Number();
    if (divListItemSummary.offsetHeight > 50) {
        num_top = row_position.y - ((((divListItemSummary.offsetHeight / 2)) * row.rowIndex)/(num_row_count - 1));
        if (row.rowIndex < (num_row_count / 2)) { num_top -= 10} else {num_top += 10}
    }
    else {
        num_top = row_position.y - 14}
    
    divListItemSummary.style.top = num_top + "px";
    var img_position = getElementPosition(img);
    
    if (vstr_side.toLowerCase() == "right"){
        divListItemSummary.style.left = img_position.x + img_position.width + "px";}
    else{
        divListItemSummary.style.left =  img_position.x - divListItemSummary.offsetWidth + "px";
    }
}

function hideSummary(vspan)
{
    var row = vspan.parentNode;
    
    for (var idx = 0; idx < row.getElementsByTagName("*").length; idx++){
        if (row.getElementsByTagName("*")[idx].tagName.toLowerCase() == "img") {
            if (row.getElementsByTagName("*")[idx].className == "visiblespeechleft") {
                row.getElementsByTagName("*")[idx].className = "hiddenspeechleft";
                vspan.className = "leftitem";
                break;}
            else if (row.getElementsByTagName("*")[idx].className == "visiblespeechright"){
                row.getElementsByTagName("*")[idx].className = "hiddenspeechright";
                vspan.className = "rightitem";
                break;
            }
        }
    }
    
    var divListItemSummary = document.getElementById("divListItemSummary");
    divListItemSummary.className = "hidden";
}

