<!--

//-----------------------START-----------------------------------
// No right click

am = "(c) Torvela";
bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"

function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}

document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;
//
//-----------------------END----------------------------------------

//-----------------------START--------------------------------------
//disable text select

//form tags to omit in NS6+:
var omitformtags=["input", "textarea", "select"]

omitformtags=omitformtags.join("|")

function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}

function reEnable(){
return true
}

if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
//
//-----------------------END-----------------------------------------

function MM_preloadImages() { //v3.0
  var d=document;
  if(d.images){
     if(!d.MM_p) d.MM_p=new Array();
     var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
     for(i=0; i<a.length; i++)
     if (a[i].indexOf("#")!=0){
        d.MM_p[j]=new Image;
        d.MM_p[j++].src=a[i];
        }
     }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//
// Open centered window
//
function open_wnd(exp_bar,width,height,url) {
  winName = "_blank";
  theURL = 'http://'+url;
  //theURL = url;
  page_height = (height != '')?height:600;
  page_width = (height != '')?width:500;
  toolbar = (exp_bar == 1)?'yes':'no';
  page_top = Math.round((screen.height-page_height)/2);
  page_left = Math.round((screen.width-page_width)/2);
  size = "width="+page_width+",height="+page_height+",top="+page_top+",left="+page_left;
    features = 'status=yes,toolbar='+toolbar+',scrollbars=yes,resizable=yes,'+size;
    //var newWnd = null;
    //alert(theURL);
    window.open(theURL,winName,features);
    //newWnd.focus();
}
function open_wnd2(width,height,url) {
  winName = "_blank";
  theURL = url;
  //theURL = url;
  page_height = (height != '')?height:600;
  page_width = (height != '')?width:500;
  //toolbar = (exp_bar == 1)?'yes':'no';
  page_top = Math.round((screen.height-page_height)/2);
  page_left = Math.round((screen.width-page_width)/2);
  size = "width="+page_width+",height="+page_height+",top="+page_top+",left="+page_left;
    features = 'status=yes,toolbar=no,scrollbars=yes,resizable=yes,'+size;
    //var newWnd = null;
    //alert(theURL);
    window.open(theURL,winName,features);
    //newWnd.focus();
}
function open_wnd3(width,height,url) {
  winName = "_blank";
  theURL = url;
  //theURL = url;
  page_height = (height != '')?height:600;
  page_width = (height != '')?width:500;
  //toolbar = (exp_bar == 1)?'yes':'no';
  page_top = Math.round((screen.height-page_height)/2);
  page_left = Math.round((screen.width-page_width)/2);
  size = "width="+page_width+",height="+page_height+",top="+page_top+",left="+page_left;
    features = 'status=yes,toolbar=no,scrollbars=no,resizable=no,'+size;
    //var newWnd = null;
    //alert(theURL);
    window.open(theURL,winName,features);
    //newWnd.focus();
}
function add_kaina(element_id)
{
  var nr = parseInt(getNr());
  var next = nr+1;
  document.getElementById(element_id+nr).innerHTML="<table width=100% border=0 cellpadding=3 cellspacing=1 bgcolor=#333333 class=.box><tr><td width=132 height=30 bgcolor=#666666><b><font color=#FFFFFF>Kaina #"+next+":</font></b></td><td bgcolor=#CCCCCC><input type=text name=kainos["+nr+"][kaina] style=width:100px; MAXLENGTH=10> Lt <input type=text name=kainos["+nr+"][ismatavimai]></td></tr></table><div id=kaina_slot_"+next+"></div>";
  setNr(next);
}


function setNr(nr)
{
  setCookie('conNr',nr);
}

function clearNr(kiekis)
{
   if(kiekis=='false')
   {
      deleteCookie('conNr');
   }else{
      setNr(kiekis);
   }
}

function getNr()
{
  if(getCookie('conNr')!=null)
  {
    return getCookie('conNr');
  }else{
    return 1;
  }
}

function setCookie(name, value) {
  var curCookie = name + "=" + escape(value);
  document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}


function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function shouldset(passon){
if(document.getElementById('hexvalue').value.length == 7){setcolor(passon)}
}

function setcolor(elem){
document.getElementById('hexvalue').value=elem
document.getElementById('selcolor').style.backgroundColor=elem
}

function del_element(element)
{
  document.getElementById(element).innerHTML="";
    document.getElementById(element).style.display="none";
}

//-->
