// JavaScript Document
function openTab(tget){
	for(i=1;i<=document.getElementById('tab').childNodes.length;i++){
		if(document.getElementById('creiter'+i)){
			document.getElementById('creiter'+i).style.display = 'none';
		}
		if(document.getElementById('tab'+i)){
			document.getElementById('tab'+i).firstChild.style.borderTop = 'none';
			document.getElementById('tab'+i).firstChild.firstChild.style.color = '#e87ea6';
			if(tget != i){
				document.getElementById('tab'+i).firstChild.onmouseover=function()
				{
					this.style.borderTop = '1px solid #e87ea6';
					this.firstChild.style.color = '#fbf1f5';
				}
				document.getElementById('tab'+i).firstChild.onmouseout=function()
				{
					this.style.borderTop = 'none';
					this.firstChild.style.color = '#e87ea6';
				}
			}
		}		
	}
	document.getElementById('creiter'+tget).style.display = 'block';
	document.getElementById('tab'+tget).firstChild.style.borderTop = '1px solid #e87ea6';
	document.getElementById('tab'+tget).firstChild.firstChild.style.color = '#fbf1f5'
	document.getElementById('tab'+tget).firstChild.onmouseover=function()
	{
		this.style.borderTop = '1px solid #e87ea6';
		this.firstChild.style.color = '#fbf1f5';
	}
	document.getElementById('tab'+tget).firstChild.onmouseout=function()
	{
		this.style.borderTop = '1px solid #e87ea6';
		this.firstChild.style.color = '#fbf1f5';
	}
}

function init()
{
   var a=document.getElementsByTagName('a');
   var inp=document.getElementsByTagName('input');
   var arr=[];

   for (var i=0;i<a.length;i++) {
      arr[i] = a[i];
   }

   for (i=0;i<inp.length;i++) {
      if(inp[i].type == 'submit' || inp[i].type == 'image' || inp[i].type == 'reset' || inp[i].type == 'button' || inp[i].type == 'checkbox' || inp[i].type == 'radio') {
         arr = arr.concat([inp[i]]);
      }
   }

   a = arr;

   for (i=0;i<a.length;i++) {
      a[i].onmousedown = function()
      {
         this.onfocus = function()
         {
            this.blur();
         }
      }
      a[i].onmouseup = function()
      {
         this.onfocus = function(){}
      }
      a[i].onmouseout = a[i].onmouseup;
   }
}

window.onload = init;
