function login_callback(data) {

  if (data != 1) {
    alert('Incorrect login or password!');
  } else {
    document.location.href = 'index.html';
  }  

}

function do_login() {

  cms_do_ajax_login($('#login_login').val(), $('#login_password').val(), 0, 'login_callback');

}

function do_login2(e) {

  e = e || window.event || {};

  if (e.keyCode == 13) {
    do_login();
  }  

}

<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

jQuery.noConflict();

/************************************************************************************************************
    (C) www.dhtmlgoodies.com, October 2005
    
    This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.    
    
    Terms of use:
    You are free to use this script as long as the copyright message is kept intact. However, you may not
    redistribute, sell or repost it without our permission.
    
    Thank you!
    
    www.dhtmlgoodies.com
    Alf Magne Kalleland
    
    ************************************************************************************************************/    
    // You can modify these three values
    var slideshow2_noFading = false;    // Just normal show/hide without fading ?
    var slideshow2_timeBetweenSlides = 3000;    // Amount of time between each image(1000 = 1 second)
    var slideshow2_fadingSpeed = 20;    // Speed of fading
    
    
    /* Don't change any of these values */
    var slideshow2_galleryHeigh;    // Height of galery    
    var slideshow2_galleryContainer;    // Reference to the gallery div
    var slideshow2_galleryWidth;    // Width of gallery    
    var slideshow2_slideIndex = -1;    // Index of current image shown
    var slideshow2_slideIndexNext = false;    // Index of next image shown
    var slideshow2_imageDivs = new Array();    // Array of image divs(Created dynamically)
    var slideshow2_currentOpacity = 100;    // Initial opacity
    var slideshow2_imagesInGallery = false;    // Number of images in gallery
    
    function getGalleryImageSize(imageIndex)
    {
        if(imageIndex==slideshow2_imagesInGallery){            
            showGallery();
        }else{
            var imgObj = document.getElementById('galleryImage' + imageIndex);
            var imgWidth = imgObj.width;
            var imgHeight = imgObj.height;
            if(imgWidth>50){                        
                var tmpDiv = document.createElement('DIV');
                tmpDiv.id = 'galleryDiv' + imageIndex;
                tmpDiv.style.visibility = 'hidden';
                tmpDiv.className='imageInGallery';
                slideshow2_galleryContainer.appendChild(tmpDiv);
                tmpDiv.appendChild(imgObj);
                imgObj.style.left = Math.round((slideshow2_galleryWidth - imgWidth)/2)  + "px";
                imgObj.style.top = Math.round((slideshow2_galleryHeight - imgHeight)/2)  + "px";
                tmpDiv.style.visibility = 'hidden';
                slideshow2_imageDivs.push(tmpDiv);
                imageIndex++;
                getGalleryImageSize(imageIndex);
            }else{
                setTimeout('getGalleryImageSize(' + imageIndex + ')',10);
            }
        }        
    }
    
    function showGallery()
    {
        if(slideshow2_slideIndex==-1)slideshow2_slideIndex=0; else slideshow2_slideIndex++;    // Index of next image to show
        if(slideshow2_slideIndex==slideshow2_imageDivs.length)slideshow2_slideIndex=0;
        slideshow2_slideIndexNext = slideshow2_slideIndex+1;    // Index of the next next image
        if(slideshow2_slideIndexNext==slideshow2_imageDivs.length)slideshow2_slideIndexNext = 0;
        
        slideshow2_currentOpacity=100;    // Reset current opacity

        // Displaying image divs
        slideshow2_imageDivs[slideshow2_slideIndex].style.visibility = 'visible';
        if(navigator.userAgent.indexOf('Opera')<0){
            slideshow2_imageDivs[slideshow2_slideIndexNext].style.visibility = 'visible';
        }
        
        
        if(document.all){    // IE rules
            slideshow2_imageDivs[slideshow2_slideIndex].style.filter = 'alpha(opacity=100)';
            slideshow2_imageDivs[slideshow2_slideIndexNext].style.filter = 'alpha(opacity=1)';
        }else{
            slideshow2_imageDivs[slideshow2_slideIndex].style.opacity = 0.99;    // Can't use 1 and 0 because of screen flickering in FF
            slideshow2_imageDivs[slideshow2_slideIndexNext].style.opacity = 0.01;
        }        
        

        setTimeout('revealImage()',slideshow2_timeBetweenSlides);        
    }
    
    function revealImage()
    {
        if(slideshow2_noFading){
            slideshow2_imageDivs[slideshow2_slideIndex].style.visibility = 'hidden';
            showGallery();
            return;
        }
        slideshow2_currentOpacity--;
        if(document.all){
            slideshow2_imageDivs[slideshow2_slideIndex].style.filter = 'alpha(opacity='+slideshow2_currentOpacity+')';
            slideshow2_imageDivs[slideshow2_slideIndexNext].style.filter = 'alpha(opacity='+(100-slideshow2_currentOpacity)+')';
        }else{
            slideshow2_imageDivs[slideshow2_slideIndex].style.opacity = Math.max(0.01,slideshow2_currentOpacity/100);    // Can't use 1 and 0 because of screen flickering in FF
            slideshow2_imageDivs[slideshow2_slideIndexNext].style.opacity = Math.min(0.99,(1 - (slideshow2_currentOpacity/100)));
        }
        if(slideshow2_currentOpacity>0){
            setTimeout('revealImage()',slideshow2_fadingSpeed);
        }else{
            slideshow2_imageDivs[slideshow2_slideIndex].style.visibility = 'hidden';            
            showGallery();
        }
    }
    
    function initImageGallery()
    {
        slideshow2_galleryContainer = document.getElementById('imageSlideshowHolder');
        slideshow2_galleryWidth = slideshow2_galleryContainer.clientWidth;
        slideshow2_galleryHeight = slideshow2_galleryContainer.clientHeight;
        galleryImgArray = slideshow2_galleryContainer.getElementsByTagName('IMG');
        for(var no=0;no<galleryImgArray.length;no++){
            galleryImgArray[no].id = 'galleryImage' + no;
        }
        slideshow2_imagesInGallery = galleryImgArray.length;
        getGalleryImageSize(0);        
        
    }
    
