// Javascript functions to provide changing testimonials on the Smart telecom site.

function residential_testimonials() {

    // load residential testimonials into an array
    var residential_testimonial = new Array();

    residential_testimonial[0]="<div id=\"rightpic\"><p id=\"pic\"><img src=\"images/image_steve.jpg\" alt=\"Steve\"/></p><div id=\"extras\"><blockquote><p style=\"margin-bottom: 0pt;\">No download limits means I can download whatever I want, whenever I want without any surprises on my bill. That's important to me…</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Steve</span><br><a href=\"customerstories_steve.html\">Read his story</a></p></div></div>";
    residential_testimonial[1]="<div id=\"rightpic\"><p id=\"pic\"><img src=\"images/image_kate.jpg\" alt=\"Kate\"/></p><div id=\"extras\"><blockquote><p style=\"margin-bottom: 0pt;\">No contention ratio means I don't have to share my connection with anyone else. That's important to me.</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Kate</span><br><a href=\"customerstories_kate.html\">Read her story</a></p></div></div>";
    residential_testimonial[2]="<div id=\"rightpic\"><p id=\"pic\"><img src=\"images/image_ashley.jpg\" alt=\"Ashley\"/></p><div id=\"extras\"><blockquote><p style=\"margin-bottom: 0pt;\">7 Mb download and 640 Kb upload speeds means I can send and receive large files fast and easy. That's important to me...</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Ashley</span><br><a href=\"customerstories_ashley.html\">Read her story</a></p></div></div>";

    // generate a random number
    var i = Math.round((residential_testimonial.length-1)*Math.random())

    // display testiminial
    document.write (residential_testimonial[i]);

}

function business_testimonials() {

    // load business testimonials into an array
    var business_testimonial = new Array();

    business_testimonial[0]="<div id=\"rightpic\"><p id=\"pic\"><img src=\"images/client_mccormack01_th.jpg\" alt=\"Ann Stevens\"></p><div id=\"extras\"><blockquote><p style=\"margin-bottom: 0pt;\">The Smart Telecom service is reliable and responsive to our needs</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Ann Stevens</span><span class=\"com\">McCormick Macnaughton</span><br><a href=\"customerstories_mccm.html\">Please read her story</a></p></div></div>";
    business_testimonial[1]="<div id=\"rightpic\"><p id=\"pic\"><img src=\"images/client_sap01_right.jpg\" alt=\"\"></p><div id=\"extras\"><blockquote><p style=\"margin-bottom: 0pt;\">Highly reliable service that is flexible and scalable to meet our changing business needs.</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Stephen Fay</span><span class=\"com\">SAP</span><br><a href=\"customerstories_sap_gsc.html\">Read his story</a></p></div></div>";

    // generate a random number
    var i = Math.round((business_testimonial.length-1)*Math.random())

    // display testiminial
    document.write (business_testimonial[i]);
}

function mixed_testimonials() {

    // load testimonials into an array
    var mixed_testimonial = new Array();

     mixed_testimonial[0]="<div id=\"rightpic\"><p id=\"pic\"><img src=\"images/client_mccormack01_th.jpg\" alt=\"Ann Stevens\"></p><div id=\"extras\"><blockquote><p style=\"margin-bottom: 0pt;\">The Smart Telecom service is reliable and responsive to our needs</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Ann Stevens</span><span class=\"com\">McCormick Macnaughton</span><br><a href=\"customerstories_mccm.html\">Read her story</a></p></div></div>";
     mixed_testimonial[1]="<div id=\"rightpic\"><p id=\"pic\"><img src=\"images/client_sap01_right.jpg\" alt=\"\"></p><div id=\"extras\"><blockquote><p style=\"margin-bottom: 0pt;\">Highly reliable service that is flexible and scalable to meet our changing business needs.</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Stephen Fay</span><span class=\"com\">SAP</span><br><a href=\"customerstories_sap_gsc.html\">Read his story</a></p></div></div>";
     mixed_testimonial[2]="<div id=\"rightpic\"><p id=\"pic\"><img src=\"images/image_steve.jpg\" alt=\"Steve\"/></p><div id=\"extras\"><blockquote><p style=\"margin-bottom: 0pt;\">No download limits means I can download whatever I want, whenever I want without any surprises on my bill. That's important to me…</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Steve</span><br><a href=\"customerstories_steve.html\">Read his story</a></p></div></div>";
     mixed_testimonial[3]="<div id=\"rightpic\"><p id=\"pic\"><img src=\"images/image_kate.jpg\" alt=\"Kate\"/></p><div id=\"extras\"><blockquote><p style=\"margin-bottom: 0pt;\">No contention ratio means I don't have to share my connection with anyone else. That's important to me.</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Kate</span><br><a href=\"customerstories_kate.html\">Read her story</a></p></div></div>";
     mixed_testimonial[4]="<div id=\"rightpic\"><p id=\"pic\"><img src=\"images/image_ashley.jpg\" alt=\"Ashley\"/></p><div id=\"extras\"><blockquote><p style=\"margin-bottom: 0pt;\">7 Mb download and 640 Kb upload speeds means I can send and receive large files fast and easy. That's important to me...</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Ashley</span><br><a href=\"customerstories_ashley.html\">Read her story</a></p></div></div>";

    // generate a random number
    var x = Math.round((mixed_testimonial.length-1)*Math.random())

    // display testiminial
    document.getElementById('rotating').innerHTML=(mixed_testimonial[x]);

    t=setTimeout('mixed_testimonials()',5000)


}

