<!--


function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();}
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";}
  
function changeTheme(na) {
createCookie('style', na, 360);
window.location.reload();} 

function shrink() {
document.getElementById("status_message").style.top=y2+'px';
if(y2<-70) {
clearTimeout(t);
changeTheme('wide');
return;
}
y2=y2-py2;
py2++;
t=setTimeout('shrink()',100);
}	

var y2=-50;
var py2=10;
function expand() {
document.getElementById("status_message").style.top=y2+'px';
if(y2>10) {
t=setTimeout('shrink()',500);
return;
}
y2=y2+py2;
if (py>1) {py--;}
t=setTimeout('expand()',100);
}

function cookie_set() {
var cookieEnabled=(navigator.cookieEnabled)? true : false

//if not IE4+ nor NS6+
if (typeof navigator.cookieEnabled=="undefined" && !cookieEnabled){ 
document.cookie="testcookie"
cookieEnabled=(document.cookie.indexOf("testcookie")!=-1)? true : false
}

//if (cookieEnabled) //if cookies are enabled on client's browser
//do whatever
return cookieEnabled;
}

function detect_and_set()
{
if (cookie_set()==true) {	
if (screen.width>=1024) {
document.getElementById('status_message').style.display='block';
expand();
 }
}
}

function change(id, newClass) {
identity=document.getElementById(id);
identity.className=newClass;
}
function sel1(){
document.user_search_form.select_search.value=1;
change('tab1','tab_top_selected');
change('tab2','tab_top');
/* change('tab3','tab_top'); */
change('tab4','tab_top');
}
function sel2(){
document.user_search_form.select_search.value=2;
change('tab1','tab_top');
change('tab2','tab_top_selected');
/* change('tab3','tab_top'); */
change('tab4','tab_top');
}
function sel3(){
document.user_search_form.select_search.value=4;
change('tab1','tab_top');
change('tab2','tab_top');
/* change('tab3','tab_top_selected'); */
change('tab4','tab_top');
}
function sel4(){
document.user_search_form.select_search.value=3;
change('tab1','tab_top');
change('tab2','tab_top');
/* change('tab3','tab_top'); */
change('tab4','tab_top_selected');
}


function click_search() {
if ( (document.user_search_form.select_search.options[1].selected) ||
     (document.user_search_form.select_search.options[2].selected) )
{
document.user_search_form.target="_top";
} else {document.user_search_form.target="_blank";}
}

function addBookmark(title,url) {
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}

function addEngine(name,ext,cat,type)     {       if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function")) {         if (type!="0") {           window.sidebar.addSearchEngine(             "http://mycroft.mozdev.org/nowrapper/submit-install.php/v/" + type + "/" + name + ".src",             "http://mycroft.mozdev.org/nowrapper/submit-install.php/i/" + type + "/" + name + "."+ ext, name, cat );         } else {           window.sidebar.addSearchEngine(             "http://mycroft.mozdev.org/plugins/"+name+".src",             "http://mycroft.mozdev.org/plugins/"+name+"."+ext, name, cat );         }       } else {         alert("Mozilla based browser is needed to install a sherlock plugin");       }     }

var y=new Array(1,1,1,1);
var py=new Array(1,1,1,1);

function expand2(co) {
document.getElementById('nastav'+co).style.height=y[co-1]+'px';
if (y[co-1]>138) {
clearTimeout(t);
return;
}
y[co-1]=y[co-1]+py[co-1];
if (py[co-1]<10) {py[co-1]++};
t=setTimeout('expand2('+co+')',30);
}

function shrink2(co,r) {
document.getElementById('nastav'+co).style.height=y[co-1]+'px';
if (y[co-1]<20) {
clearTimeout(t);
document.getElementById('nastav'+co).style.display='none';
if (r>0) {top.window.location.reload();}
return;
}
y[co-1]=y[co-1]-py[co-1];
if (py[co-1]<20) {py[co-1]++;}
t=setTimeout('shrink2('+co+','+r+')',30);
}


function show_rss(k){
document.getElementById('nastav'+k).style.display='block';
frames['inside'+k].location.href="/rss_setup.php?k="+k;
expand2(k);
}

function close_rss(k){
shrink2(k,0);
}

function close_rss_final(k) {
t=setTimeout('shrink2('+k+',1)',1000);
}

//-->
