// NAWIGACJA 
// Copyright (c) Novartis Poland 2003

var isMSIE = (navigator.userAgent.indexOf('MSIE') == -1) ? false : true;

function sendform(_form) {
	var len = _form.email.value.length;
	var atpos = _form.email.value.indexOf("@");
	var dotpos = _form.email.value.indexOf(".");
	var sppos = _form.email.value.indexOf(" ");
	if(len == 0) {
	   alert("Nie podano adresu e-mail");
	   return false;
	}
	if((atpos<1) || (atpos==len-1) || (dotpos<0) || (dotpos==len-1) || (sppos > -1)) {
	   alert("Adres e-mail podano blednie");
	   return false;
	}
};

function overm(stext) {	parent.status = stext; return true; };

function outm() { parent.status = 'Novartis Poland'; return true; };

function goup() { 
	if(isMSIE) window.scroll(0,0); else this.scroll(0,0);
};

var arr_headerHome = new Array("img2/homepage-banner1.swf", "img2/homepage-banner2.swf");

var seq_headerHome = Math.floor(Math.random() * arr_headerHome.length);

function getFlashObjectHome () {
    return("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"597\" height=\"248\" id=\"home-flash\" align=\"middle\"><param name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\"" + arr_headerHome[seq_headerHome] + "\" /><param name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><param name=\"wmode\" value=\"transparent\"><embed src=\"" + arr_headerHome[seq_headerHome] + "\" wmode=\"transparent\" quality=\"high\" bgcolor=\"#ffffff\" width=\"597\" height=\"248\" name=\"home-flash\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /></object>");
}

function navOn(navObj) {
	navObj.style.backgroundColor = '#a28f7f';
}

function navOff(navObj) {
	navObj.style.backgroundColor = '#73563f';
}

function dnavOn(navObj) {
	navObj.style.backgroundColor = '#ede9e6';
}

function dnavOff(navObj) {
	navObj.style.backgroundColor = '#ffffff';
}

var actMenuName = 0;
function showMenu(divName) {
	if(actMenuName) {
		document.getElementById(actMenuName).style.display = 'none';
		actMenuName = 0;
	}
	if (document.getElementById) {
		document.getElementById(divName).style.display = 'block';
		actMenuName = divName;
	}
}

function hideMenu(divName) {
	if (document.getElementById) {
		document.getElementById(divName).style.display = 'none';
	}
	actMenuName = 0;
}

function hideOtherMenu(divName) {
	if(actMenuName && (actMenuName != divName)) {
		document.getElementById(actMenuName).style.display = 'none';
		actMenuName = 0;
	}
}

function hideSelMenu() {
	if(actMenuName) {
		document.getElementById(actMenuName).style.display = 'none';
		actMenuName = 0;
	}
}

var bo_ns_id = 0;
function startIeFix() {
  if (isIE()) {
    document.write('<div id="bo_ns_id_' + bo_ns_id + '" style="z-index:0"><!-- ');
  }
}
function endIeFix() {
  if (isIE()) {
    document.write('</div>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    var theCode = theObject.innerHTML;
    theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"));
    document.write(theCode);
  }
}
function isIE() {
  // only for Win IE 6+
  // But not in Windows 98, Me, NT 4.0, 2000
  var strBrwsr= navigator.userAgent.toLowerCase();
  if (strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0) {
    if (parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6) {
      return false;
    }
    if (strBrwsr.indexOf("win98") > -1 ||
       strBrwsr.indexOf("win 9x 4.90") > -1 ||
       strBrwsr.indexOf("winnt4.0") > -1 ||
       strBrwsr.indexOf("windows nt 5.0") > -1)
    {
      return false;
    }
    return true;
  } else {
    return false;
  }
} 

function sel(Url) {
	if (Url) {
  	window.open(Url,"_blank");
  }
}

function showInvCallout1() {
	if (document.getElementById) {
		document.getElementById('inv-call-tab-l-a').style.color = '#000000';
		document.getElementById('inv-call-tab-r-a').style.color = '#cc3300';
		document.getElementById('inv-call-info1').style.display = 'block';
		document.getElementById('inv-call-info2').style.display = 'none';
	}
}

function showInvCallout2() {
	if (document.getElementById) {
		document.getElementById('inv-call-tab-l-a').style.color = '#cc3300';
		document.getElementById('inv-call-tab-r-a').style.color = '#000000';
		document.getElementById('inv-call-info1').style.display = 'none';
		document.getElementById('inv-call-info2').style.display = 'block';
	}
}

function more(n) {
	var objLink = document.getElementById('blockLink'+n);
	var objBlock = document.getElementById('block'+n);
	objLink.style.display = 'none';
	objBlock.style.display = 'block';
	return false;
};

function hide(n) {
	var objLink = document.getElementById('blockLink'+n);
	var objBlock = document.getElementById('block'+n);
	objLink.style.display = 'block';
	objBlock.style.display = 'none';
	return false;
};
