/*
 * The script is based on article found at http://www.aglasshalffull.org
 */

var w = 20;
var t;
var p = "q";
var x = 100;
var y = 100;
var q = 5;
var f = 0;
var g = 0;
var h = 40;
var v = 290;
var n = 0;
var o = 0;
var m = 0;

function changecolor(newcolor){if(p=="r"&& document.getElementById){document.getElementById('r').style.backgroundColor = newcolor; return;}
  if(document.layers){ // browser="NN4";             
   document.layers["q"].bgColor = newcolor;         
}         
  if(document.all){ // browser="IE";        
   document.all.q.style.backgroundColor = newcolor;  
}       
  if(!document.all && document.getElementById){ // browser="NN6+ or IE5+";          
   document.getElementById('q').style.backgroundColor = newcolor;           
} 
}

function changewidth(){
 if(x>200&&f==0){f=1;return;}
 if(x<101&&f==1){f=0;return;}
 if(f)q=-5;if(!f)q=5;x=x+q;
 e=document.getElementById("s");
 e.style.width = x + 'px';
  t=setTimeout("changewidth();",0);
}

function changeheightOriginal(){
 if(y>170&&g==0){g=1;return;}
 if(y<101&&g==1){g=0;return;}
 if(g)q=-5;if(!g)q=5;y=y+q;
 e=document.getElementById("u");
 e.style.height = y + 'px';
  t=setTimeout("changeheight();",0);
}

function changeheight(){
 if(y>170&&g==0){g=1;return;}
 if(y<101&&g==1){g=0;return;}
 if(g)q=-1;if(!g)q=1;y=y+q;
 e=document.getElementById("kola_txt");
 e.style.height = y + 'px';
 e=document.getElementById("kombe1_txt");
 e.style.height = y + 'px';
 e=document.getElementById("kombe2_txt");
 e.style.height = y + 'px';
 e=document.getElementById("benz1_txt");
 e.style.height = y + 'px';
 e=document.getElementById("benz2_txt");
 e.style.height = y + 'px';
  t=setTimeout("changeheight();",0);
}

function moveaway(){m=0;
 e=document.getElementById("z");
 if(h>700){h=h-50;m=1;}
  if(h<50){h=h+50;m=1;}
 if(v>350){v=v-50;m=1;}
  if(v<50){v=v+50;m=1;}
    if(!m){n=Math.random()*100-50;o=Math.random()*100-50;h=h+n;v=v+o;}
 e.style.left = h + 'px';
 e.style.top = v + 'px'; 
}

function changecolorslowly(){
 if(w>200){w=20;return;}
 w=w+20;p="r";
 e=document.getElementById("r");
 e.style.width = w + 'px';
 e.style.backgroundColor = 'blue';
  t=setTimeout("changecolorslowly();",0);
}

function wipe(){window.status= " ";} //erase status bar or give it a desired message here (between quotes)









function toggleElementSD(control, element1) {
  element1 = document.formSD.elements[element1];
  
  if (control.name == 'pickloc') {
	  if (control.value == 'Other') {
		//document.formSD.spiro.style.visibility = "visible";	
		element1.style.visibility = "visible";
		control.style.backgroundColor = "#cccccc"
	  }
	  if (control.value != 'Other') {
		//document.formSD.spiro.style.visibility = "hidden";
		element1.style.visibility = "hidden";
		control.style.backgroundColor = "#ffffff"
	  }
  }

  if (control.name == 'droploc') {
	  if (control.value == 'Other') {
		//document.formSD.spiro.style.visibility = "visible";	
		element1.style.visibility = "visible";
		control.style.backgroundColor = "#cccccc"
	  }
	  if (control.value != 'Other') {
		//document.formSD.spiro.style.visibility = "hidden";
		element1.style.visibility = "hidden";
		control.style.backgroundColor = "#ffffff"
	  }
  }

  return;
}

function hideSD() {
	document.formSD.picklocsd.style.visibility = "hidden";
	document.formSD.droplocsd.style.visibility = "hidden";
}









function curDate() {
	var currentTime = new Date()
	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear()
	var date = month + "/" + day + "/" + year;	
	document.formSD.pickdate.value = date;
	document.formSD.dropdate.value = date;
}

function curYear() {
	var year=new Date();
year=year.getYear();
if (year<1900) year+=1900;
document.write(year);
}