/************************************************************************************************************
(C) www.dhtmlgoodies.com, November 2005

This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.    

Terms of use:
You are free to use this script as long as the copyright message is kept intact. However, you may not
redistribute, sell or repost it without our permission.

Thank you!

www.dhtmlgoodies.com
Alf Magne Kalleland

************************************************************************************************************/

var dhtmlgoodies_slideSpeed = 10;    // Higher value = faster
var dhtmlgoodies_timer = 10;    // Lower value = faster

var objectIdToSlideDown = false;
var dhtmlgoodies_activeId = false;
var dhtmlgoodies_slideInProgress = false;
function showHideContent(e,inputId)
{
    if(dhtmlgoodies_slideInProgress)return;
    dhtmlgoodies_slideInProgress = true;
    if(!inputId)inputId = this.id;
    inputId = inputId + '';
    var numericId = inputId.replace(/[^0-9]/g,'');
    var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);

    objectIdToSlideDown = false;
    
    if(!answerDiv.style.display || answerDiv.style.display=='none'){        
        if(dhtmlgoodies_activeId &&  dhtmlgoodies_activeId!=numericId){            
            objectIdToSlideDown = numericId;
            slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
        }else{
            
            answerDiv.style.display='block';
            answerDiv.style.visibility = 'visible';
            
            slideContent(numericId,dhtmlgoodies_slideSpeed);
        }
    }else{
        slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
        dhtmlgoodies_activeId = false;
    }    
}

function slideContent(inputId,direction)
{
    
    var obj =document.getElementById('dhtmlgoodies_a' + inputId);
    var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);
    height = obj.clientHeight;
    if(height==0)height = obj.offsetHeight;
    height = height + direction;
    rerunFunction = true;
    if(height>contentObj.offsetHeight){
        height = contentObj.offsetHeight;
        rerunFunction = false;
    }
    if(height<=1){
        height = 1;
        rerunFunction = false;
    }

    obj.style.height = height + 'px';
    var topPos = height - contentObj.offsetHeight;
    if(topPos>0)topPos=0;
    contentObj.style.top = topPos + 'px';
    if(rerunFunction){
        setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);
    }else{
        if(height<=1){
            obj.style.display='none';
            if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
                document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';
                document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';
                slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);                
            }else{
                dhtmlgoodies_slideInProgress = false;
            }
        }else{
            dhtmlgoodies_activeId = inputId;
            dhtmlgoodies_slideInProgress = false;
        }
    }
}



function initShowHideDivs()
{
    var divs = document.getElementsByTagName('DIV');
    var divCounter = 1;
    for(var no=0;no<divs.length;no++){
        if(divs[no].className=='dhtmlgoodies_question'){
            divs[no].onclick = showHideContent;
            divs[no].id = 'dhtmlgoodies_q'+divCounter;
            var answer = divs[no].nextSibling;
            while(answer && answer.tagName!='DIV'){
                answer = answer.nextSibling;
            }
            answer.id = 'dhtmlgoodies_a'+divCounter;    
            contentDiv = answer.getElementsByTagName('DIV')[0];
            contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px';     
            contentDiv.className='dhtmlgoodies_answer_content';
            contentDiv.id = 'dhtmlgoodies_ac' + divCounter;
            answer.style.display='none';
            answer.style.height='1px';
            divCounter++;
        }        
    }    
}

window.onload = initShowHideDivs;

