// JavaScript Document
var xmlHttp = null;

function loadPage(page, params, target, contentType){
	if (xmlHttp != null) xmlHttp.abort();
	
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e){
		// Internet Explorer
		try{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e){
			try{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e){
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	
	xmlHttp.onreadystatechange = function(){
		if(xmlHttp.readyState == 4){
			if (xmlHttp.status == 200){
				if (contentType == "HTML"){
					document.getElementById(target).innerHTML = xmlHttp.responseText;
				}else if(contentType == "Javascript"){
					eval(xmlHttp.responseText);
				}
			}
		}
	}
	
	xmlHttp.open("POST",page,true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	//xmlHttp.overrideMimeType('text/html');
	xmlHttp.send(params);
}

function loadContent(page, params, target){
	loadPage(page, params, target, "HTML");
}

function loadJS(page, params){
	loadPage(page, params, "", "Javascript");
}

//upgrade.php
function doRetrieveLicence(username, password, form){
	if (username.value.length == 0){ alert("Username must be entered."); username.focus(); }
	if (password.value.length == 0){ alert("Password must be entered."); password.focus(); }
	
	var param = "custUsername=" + username.value + "&custPassword=" + password.value + "&formName=" + form.name;
	
	loadJS("components/custLicence.php",param,null);
}

//prodList.php
function showDesc(code,target){
	loadContent("components/prodDesc.php?productCode=" + code,"",target);
}

//updateTypeList.php
function showDuration(type,target){
	loadContent("components/updateTypeDesc.php?updateType=" + type,"",target);
}

//custLicence.php
function setFeedbackStatus(message){
	var fs_input = document.getElementById('feedbackStatusInput');
	var fs_block = document.getElementById('feedbackStatusBlock');
	
	if (fs_input != null){ fs_input.value = message; }
	if (fs_block != null){ fs_block.innerHTML = message; }
}

//purchase.php
function setUpdateType(val){
	loadJS("components/sessionSetPurchaseDetails.php?key=updateType&value=" + val,"");
}

//purchase.php
function setWorkstationCount(val){
	loadJS("components/sessionSetPurchaseDetails.php?key=workstationCount&value=" + val,"");
}

//Header
function determineObject(targetOBJ) {
	var element = null;
	if(document.all) {
		element = document.all[targetOBJ];
	}
	if (document.getElementById) {
		element = document.getElementById(targetOBJ);
	}
	return element;
}
function pickArticle() {
	var article = window.location.search.substring(1);
	if(article != "") {
		showPanel(article, '');
	}
}
function showPanel(targetOBJ, targetBTN) {
	var target = determineObject(targetOBJ);
	var content1 = determineObject('home');
	var content2 = determineObject('business');
	var content3 = determineObject('enterprise');
	content1.setAttribute("class", "invisible");
	content1.setAttribute("className", "invisible");
	content2.setAttribute("class", "invisible");
	content2.setAttribute("className", "invisible");
	content3.setAttribute("class", "invisible");
	content3.setAttribute("className", "invisible");
	target.setAttribute("class", "visible");
	target.setAttribute("className", "visible");
	return true;
}

function showPanel2(targetOBJ, targetBTN) {
	var target = determineObject(targetOBJ);
	var content4 = determineObject('nod32home');
	var content5 = determineObject('nod32renewals');
	var content6 = determineObject('nod32business');
	var content7 = determineObject('nod32enterprise');
	content4.setAttribute("class", "invisible");
	content4.setAttribute("className", "invisible");
	content5.setAttribute("class", "invisible");
	content5.setAttribute("className", "invisible");
	content6.setAttribute("class", "invisible");
	content6.setAttribute("className", "invisible");
	content7.setAttribute("class", "invisible");
	content7.setAttribute("className", "invisible");
	target.setAttribute("class", "visible");
	target.setAttribute("className", "visible");
	return true;
}

<!--
<!--
// Global variables
var menuCur  = null;
var popupCur = null;
var uMargin  = 64;
var lMargin  = 160;
var pageCnt  = 0;
var menuType = null;

// zisti aky browser sa pouziva
isNS4 = (document.layers) ? 1 : 0;
isIE  = (document.all) ? 1 : 0;
isW3C = (document.getElementById && !document.all) ? 1 : 0;
isIE4Mac = ((navigator.appVersion.indexOf("Mac") != -1) && (document.all) && !(document.getElementById)) ? 1 : 0;

// blizsie overenie, toho, ci je naozaj IE
if (isIE)
{
  if (navigator.userAgent.indexOf("MSIE")==-1) isIE=0;
}

// mys nad polozkou menu
// implicitne sa popup menu neposuva 
function menuOver(popup)
{
  if (isIE) menuOverOff(popup, 0);
}
function menuOverOff(popup, offset)
{
  if (!isIE) return;
  var fel = event.fromElement;
  var tel = event.toElement;

  if (tel.tagName == 'TD') 
  { 
    menuCur = tel; menuType = tel.className; menuCur.className = 'menuHigh'; 
  }
  if (tel.tagName == 'A' && tel.parentElement.className == 'menuItem') 
  { 
    menuCur = tel.parentElement; menuCur.className = 'menuHigh';
    menuType = 'menuItem';
  }
  else if (tel.tagName == 'A' && tel.parentElement.className == 'menuSel') 
  { 
    menuCur = tel.parentElement; menuCur.className = 'menuHigh';
    menuType = 'menuSel';
  }

  
  // zobrazi popup menu
  if (menuCur != null)
  {
    // zlikviduj stare menu
    popupClear();

    if (popup != null)
    {
      var layer = document.all[popup];

      // treba pripocitat suradnice nadradenej tabulky
      layer.style.pixelLeft = lMargin + menuCur.offsetLeft - offset;
      layer.style.pixelTop = uMargin + menuCur.offsetTop + menuCur.offsetHeight;
      layer.style.display = "block";
      popupCur = popup;
    }
  }  
}

// mys opustila polozku menu
function menuOut()
{
  if (!isIE) return;
  var fel = event.fromElement;
  var tel = event.toElement;

  if (fel.tagName == 'TD')
  {
    fel.className = menuType; menuCur = null;
    popupOut();
  }
  else if (fel.tagName == 'A')
  {
    fel.parentElement.className = menuType; menuCur = null;
    popupOut();
  }
}

// cistenie stareho popup-menu
function popupClear()
{
  if (!isIE) return;
  if (popupCur != null)
  {
    var layer = document.all[popupCur];
    layer.style.display = "";
    popupCur = null;
  }
}

// mys opustila popu-menu
function popupOut()
{
  if (!isIE) return;
  var fel = event.fromElement;
  var tel = event.toElement;

  if (popupCur == null) return;

  // musi byt uplne mimo
  if (fel.className == 'popup') 
  {
    popupClear();
  }
  else
  {
    // hladaj nadriadenu triedu 'popup'
    while (tel != null)
    {
      if (tel.className == 'popup') break;
      tel = tel.parentElement;
    }
    if (tel == null)
    {
      popupClear();
    }
  }
}

function initArray() 
{
  this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++)
    this[i+1] = initArray.arguments[i];
}

function showImg(imgname, x, y)
{
  if (isIE) {x+=20; y+=23};
  var name="../images/"+imgname+".jpg";
  ops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width=" + x + ",height=" + y + "'");
  window.open(name, 'New1', ops);
  return;
}

function showAns(name)
{
  if (name==" ") return;
  name="ans/"+name+".htm";
  ops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=400,height=300,top=0,left=0'");
  window.open(name, "Ans", ops);
  return;
}

function show_faq(id)
{
  if (id==" ") return;
  name="faq1.php?id="+id;
  ops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width=400,height=300,top=0,left=0'");
  window.open(name, "faq", ops);
  return;
}


function showPage(name)
{
  //if (!isIE) return;
  ops = eval("'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes'");
  window.open(name,pageCnt++,ops);
  return;  
}

function newSite(url)
{
  if (isIE) navigate(url);
  else window.location=url;
}

function Validate_Trial(Theform) {

  if (Theform.firstname.value == "")
  {
    alert("Please fill out the First Name.");
    return false;
  }
  if (Theform.lastname.value == "")
  {
    alert("Please fill out the Last Name.");
    return false;
  }
   var str = Theform.email.value;
   var filter=/^.+@.+\..{2,3}$/
   if (!filter.test(str)){ 
       alert("Please fill out a valid email address.");
       return false; 
	}
	
   return true;
}


function validALogin(Theform)
{
	if(Theform.uname.value.length < 2){
		alert("Please enter Username.");
		Theform.uname.focus();
		Theform.uname.select();
		return false;
	}
	if(Theform.upass.value.length < 2){
		alert("Please enter Password.");
		Theform.upass.focus();
		Theform.upass.select();
		return false;
	}
	return true;
}


PositionX = 100;
PositionY = 100;

defaultWidth  = 500;
defaultHeight = 500;

var AutoClose = true;

if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;

function popImage(imageURL,imageTitle){
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
		writeln('<html><head><title>&Ccedil;&agrave;&eth;&aring;&aelig;&auml;&agrave;&iacute;&aring;...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
		writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
		writeln('width=100-(document.body.clientWidth-document.images[0].width);');
		writeln('height=100-(document.body.clientHeight-document.images[0].height);');
		writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["pic"].width;');writeln('window.innerHeight=document.images["pic"].height;}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
		if (!AutoClose) writeln('</head><body bgcolor=f9f9f9 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor=f9f9f9 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
		writeln('<img name="pic" src='+imageURL+' style="display:block"></body></html>');
		close();		
	}
}

//-->
