function loadPage(list) {
	location.href=BaseUrl + list.options[list.selectedIndex].value + "/";
}


function setDefaultText(item)
{
    if(item.type=='password')
    {
        item.type='text';
        item.onfocus=function(){
            if(!parseInt(this.filled)){
                this.value='';this.type='password';
                $(this).removeClass("emptyField");
            }
        }
        item.onblur=function(){
            if(this.value==''){
                this.type='text';this.value=this.getAttribute('default_text');
                this.filled="0";
                $(this).addClass("emptyField");
            }
            else
                this.filled="1";
        }
    }
    else
    {
        item.onfocus=function(){
            if(!parseInt(this.filled)){
                this.value='';
                $(this).removeClass("emptyField");
            }
        }
        item.onblur=function(){
            if(this.value==''){
                this.value=this.getAttribute('default_text');
                this.filled="0";
                $(this).addClass("emptyField");
            }
            else
                this.filled="1";
        }
    };
    
    item.onkeydown=function(e){
        var c=0;
        if(e && e.keyCode)                                   // what a mess...
            c=e.keyCode;
        else
            if(window.event && window.event.keyCode)
                c=window.event.keyCode;
            else
                if(window.Event && window.Event.keyCode)
                    c=window.Event.keyCode;
        if(c==13)
            if(this.value=='')
                this.filled="0";
            else
                this.filled="1";
        return true;
    };
    
    item.value=item.getAttribute('default_text');
    item.filled="0";
    $(item).addClass("emptyField");
}

Array.prototype.indexOf=function(val)
{
    for(var a=0;a<this.length;a++)
        if(this[a]===val)
            return a;
    return -1;
}

function getElementTop(e)
{
    if(navigator.userAgent.match("ipad"))
        return e.offset().top-$(window).scrollTop();
    else
        return e.offset().top;
}

function jumpTo(element)
{
    scrollTo(0,getElementTop(element));
}

function getEvent(e)
{
    if(window.event)
        return window.event;
    else
        return window.Event;
}

