var ns4 = (document.layers)? true:false;
var ns6 = (document.getElementById)? true:false;
var ie4 = (document.all)? true:false;

function openDisclaimer() {
	openWin(317,300,'frames.php?frame=disclaimer.html');
}
function openSiteInfo() {
	openWin(350,300,'frames.php?frame=siteinfo/index.html');
}
function openInsider() {
	openWin(630,500,'insider/index.html');
}
function pshow(product) {
	MA_openWin('img','Products',317,298,'data/de/products/images/p_'+product+'.gif');
}
function MA_openWin(what,title,width,height,src) {
        var MAWin = window.open('scripts/MA_win.php?what='+what+'&src='+src+'&nazev='+title+'&width='+width+'&height='+height,'MAWin','left=50,top=50,width='+width+',height='+height+',toolbar=0,directories=0,menubar=0,status=no,resizable=0,location=0,scrollbars=0');
        MAWin.focus();
}

function openWin(width,height,src) {
	var Win = window.open(src,"Okno","left=20,top=20,width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=no,resizable=0,location=0,scrollbars=1");
        Win.focus();
}
function openFun(width,height,src) {
	var Win = window.open(src,"Okno","left=20,top=20,width="+width+",height="+height+",toolbar=0,directories=0,menubar=0,status=no,resizable=0,location=0,scrollbars=0");
	Win.focus();
}


function bookmark() {
  if (ie4) window.external.AddFavorite('http://www.onthetox', 'ROX Company');  
  else alert("Sorry. It's only for IE!");
};

function getObject(obj) {
        if (document.getElementById) {
                return document.getElementById(obj);
        } else if (document.all) {
                return document.all[obj];
        } else if (document.layers) {
                return document.layers[obj];
        }
}

function show(obj) {
	linkx = getObject('link' + obj);
//        img = eval("obra" + obj + ".src");
	img = "images/siteinfo/navigation/nav_" + obj + "_a.gif";
        linkx.src = img;
}
var active="who";
var clicked="none";
function hide(obj) {
	if ((active!=obj) || clicked!=active) {
	  linkx = getObject('link' + obj);
          img = "images/siteinfo/navigation/nav_" + obj + ".gif";
          linkx.src = img;
	}
}

function MA_submit(formobj) {
  if (formobj==1) formobj='nl_form';
  if (ns4 && formobj=='nl_form') document.layers['overDiv'].document.forms[formobj].submit();
  if (check(formobj)) document.forms['nl_form'].submit();
}
function check(formobj) {
        if (ns4) return true;
        switch (formobj) {
                case 'nl_form':
                var nl_email = getObject("nl_email").value;
		if (nl_email == "") {
                	alert ("\nEmail!");
                return false;
                }
                else return true;
		break;
                default:
                        alert("Nezmamy formular " + formobj);
                break;
        }
}


function submitform(form,action) {
  form.action.value=action;
  /*
        if (browser()=="msie")
    if (!validate(form)) return;
  */
  form.submit();
};

var aimgNum=-1;

function ImgChange(imgNum,imgSrc) {
  if (aimgNum==imgNum) return;
  document.images[imgNum].src = "images/"+imgSrc;
}

function ImgSet(imgNum)
{
  if (imgNum == aimgNum)
          return;

  switch(aimgNum)
  {
        case 2: document.images[2].src = "images/ann_btn.gif"; break;
    case 3: document.images[3].src = "images/download_btn.gif"; break;
        case 4: document.images[4].src = "images/ds_btn.gif"; break;
  }

  switch(imgNum)
  {
        case 2: document.images[2].src = "images/ann_btn_hi.gif"; break;
    case 3: document.images[3].src = "images/download_btn_hi.gif"; break;
        case 4: document.images[4].src = "images/ds_btn_hi.gif"; break;
  }

  aimgNum=imgNum;
}


