Nowe = null;
function bigImg(w,h,src) {
  if (Nowe) Nowe.close();
  Nowe = window.open('',"bigImg",'height=' + h + ',width=' + w + ', toolbar=no,menubar=no,location=no,personalbar=no,scrollbars=no,status=no,directories=no,resizable=no');
  Nowe.document.open();
  Nowe.document.write("<html><head><title>Laola-SPA</title></head><body style='margin: 0px'><a href='javascript:window.close()'><img src='" + src + "' border=0></a></body></html>");
  Nowe.focus()
}

pop_win = null;
function popup(w,h,url) {
  if (pop_win) pop_win.close();
  pop_win = window.open(url,"pop_win",'height=' + h + ',width=' + w + ',toolbar=no,menubar=no,location=no,personalbar=no,scrollbars=no,status=no,directories=no,resizable=no' );
}

function changeImage( type, num ) {
        if (document.getElementById) {
                if ( document.images ) {
                        if ( type == "prev" ) {
                                imgNum--;
                                if (imgNum < 0) {
                                        imgNum = imgLength - 1;
                                }
                        }
                        else if ( type == "next" ) {
                                imgNum++;
                                if (imgNum >= imgLength) {
                                        imgNum = 0;
                                }
                        }
                        else if ( type == "disp" ) {
                                imgNum = num;
                        }

                        document.getElementById('propimg').src = 'http:\/\/' + imgServer + propImgs[imgNum] + randomStr;

                        if ( propCaps[imgNum] == '' ) {
                                document.getElementById('propimg').alt = 'Picture ' + ( imgNum + 1 );
                                document.getElementById('caption').innerHTML = 'Picture ' + ( imgNum + 1 );
                        }
                        else {
                                document.getElementById('propimg').alt = propCaps[imgNum];
                                document.getElementById('caption').innerHTML = propCaps[imgNum];
                        }
                        /*
                        document.getElementById('picCounter').innerHTML = '(' + ( imgNum + 1 ) + ' of ' + imgLength + ')';

                        var superLink = "&nbsp;";
                        if (supersizes != null) {
                                var supersizeLink = supersizes[imgNum];
                                if(supersizeLink != null && supersizeLink != "") {
                                   document.getElementById('superimg').href = supersizeUri + '?uri=' + supersizeLink;
                                   document.getElementById('superimg').title = 'enlarge image';
                                   superLink = 'enlarge image';
                                }
                                else {
                                document.getElementById('superimg').removeAttribute('href');
                                document.getElementById('superimg').removeAttribute('title');
                             }
                        }
                        document.getElementById('superSize').innerHTML = superLink;
                        */
                }

                if ( type == "disp" ) {
                        if ( document.getElementById ) {
                                var imgElement = document.getElementById('imgTop');
                                if ( imgElement && imgElement.scrollIntoView ){
                                        imgElement.scrollIntoView(1);
                                }
                        }
                        else {
                                window.scrollTo(0,0);
                        }
                }
                return false;
        }
        return true;
}