function mixed_testimonials_noimage() {

    // load testimonials into an array
    var mixed_testimonial = new Array();

     mixed_testimonial[0]="<blockquote><p style=\"margin-bottom: 0pt;\">The Smart Telecom service is reliable and responsive to our needs</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Ann Stevens</span><span class=\"com\">McCormick Macnaughton</span><br><a href=\"customerstories_mccm.html\">Read her story</a></p>";
     mixed_testimonial[1]="<blockquote><p style=\"margin-bottom: 0pt;\">Highly reliable service that is flexible and scalable to meet our changing business needs.</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Stephen Fay</span><span class=\"com\">SAP</span><br><a href=\"customerstories_sap_gsc.html\">Read his story</a></p>";
     mixed_testimonial[2]="<blockquote><p style=\"margin-bottom: 0pt;\">No download limits means I can download whatever I want, whenever I want without any surprises on my bill. That's important to me…</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Steve</span><br><a href=\"customerstories_steve.html\">Read his story</a></p>";
     mixed_testimonial[3]="<blockquote><p style=\"margin-bottom: 0pt;\">No contention ratio means I don't have to share my connection with anyone else. That's important to me.</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Kate</span><br><a href=\"customerstories_kate.html\">Read her story</a></p>";
     mixed_testimonial[4]="<blockquote><p style=\"margin-bottom: 0pt;\">7 Mb download and 640 Kb upload speeds means I can send and receive large files fast and easy. That's important to me...</p></blockquote><br><p style=\"margin-bottom: 0pt;\"><span class=\"name\">Ashley</span><br><a href=\"customerstories_ashley.html\">Read her story</a></p>";

    // generate a random number
    var x = Math.round((mixed_testimonial.length-1)*Math.random())

    // display testiminial
    document.getElementById('rotating').innerHTML=(mixed_testimonial[x]);

    t=setTimeout('mixed_testimonials_noimage()',6000)


}


function rotating_banner() {
    var main_images = new Array("introPic13.jpg");

    var i = ((main_images.length-1) > 0) ? Math.round((main_images.length-1)*Math.random()) : 0;

    document.write("<a href='http://www.smarttelecom.ie/residential_broadband.html' style='border:0px' title='Free Broadband Offer'>");
    document.write("<img src='images/" + main_images[i] + "' width='781' height='165' border='0' alt='Intro Pic'>");
    document.write("</a>");
}

function change_products(product_type) {
    var res = document.getElementById("account_type_residential").style;
    var bus = document.getElementById("account_type_business").style;

    if (product_type != "res") {
        res.display = "none";
        bus.display = "block";

        document.getElementById("res_modem").checked = false;
        document.getElementById("res_upstream").checked = false;
        document.getElementById("res_static_ip").checked = false;
        document.getElementById("res_voice").checked = false;
        document.getElementById("res_button").style.backgroundColor = "#fdfdfd";
        document.getElementById("bus_button").style.backgroundColor = "#d4d0c8";
    } else {
        res.display = "block";
        bus.display = "none";

        document.getElementById("bus_modem").checked = false;
        document.getElementById("bus_upstream").checked = false;
        document.getElementById("bus_voice_1").checked = false;
        document.getElementById("bus_voice_2").checked = false;
        document.getElementById("bus_voice_3").checked = false;
        document.getElementById("res_button").style.backgroundColor = "#d4d0c8";
        document.getElementById("bus_button").style.backgroundColor = "#fdfdfd";
    }
}

function change_package(package_name) {
    var offer = document.getElementById("res_offer").style;
    var standard = document.getElementById("res_standard").style;

    if (package_name == "standard") {
        offer.display = "none";
        standard.display = "block";

        document.getElementById("offer_button").style.backgroundColor = "#fdfdfd";
        document.getElementById("standard_button").style.backgroundColor = "#d4d0c8";
    } else {
        offer.display = "block";
        standard.display = "none";

        document.getElementById("offer_button").style.backgroundColor = "#d4d0c8";
        document.getElementById("standard_button").style.backgroundColor = "#fdfdfd";
    }
}

function selectVoice(setVoice) {
    var voice = document.getElementById("res_voice");

    if (setVoice == true) voice.checked = true;
    else voice.checked = false;
}

function disableUpstream(streamName, setUpstream) {
    var upstream = document.getElementById(streamName);

    if (setUpstream == true) upstream.disabled = true;
    else upstream.disabled = false;
}


