document.oncontextmenu=function(){ return false; }

if (top.frames.length!=0)
{
  if (window.location.href.replace)
    top.location.replace(window.location.href);
  else
    top.location.href=window.location.href;
}

var aktiv="no";
var nn="no";
var ns="no";
if (navigator.appName == "Netscape" && (navigator.appVersion.substring(0,3) >= 3.0))
  nn="yes";
if (navigator.appName == "Microsoft Internet Explorer" && (navigator.appVersion.substring(0,3) >= 4.0))
  nn="yes";


// obsługa cookie
var expDays = 7;
// number of days the cookie should last

//GetCookie
function gc(name)
{
  var startIndex = document.cookie.indexOf(name);
  if (startIndex != -1)
  {
   var endIndex = document.cookie.indexOf(";", startIndex);
   if (endIndex == -1) endIndex = document.cookie.length;
   return unescape(document.cookie.substring(startIndex+name.length+1, endIndex));
  }
  return "";
}

//SetCookie
function sc (name, value)
{
  var exp = new Date();
  exp.setTime(exp.getTime() + (expDays*60*60*1000));
  document.cookie = name + "=" + escape(value) + "; expires=" + exp.toGMTString();
}

//DeleteCookie
function dc(name)
{
  var exp = new Date();
  exp.setTime (exp.getTime() - 1);
  var cval = GetCookie (name);
  document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}


var qsParm = new Array();

function initArray()
{
  this.length = initArray.arguments.length;
  var name;
  for (var i = 0; i < this.length; i++)
  {
    //this[i] = initArray.arguments[i];
    name=initArray.arguments[i];
    var parms = name.split('?');
    var x = parms.length;
    if (x>1) this[i] = new Array();
    for (var j=0; j<parms.length; j++) {
      if (x>1) this[i][j] = parms[j];
      else this[i] = parms[j];
    }
  }
}

var current = 0;

//read query string
function qs()
{
  var query = window.location.search.substring(1);
  var parms = query.split('&');
  for (var i=0; i<parms.length; i++) {
   var pos = parms[i].indexOf('=');
   if (pos > 0) {
      var key = parms[i].substring(0,pos);
      var val = parms[i].substring(pos+1);
      qsParm[key] = val;
      }
   }
}

function qc(value)
{
 sc('img',value);
}

function qsi()
{
  current = 0;
  qsParm['img'] = null;
  qs();
  if (qsParm['img']) current = parseInt(qsParm['img']);
  else current = parseInt(gc('img'));
  if (!picz[current]) current=0;
  if (!picz[current][0])
    document.jscriptimg.src  = picz[current];
  else {
    document.jscriptimg.src  = picz[current][0];
    findObj("op").value = picz[current][1];
  }


}

var idTimer;
function onTimer(name)
{
  document.location.replace(name);
  window.clearInterval(idTimer);
}

function checkIt(vals)
{
  var val = parseInt(vals);
  if (!current)
    current = 0;

  var goodnum = current+val;
  if (goodnum < 0)
    goodnum = picz.length-1;
  else
    if (goodnum > picz.length-1)
      goodnum = 0;
    else
    {
      if (!picz[goodnum][0])
        document.jscriptimg.src = picz[goodnum];
      else {
        document.jscriptimg.src = picz[goodnum][0];
        findObj("op").value = picz[goodnum][1];
      }
      current = goodnum;
    }
}

function wn(name)
{
  idTimer = window.setInterval( "onTimer(\"http://www.stemplenadruki.com/oferta/" + name + "\")" ,100);
}

function writeNext(name)
{
  idTimer = window.setInterval( "onTimer(\"http://www.stemplenadruki.com/oferta/" + name + "\")" ,100);
}

