/************************************************************************
* modulusTOOLS v2.0														*
* ===================================================================== *
* Copyright (c) 1996-2005 by Modulus Sp. z o.o.							*
* modulus.pl, modulusdesign.de											*
*																		*
************************************************************************/

// mT CONFIG
/*
styleAlt1 = Styl 1 - menu na dole;
styleAlt2 = Styl 2 - menu na grze;
styleAlt3 = Styl 3 - menu z boku;
styleAlt4 = Styl 4 - menu na dole;
styleAlt5 = Styl 5 - menu na grze;
styleAlt6 = Styl 6 - menu z boku;
styleAlt7 = Styl 7 - menu na dole;
styleAlt8 = Styl 8 - menu na grze;
styleAlt9 = Styl 9 - menu z boku;
startAlt  = Ustaw jako strone startowa;
bmAlt     = Dodaj do ulubionych;
tellAlt   = Powiadom znajomego;
*/

var siteUrl   = "http://codemanipulator.com/";
var bmName    = "CODEMANIPULATOR";

mtoolsYOffset = 20;
mtoolsXOffset = 971;
mtoolsStayTop = 100;
mtoolsSpeed = 20;
mtoolsFloat = "yes";
mtoolsLeft = "yes";

// mT CONFIG eof



// mT FUNCTIONS
// mT float
mTools();

function Float() {
var scrOfY = 0;
if( typeof( window.pageYOffset ) == 'number' ) {
  //Netscape compliant
  scrOfY = window.pageYOffset;
} else if( document.body && document.body.scrollTop ) {
  //DOM compliant
  scrOfY = document.body.scrollTop;
  } else if( document.documentElement && document.documentElement.scrollTop ) {
  //IE6 standards compliant mode
  scrOfY = document.documentElement.scrollTop;
}

if( scrOfY != lastY && scrOfY > mtoolsYOffset - mtoolsStayTop ) {
  smooth = .2 * ( scrOfY - lastY - mtoolsYOffset + mtoolsStayTop );
} else if( mtoolsYOffset - mtoolsStayTop + lastY > mtoolsYOffset - mtoolsStayTop ) {
  smooth = .2 * ( scrOfY - lastY - ( mtoolsYOffset - ( mtoolsYOffset - scrOfY ) ) );
  } else { smooth = 0;
}
if( smooth > 0) smooth = Math.ceil(smooth);
  else smooth = Math.floor(smooth);
  mtools.top = parseInt(mtools.top) + smooth + "px";
  lastY = lastY + smooth;
  setTimeout('Float()', 1)}

mtools=document.getElementById('modulus-tools').style;
if( mtoolsFloat == "yes" ) Float();

// mT float eof

// mT stylechooser
function setActiveStyleSheet(title) {
  var i, a, main;
  for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if (a.getAttribute("rel") &&
        a.getAttribute("rel").indexOf("style") != -1 &&
        a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) a.disabled = false;
    }
  }
}

function getActiveStyleSheet() {
  var i, a;
  for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if (a.getAttribute("rel") &&
        a.getAttribute("rel").indexOf("style") != -1 &&
        a.getAttribute("title") &&
        !a.disabled
        ) return a.getAttribute("title");
  }
  return null;
}

function getPreferredStyleSheet() {
  var i, a;
  for (i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if (a.getAttribute("rel") &&
        a.getAttribute("rel").indexOf("style") != -1 &&
        a.getAttribute("rel").indexOf("alt") == -1 &&
        a.getAttribute("title")
        ) return a.getAttribute("title");
  }
  return null;
}

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
// mT stylechooser eof

// mT bookmark
function addbookmark(bookmarkurl,bookmarktitle){
if (document.all)
window.external.AddFavorite(bookmarkurl,bookmarktitle)
}
// mT bookmark eof

// mT popup
function popupWindow(url) {
  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=404,height=445,screenX=50,screenY=50,top=50,left=50')
}
// mT popup eof
// mT FUNCTIONS eof


// mT DIV
function mTools() {
document.write('<div id="modulus-tools" style="z-index: 8900; background-color: transparent; position: absolute; margin-left:971px; top: 60px; width: 16px; height: 200px');
/* if( mtoolsLeft == "yes" ) document.write('left: '+mtoolsXOffset+'px;'); ...(was the 384px) */
document.write('">');
if (navigator.mimeTypes){
document.write('<div id="modulus-tools2"> \n' +
'<ul> \n' +
'<li><a href="javascript:setActiveStyleSheet(\'style1\');" class="mt-s1" title="style1"> </a></li> \n' +
'<li><a href="javascript:setActiveStyleSheet(\'style2\');" class="mt-s2" title="style2"> </a></li> \n' +
'<li><a href="javascript:setActiveStyleSheet(\'style3\');" class="mt-s3" title="style4"> </a></li> \n' +
'</ul></div>');
}
document.write('</div>');
lastY=0;
}
// mT DIV eof

// modulusTOOLS EOF
