
function navurl(url)
{
    window.location = url;
}

function showData(namedatalist, namedatalistimg, id) {
    datalist = document.getElementsByName(namedatalist);
    datalistimg = document.getElementsByName(namedatalistimg);
    for (i=0; i<datalist.length;i++) {
        datalist[i].style.display = 'none';
        datalistimg[i].className = '';
    }

    document.getElementById(namedatalist + id).style.display = 'block';
    document.getElementById(namedatalistimg + id).className = 'fi';
    return false;
}

function showFi(namedatalistimg, id) {
    datalistimg = document.getElementsByName(namedatalistimg);
    for (i=0; i<datalistimg.length;i++) {
        datalistimg[i].className = '';
    }

    document.getElementById(namedatalistimg + id).className = 'fi';
    return false;
}

function showSubMenuNoFlash(id) {
    listsubmenu = document.getElementsByName('sm');
    for (i=0; i<listsubmenu.length;i++) {
        listsubmenu[i].style.display = 'none';
    }
    submenu = document.getElementById('sm' + id);
    submenu.style.display = '';
    
    return false;
}

var arrayimg = new Array();
var arraya = new Array();
var numimg = 0;
var http_request = false;

function makeRequest(url, parameters) {
  http_request = false;
  if (window.XMLHttpRequest) { // Mozilla, Safari,...
     http_request = new XMLHttpRequest();
     if (http_request.overrideMimeType) {
        http_request.overrideMimeType('text/xml');
     }
  } else if (window.ActiveXObject) { // IE
     try {
        http_request = new ActiveXObject("Msxml2.XMLHTTP");
     } catch (e) {
        try {
           http_request = new ActiveXObject("Microsoft.XMLHTTP");
        } catch (e) {}
     }
  }
  if (!http_request) {
     alert('Cannot create XMLHTTP instance');
     return false;
  }
  http_request.onreadystatechange = alertContents;
  http_request.open('GET', url + parameters, true);
  http_request.send(null);
}

function showArrayImageNoFlash(xml) {
    makeRequest(xml,'');
}

function alertContents() {
    
  if (http_request.readyState == 4) {
     if (http_request.status == 200) {

        var xmldoc = http_request.responseXML;
        var root = xmldoc.getElementsByTagName('slideshow').item(0);
        var i = 0;
        for (var iNode = 0; iNode < root.childNodes.length; iNode++) {
           var node = root.childNodes.item(iNode);
           if (node.attributes != null)
           {
                var url = node.getAttribute("url");
                var link = node.getAttribute("url_adress");
                arrayimg[i] = url;
                arraya[i] = link;
                i = i +1;
           }
        }
        
     } else {
        alert('There was a problem with the request.');
     }
     document.getElementById('img_noflash').src = arrayimg[numimg];
     timerImgNoFlash = setInterval(changeImgNoFlahs, 10000);
  }
}

function changeImgNoFlahs() {
    numimg++;
    if (numimg > arrayimg.length-1) { numimg = 0;}
    document.getElementById('img_noflash').src = arrayimg[numimg];
    //clearTimeout(timerID);
}

/*function navNoFlash()
{
    window.location = arraya[numimg];
}*/


