//***************************************
//         DESIGN BY INTELLIGENCE-SOFT Ltd
//         design by Lebedev Anton
//         e-mail: lebedev@intsoft.spb.ru
//         http://www.intsoft.spb.ru                             
//         info@intsoft.spb.ru                                      
//         studio@intsoft.spb.ru                                    
//         St.Petersburg, Russia                                   
//         02/01/2001                                                 
//***************************************

//***************************************
//      Definition type browser
//***************************************

if (navigator.appName.indexOf('Microsoft')>=0)
    { var msie=true }
  else
    { var msie=false };

//***************************************
//      Pop up window
//  i=number picture
// Group=name catalogue
// Width&Height=beat pop up window
//               
//***************************************
function explain(i,Group,Width,Height) {
    var fileName = Group + "/" + i + ".html";
    var features = "width=" + Width + ",height=" + Height + ",menubar=no,scrollbars";
    window.open(fileName,"explWin",features);
                  }

//***************************************
//      Menu
//***************************************
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {

		clan_over = newImage("http://clan-0.com/-0site/images/clan-over.gif");
		battlezone_over = newImage("http://clan-0.com/-0site/images/BattleZone-over.gif");
		hack_over = newImage("http://clan-0.com/-0site/images/hack-over.gif");
		hall_over = newImage("http://clan-0.com/-0site/images/hall1-over.gif");
		home_over = newImage("http://clan-0.com/-0site/images/home-over.gif");
		e_mail_over = newImage("http://clan-0.com/-0site/images/email-over.gif");
                join_over = newImage("http://clan-0.com/-0site/images/join-over.gif");
		rules_over = newImage("http://clan-0.com/-0site/images/rules-over.gif");
		RankSystem_over = newImage("http://clan-0.com/-0site/images/RankSystem-over.gif");
		guestbooook_over = newImage("http://clan-0.com/-0site/images/guestbooook-over.gif");
		downloads_over = newImage("http://clan-0.com/-0site/images/downloads-over.gif");
		Members_over = newImage("http://clan-0.com/-0site/images/Members-over.gif");
		allies_over = newImage("http://clan-0.com/-0site/images/allies-over.gif");
		enemies_over = newImage("http://clan-0.com/-0site/images/enemies-over.gif");
		ShitList_over = newImage("http://clan-0.com/-0site/images/ShitList-over.gif");
		gb_over = newImage("http://clan-0.com/-0site/images/menu-down-on.gif");

		preloadFlag = true;
	}
}


function CloseIt() {
self.close();
opener.focus();
}


//***************************************
//      Mini Scroll
//***************************************


var w3c = (document.getElementById) ? 1:0
var ns4 = (document.layers) ? 1:0
var ie4 = (document.all) ? 1:0

var range = "";
var cap = "";
var mutex = 0;
var yplace = 0;
var ymax = 0;
var ymin = 0;
var xplace = 0;
var newsHeight = 0;

/** The only code you should ever need to change here are the following 3 vars **/
var speed = 5;                         //speed at which the news scrolls
var newsId = "news";                   //name of the overall news div
var newsClipId = "newsClipping";       //name of the news clipping div

function redrawScreen() {
  location.reload();
  return false
}

function shiftTo(obj, x, y) {
  if (w3c) {
    obj.style.left = x + "px";
    obj.style.top = y + "px";
  }
  else if (ns4) {
	 obj.moveTo(x,y);
  } 
  else if (ie4) {
    obj.style.pixelLeft = x;
	obj.style.pixelTop = y;
  }
}

function getObject(obj) {
	var theObj = eval("document." + range + obj + cap);
	return theObj;
} 

function scrollUp() {
  if (mutex == 1){
    var theObj = getObject(newsId);
    if (yplace < ymax) {
      yplace = yplace + speed;
      if (yplace > ymax) yplace = ymax;
      shiftTo(theObj, xplace, yplace);
      setTimeout("scrollUp()",25);
    }
  }
}
  
function scrollDown() {
  if (mutex == 2){
    var theObj = getObject(newsId);
    if (yplace > ymin) {
      yplace = yplace - speed;
      if (yplace < ymin) yplace = ymin;
      shiftTo(theObj, xplace, yplace);
      setTimeout("scrollDown()",25);
    }
  }
}

function scrollIt(msg, dir) {
  window.status = msg; 
  mutex = dir;
  if (mutex == 1) scrollUp();
  else if (mutex == 2) scrollDown();
}

function init() {
  if (w3c) {
    range = "getElementById(\"";
    cap = "\")";
    theObj = getObject(newsClipId);
    newsHeight = parseInt(theObj.offsetHeight);
    theObj = getObject(newsId);
    ymin = (parseInt(theObj.offsetHeight) - newsHeight) * -1;
  }
  else if (ns4) {
    window.captureEvents(Event.RESIZE);
    window.onresize = redrawScreen;
    theObj = getObject(newsClipId);
    newsHeight = theObj.clip.height;
    newsId = newsClipId + ".document." + newsId;
    theObj = getObject(newsId);
    ymin = (theObj.clip.height - newsHeight) * -1;
  }
  else if (ie4) {
    range = "all.";
    theObj = getObject(newsClipId);
    newsHeight = theObj.offsetHeight;
    theObj = getObject(newsId);
    ymin = (theObj.offsetHeight - newsHeight) * -1;
  }
}
// END OF LINE
