
pic20= new Image(20,20); pic20.src="http://converticious.com/img/ic-0.png"; 
pic21= new Image(20,20); pic21.src="http://converticious.com/img/ic-1.png"; 
pic22= new Image(20,20); pic22.src="http://converticious.com/img/ic-2.png"; 
pic23= new Image(20,20); pic23.src="http://converticious.com/img/ic-3.png"; 

function m_form(m_val)
{
	if(m_val=="m_val0")
	{
		if(document.getElementById('i_txt0').innerHTML=='No value....')
		{
			document.getElementById('t0').style.backgroundColor='#FFFFFF';
			document.getElementById('i_txt0').innerHTML='';
		}
	}
	else if(m_val=="m_val1")
	{
	var m_sel=0;
		if(document.getElementById('i_txt0').innerHTML=='Select units to convert a value....')
		{
			
			if(document.getElementById("t1").value!="")
			{
			document.getElementById('t_d0').style.backgroundColor='#FFFFFF';	
			m_sel++;
			}
			if(document.getElementById("t2").value!="")
			{
			document.getElementById('t_d1').style.backgroundColor='#FFFFFF';	
			m_sel++;
			}
			
			if(m_sel==2)document.getElementById('i_txt0').innerHTML='';
		}
		else
		{
			if(document.getElementById("t1").value!="")document.getElementById('t_d0').style.backgroundColor='#FFFFFF';	
			if(document.getElementById("t2").value!="")document.getElementById('t_d1').style.backgroundColor='#FFFFFF';
			
		}
	
	}
	else
	{
	var m_v=2;	
	}	
}
function loadval(theurl,where)
{
	if(document.getElementById("t0").value==""){document.getElementById("t0").style.backgroundColor="#FDE39C";document.getElementById("t0").style.border='1px solid #7F9DB9';document.getElementById("t0").focus();}
	if(document.getElementById("t1").value==""){document.getElementById("t_d0").style.backgroundColor="#FDE39C";}
	if(document.getElementById("t2").value==""){document.getElementById("t_d1").style.backgroundColor="#FDE39C";}
	if(window.XMLHttpRequest) obj2=new XMLHttpRequest();else if(window.ActiveXObject) obj2=new ActiveXObject("Microsoft.XMLHTTP");else return(false);
        obj2.open ('GET', theurl, true);
        obj2.onreadystatechange = function() 
        {
         if(obj2.readyState==1) {document.getElementById(where).innerHTML="<center><img src='img/loader.gif' alt='' border='0'/></center>";}
         else if(obj2.readyState==4)
         {
                   if(obj2.status==200){document.getElementById(where).innerHTML=obj2.responseText;}
                   else if(obj2.status==404){document.getElementById(where).innerHTML = "Error 404";}
                   else{document.getElementById(where).innerHTML = "Error : ".obj2.status;}
         }
        }
        obj2.send(null);
        return;
} 	
function themes(ex)
{
oldtheme=document.getElementById('theme0').value;if(oldtheme==1)t_1.src='img/temperature.png';else if(oldtheme==2)t_2.src='img/volume.png';else if(oldtheme==3)t_3.src='img/distance.png';else if(oldtheme==4)t_4.src='img/weight.png';else if(oldtheme==5)t_5.src='img/area.png';else if(oldtheme==6)t_6.src='img/speed.png';else if(oldtheme==7)t_7.src='img/byte.png';else if(oldtheme==8)t_8.src='img/time.png';else firstload=1;document.getElementById('theme0').value=ex;
}
function showelement(what) 
{
thiselement = document.getElementById(what);if (thiselement.style.display=="none" || thiselement.style.display==""){thiselement.style.display="inline";thiselement.focus();} else {thiselement.style.display="none";}
}

