﻿function ShowSearch() 
{
    document.getElementById('loading').className = 'loading-visible';		
    setTimeout("UpdateImg()",50);
}
/*IE fix breaking animation*/
function UpdateImg() 
{
	var img = document.getElementById('anigif');
	if(img != null)
	    img.src = "App_Themes/preloader.gif";
}
var sfval = "z.B. Zahnarzt Graz";
function setTFocus()
{
    var txtBox=document.getElementById("s");    
    if (txtBox!=null) 
    {
        txtBox.focus();
        if(txtBox.value == "")
        {
            txtBox.value = sfval;
            /*txtBox.select();*/
        }
    }
}
function clearField()
{
    var txtBox=document.getElementById("s");    
    if (txtBox!=null && txtBox.value == sfval) 
    {
        txtBox.value = "";
    }
}

function setCharAt(str,index,chr) 
{
    if(index > str.length-1) return str;
    return str.substr(0,index) + chr + str.substr(index+1);
}         
function SpCheckBox(nr, onlyUpdate)
{            
    var mode = document.getElementById("mode");        
    
    var csel = "img_cb" + nr;   
    var img_cb = document.getElementById(csel);
    
    var it = mode.value.charAt(nr-1);
    
    if(onlyUpdate)
    {
        it = (it == '1') ? '0' : '1';
    }
    
    if(it == '1')
    {
        it = '0';
        img_cb.src = 'App_Themes/Default/chk'+nr+'_off.gif';
    }
    else
    {
        it = '1';
        img_cb.src = 'App_Themes/Default/chk'+nr+'_on.gif';
    }        
    mode.value = setCharAt(mode.value, nr-1, it);        
}  
function updboxes(newv)
{
    document.getElementById("mode").value = newv;        
    var i=1;
    for (i=1;i<=3;i++)
       SpCheckBox(i, true); 
}   
