function openWindow(url, width, height)
{
    window.open(url, "popup", "width=" + width + ", height=" + height + "");
}

function  checkEmail(ceFormObj)
{
    if (ceFormObj.value == "Enter email...") {
        ceFormObj.value = "";
    }
    else if (ceFormObj.value == "") {
        ceFormObj.value = "Enter email...";
    }
}

function subForm(sfFormName)
{
  formObj = document.getElementById(sfFormName);
  formObj.submit();
}


function selBrand(sbNum, sbDoAnim)
{
    if (sbDoAnim) {
        clearTimeout(myTimerId);
    }
    activeBrand = sbNum;
    
    contentObj = document.getElementById("brandInfo");
    for (var i=0 ; i<brandContent.length ; i++) {
        linkObj = document.getElementById("bNav" + i);
        
        if (sbNum == i) {
            linkObj.className = "selected";
            contentObj.innerHTML = brandContent[i];
        }
        else {
            linkObj.className = "";
        }
    }
    
    if (sbDoAnim) {
        myTimerId = setTimeout("animateBrand()", myTimeInterval);
    }
}

function animateBrand()
{
    sbNum = activeBrand;
    
    contentObj = document.getElementById("brandInfo");
    for (var i=0 ; i<brandContent.length ; i++) {
        linkObj = document.getElementById("bNav" + i);
        
        if (sbNum == i) {
            linkObj.className = "selected";
            contentObj.innerHTML = brandContent[i];
        }
        else {
            linkObj.className = "";
        }
    }
    
    activeBrand++;
    activeBrand = activeBrand % (brandContent.length);
    
    myTimerId = setTimeout("animateBrand()", myTimeInterval);
}

function drawBrand()
{
    sbNum = activeBrand;
    
    contentObj = document.getElementById("brandInfo");
    for (var i=0 ; i<brandContent.length ; i++) {
        linkObj = document.getElementById("bNav" + i);
        
        if (sbNum == i) {
            linkObj.className = "selected";
            contentObj.innerHTML = brandContent[i];
        }
        else {
            linkObj.className = "";
        }
    }
    
    activeBrand++;
    activeBrand = activeBrand % (brandContent.length);
}

function drawBrandCallout(sbcBool)
{
    myHTML = '<ul id="brandNav"><li><a href="javascript: selBrand(0, ' + sbcBool + ');" id="bNav0" class="selected">Lemsip</a></li><li><a href="javascript: selBrand(1, ' + sbcBool + ');" id="bNav1">Nurofen</a></li><li><a href="javascript: selBrand(2, ' + sbcBool + ');" id="bNav2">Nurofen for Children</a></li><li><a href="javascript: selBrand(3, ' + sbcBool + ');" id="bNav3">Strepsils</a></li><li><a href="javascript: selBrand(4, ' + sbcBool + ');" id="bNav4">Dettol</a></li></ul><div id="brandInfo"></div>';
    document.write(myHTML);
}