function i_url()
{
  var dt = new Date(), u = new String();
  s = window.screen;
  u += 'ts='+dt.getTime();
  if(window.screen) u += '&scr='+s.width+'x'+s.height+'&colorbit='+s.colorDepth;
  if ((navigator.plugins && navigator.plugins['Shockwave Flash']) ||
    (navigator.appName.indexOf('Microsoft') != -1 &&
     navigator.appVersion.indexOf('Mac') == -1 &&
     navigator.appVersion.indexOf('3.1') == -1)) var f=1;
  if(navigator.javaEnabled()) var j=1;
    u += '&f='+f+'&j='+j;
  if(document.all || document.layers) u += '&java='+navigator.javaEnabled();
  return u;
}

function wf()
{
document.write('<img src="http://stat.stemp'+'lenadruki.com/stat1/cr'+'on.php?ref=1&idref='+escape(document.referrer)+'&idcur='+escape(document.location)+'&'+i_url()+'" border=0 width=1 height=1>');
}

function writeFooter()
{
document.write('<img src="http://stat.stemp'+'lenadruki.com/stat1/cr'+'on.php?ref=1&idref='+escape(document.referrer)+'&idcur='+escape(document.location)+'&'+i_url()+'" border=0 width=1 height=1>');
//document.write("<STYLE type='text/css'> DI"+"V {dis"+"play: n"+"one;}</STYLE>");
}

function findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document;
  if( parent.frames.length && (p=n.indexOf("?"))>0)
  { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.getElementById) x=d.getElementById(n);
  if(!x && !(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=findObj(n,d.layers[i].document);   return x;
}

var idLocate;
var maxObj=false;

function locateObj(objName, disab, maxwidth) {

  if (idLocate){window.clearInterval(idLocate);}
  var s=window.screen;
  var ax=findObj(objName);
  var abso=false;
  if (objName=='loc2'){
    abso=true;
  }
  
  if(ax){
    if(s.width<1024){
      if (document.all || document.getElementById){
        if (!disab){
          ax.style.position="absolute";
          ax.style.width="625px";
          if(s.width<650){ 
            ax.style.left = 0;
          }
        } else {
		  if (!abso) {
            ax.style.position="relative";
            ax.style.width="100%";
		  }	else {
			ax.style.position="absolute";
			ax.style.width="67%";
		  }
        }
      } else if (document.layers){
          if (!disab) {
            ax.position="absolute";
            ax.style.width="625px";
            if(s.width<650){ 
              ax.left = 0;
            }
          } else {
		  if (!abso) {
            ax.style.position="relative";
            ax.style.width="100%";
		  }	else {
			ax.style.position="absolute";
			ax.style.width="67%";
		  }
          }
      }
    } else if(s.width<1285/*1424*/){
        if (document.all || document.getElementById) {
          if (!disab) {
            ax.style.position="absolute";
            if (maxwidth){
              ax.style.width = maxwidth;
            } else {
              //ax.style.width ="1024px";
			  ax.style.width ="970px";
            }
            if(s.width<975/*1030*/) {
              ax.style.left = 0;
            }
          } else {
			  if (!abso) {
				ax.style.position="relative";
				ax.style.width="100%";
			  }	else {
				ax.style.position="absolute";
				ax.style.width="67%";
			  }
          }
        } else if (document.layers) {
            if (!disab) {
              ax.position="absolute";
              if (maxwidth) {
                ax.style.width=maxwidth;
              } else {
                //ax.style.width="1024px";
				ax.style.width ="970px";
              }
              if (s.width<975/*1030*/) {
                ax.left = 0;
              }
            } else {
			  if (!abso) {
				ax.style.position="relative";
				ax.style.width="100%";
			  }	else {
				ax.style.position="absolute";
				ax.style.width="67%";
			  }
            }
        }
    }
  }
}

function delocateObj(objName)
{
  idLocate = window.setInterval( "locateObj(\"" + objName + "\",\"hide\")" ,1000);
}

function writeMail(name)
{
document.write('<a href="mailto:'+name+'@stemplenadruki.com"><b>'+name+'@stemplenadruki.com</b></a>');
}





