// JavaScript Document
function timeSource(){
   x=new Date(timeNow().getUTCFullYear(),timeNow().getUTCMonth(),timeNow().getUTCDate(),timeNow().getUTCHours(),timeNow().getUTCMinutes(),timeNow().getUTCSeconds());
   x.setTime(x.getTime()+7200000);
   return x;
}
function timeNow(){
   return new Date();
}
function leadingZero(x){
   return (x>9)?x:'0'+x;
}
function displayTime(){
   document.getElementById('disp').innerHTML=eval(outputTime);
   setTimeout('displayTime()',10000);
}
var outputTime="leadingZero(timeSource().getHours()+1)+':'+leadingZero(timeSource().getMinutes())+':'+leadingZero(timeSource().getSeconds())";

function submit_form (id){
	  document.getElementById(id).submit();
}

function s_it(){
	var col_l = document.getElementById('grey_one');
	var col_l_cl = document.getElementById('g_c_bl_g');
	var col_l_cr = document.getElementById('g_c_br_g');
	var col_c = document.getElementById('blue_one');
	var col_c_cl = document.getElementById('b_c_bl_b');
	var col_c_cr = document.getElementById('b_c_br_b');
	col_c.style.height= "auto"
	col_l.style.height= "auto"
	if (!col_l||!col_c)
	return
	var h_l= col_l.offsetHeight
	var h_c= col_c.offsetHeight

	if (h_l> h_c)
		{
		col_c.style.height= h_l+ "px"
		
		col_c_cl.style.top= h_l
		col_c_cr.style.top=h_l+ "px";
		}
	else
	{
		col_l.style.height= h_c+ "px"
	}
}
function strt ()
{

displayTime()

	}



// ----- Show Aux -----
 var show_now = "undefined"
function at_show_aux_brand(parent, child)
{
  var p = document.getElementById(parent);
  var c = document.getElementById(child);

  var top  = 0;
  var left = 0;

var myhe= p.offsetHeight;

for (; p; p = p.offsetParent)
  {

    top  += p.offsetTop;
    left += p.offsetLeft;


  }
//    top  += p.offsetTop;
//    left += p.offsetLeft;
if (show_now!="undefined")
	hide_brand(show_now)
  c.style.position   = "absolute";
  c.style.top        = (top-c.offsetHeight+ myhe) +'px';
  c.style.left       = left+'px';
  c.style.visibility = "visible";
  show_now = c
}

function at_show_aux(parent, child, pparent)
{
  var p = document.getElementById(parent);
  var pp = document.getElementById(pparent);
  var c = document.getElementById(child);

  var top  = (c["at_position"] == "y") ? p.offsetHeight+2 : 0;
  var left = (c["at_position"] == "x") ? p.offsetWidth +2 : 0;

var it=0
for (; p; p = p.offsetParent)
  {

    top  += p.offsetTop;
    left += p.offsetLeft;
	
	it++
  }
  left -=pp.scrollWidth;
//    top  += p.offsetTop;
//    left += p.offsetLeft;

  c.style.position   = "absolute";
  //c.style.top        = (top-6) +'px';
  //c.style.left       = left+'px';
  c.style.visibility = "visible";
}

// ----- Show -----


function at_show()
{
  p = document.getElementById(this["at_parent"]);
  c = document.getElementById(this["at_child" ]);
  pp = document.getElementById(this["at_pparent"]);
  //alert (pp.id); 
  a_up = document.getElementById('a_up_'+this["at_parent" ]);
  a_dn = document.getElementById('a_dn_'+this["at_parent" ]);
  at_show_aux(p.id, c.id, pp.id);

  clearTimeout(c["at_timeout"]);
  clearTimeout(a_up["at_timeout"]);
  clearTimeout(a_dn["at_timeout"]);
}

// ----- Hide -----

function at_hide()
{
  c = document.getElementById(this["at_child"]);
  a_up = document.getElementById('a_up_'+this["at_parent"]);
  a_dn = document.getElementById('a_dn_'+this["at_parent"]);
  a_up["at_timeout"] = setTimeout(hideall, 7777, this["at_child"]);
  a_dn["at_timeout"] = setTimeout(hideall, 7777, this["at_child"]);
  c["at_timeout"] = setTimeout(hideall, 7777, this["at_child"]);
}

function hide_brand(ob) {
	ob.style.visibility = 'hidden'
}
function hideall(ob) {

	document.getElementById(c.id).style.visibility = 'hidden'
	if (document.getElementById('a_up'+'_'+p.id))
  	document.getElementById('a_up'+'_'+p.id).style.visibility = "hidden"
	if (document.getElementById('a_dn'+'_'+p.id))
	document.getElementById('a_dn'+'_'+p.id).style.visibility = "visible"
	}


// ----- AJAX -----
function getData(url) {
	if(window.ActiveXObject) {
		h = new ActiveXObject("Microsoft.XMLHTTP");
		h.open('GET',url,false);
		h.send();
	} else {
		h = new XMLHttpRequest();
		h.open('GET',url,false);
		h.send(null);
	}
	if (h.readyState == 4) 
	{
		if (h.status == 200) 
		{
			return h.responseText;
		}
	}
}

