/* DHTML micro-API from http://www.quirksmode.org/ - Thanks !!!! */
function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}

function show(num)
  {
  var obj1 = new getObj("whatwedo");
  var obj2 = new getObj("contact");
  var obj3 = new getObj("question");
  var obj4 = new getObj("links");
  var block = "block";
  var none = "none";

  if (obj1 && obj2 && obj3 && obj4)
    {
    obj1.style.display = none;
    obj2.style.display = none;
    obj3.style.display = none;
    obj4.style.display = none;

	switch (num)
	  {
	  case 4: obj4.style.display = block; break;
	  case 3: obj3.style.display = block; break;
	  case 2: obj2.style.display = block; break;
	  case 1:
	  default: obj1.style.display = block; break;
      }
    }
  }

function write_email_info()
	{
	document.write('<a href="mail');
	document.write('to:');
	document.write('war'); document.write('e@wa'); document.write('re.com');document.write('.'); document.write('pl');
	document.write('">war');
	document.write('e@ware.');
	document.write('com.pl</a>');
	}

	function checkform()
	{
	var caption = "www.ware.com.pl";
	if (document.question_form.who.value == "")
		{
		alert("Proszę podać swoje nazwisko i imię.");
		return false;
		}
	if (document.question_form.phone.value == "" && document.question_form.email.value == "")
		{
		alert("Proszę podać numer telefonu lub adres e-mail.");
		return false;
		}
	if (document.question_form.description.value == "")
	  {
		alert("Proszę opisać zakres prac lub problem, jaki mamy rozwiązać.");
		return false;
	  }

	return true;
  }

/* ---- */

window.onload = externalLinks;