function at_click()
{
  p = document.getElementById(this["at_parent"]);
  c = document.getElementById(this["at_child" ]);
  pp = document.getElementById(this["at_pparent"]);

  if (c.style.visibility != "visible")
  	{
  	at_show_aux(p.id, c.id, pp.id);
	if (document.getElementById('a_dn'+'_'+p.id))
	document.getElementById('a_dn'+'_'+p.id).style.visibility = "hidden"
	if (document.getElementById('a_up'+'_'+p.id))
	document.getElementById('a_up'+'_'+p.id).style.visibility = "visible"
	}
  else 
  {
  c.style.visibility = "hidden";
  if (document.getElementById('a_up'+'_'+p.id))
  	document.getElementById('a_up'+'_'+p.id).style.visibility = "hidden"
	if (document.getElementById('a_dn'+'_'+p.id))
	document.getElementById('a_dn'+'_'+p.id).style.visibility = "visible"
  }

  return false;
}


function at_attach(parent, child, showtype, position, cursor, pparent)
{
  p = document.getElementById(parent);
  pp = document.getElementById(pparent);

  
  c = document.getElementById(child);
  a_up = document.getElementById('a_up_'+parent);
  a_dn = document.getElementById('a_dn_'+parent);

  p["at_parent"]     = p.id;
  p["at_pparent"]     = pp.id;

  c["at_parent"]     = p.id;
  c["at_pparent"]     = pp.id;

  a_up["at_parent"]     = p.id;
  a_dn["at_parent"]     = p.id;
  
  a_up["at_pparent"]     = pp.id;
  a_dn["at_pparent"]     = pp.id;
  
  p["at_child"]      = c.id;
  c["at_child"]      = c.id;
  a_up["at_child"]      = c.id;
  a_dn["at_child"]      = c.id;
  p["at_position"]   = position;
  c["at_position"]   = position;
  a_up["at_position"]   = position;
  a_dn["at_position"]   = position;

  c.style.position   = "absolute";
  c.style.visibility = "hidden";

  if (cursor != undefined) p.style.cursor = cursor;

  switch (showtype)
  {
    case "click":
      p.onmousedown   = at_click;
      p.onmouseout  = at_hide;
    //  a_up.onmousedown   = at_click;
    //  a_up.onmouseout  = at_hide;
      a_dn.onmousedown   = at_click;
      a_dn.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
	  c.onclick     = at_click;
      break;
    case "hover":
      p.onmouseover = at_show;
      p.onmouseout  = at_hide;
     // a_up.onmouseover = at_show;
     // a_up.onmouseout  = at_hide;
      a_dn.onmouseover = at_show;
      a_dn.onmouseout  = at_hide;
      c.onmouseover = at_show;
      c.onmouseout  = at_hide;
      break;
  }
}

function change_it(obj) {
	p.innerHTML= obj.innerHTML
	return false
}


function sw_tab (aobj, holder) {
	
	var j=0
//	alert (document.getElementById(holder+"_"+ j))
	while (document.getElementById(holder+"_"+ j)&& document.getElementById(holder+"_"+ j)!="undefined"){
		if (document.getElementById(holder+"_"+ j)!=aobj)
		{
		document.getElementById(holder+"_"+ j).className = 'mtab'
		document.getElementById(holder+"_h_"+ j).style.display = 'none'
		}
		else 
		{
			document.getElementById(holder+"_h_"+ j).style.display = 'block'
			}
		j++
		}
//	alert (aobj.id)
	aobj.className = 'mtab_s'
	aobj.blur()
	return false
	}
	
function	item_show (aobj, holder) {
	var j=0
	var was = document.getElementById(holder+"_"+ aobj + "_but").className

	while (document.getElementById(holder+"_"+ j)&& document.getElementById(holder+"_"+ j)!="undefined"){
			
			if (document.getElementById(holder+"_"+ j + "_img"))	
			document.getElementById(holder+"_"+ j + "_img").style.display = 'none'
			if (document.getElementById(holder+"_"+ j + "_header"))	
			document.getElementById(holder+"_"+ j + "_header").style.display = 'none'
			if (document.getElementById(holder+"_"+ j + "_but"))	
			document.getElementById(holder+"_"+ j + "_but").className = 'butt_p'

				j++	
	}

if (was=="butt_p")
	{
	var ob_l =document.getElementById(holder+"_"+ aobj + "_but")
	var ob_im =document.getElementById(holder+"_"+ aobj + "_img")
	var ob_head =document.getElementById(holder+"_"+ aobj + "_header")
	
	
			if (ob_l)	
				ob_l.className="butt_m"
			if (ob_im)	
				ob_im.style.display = 'block'
			if (ob_head)	
				ob_head.style.display = 'block'

	}
	var ob_l =document.getElementById(holder+"_"+ aobj + "_but").blur()
	return false
	}