function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function preloadImages() {
var BaseSite = "images/menu/";
	if (document.images) {
		index_over = newImage(BaseSite + "index-act.gif");
		overview_over = newImage(BaseSite + "overview-act.gif");
		features_over = newImage(BaseSite + "features-act.gif");
		download_over = newImage(BaseSite + "download-act.gif");
		order_over = newImage(BaseSite + "order-act.gif");
		contact_over = newImage(BaseSite + "contact-act.gif");
		forum_over = newImage(BaseSite + "forum-act.gif");
BaseSite = "images/";
		de_over = newImage(BaseSite + "de-act.gif");
		ru_over = newImage(BaseSite + "ru-act.gif");
		preloadFlag = true;
	}
}



function SetActiveMenu() {
preloadImages();	
sLocation = new String(unescape(document.location));
if (sLocation.lastIndexOf('/') < sLocation.lastIndexOf('.')) {
  sMenuName = new String(sLocation.substring(sLocation.lastIndexOf('/') + 1, sLocation.lastIndexOf('.')));
}
else
  sMenuName = new String('index');  
  for (var I=0; I<document.images.length; I++) {
    if (sMenuName == document.images[I].name) {
      document.images[I].src = 'images/menu/' + document.images[I].name + '-act.gif';
      break;
    }
  }
} 

function MouseToMenu(menuname, mouseout) {
sLocation = new String(unescape(document.location));
if (sLocation.indexOf(menuname.name + '.html') > 1) {
  return;
} 
   if (mouseout) 
     menuname.src = 'images/menu/' + menuname.name + '.gif';
   else
     menuname.src = 'images/menu/' + menuname.name + '-act.gif';
}

function MouseToLang(langname, mouseout) {
   if (mouseout) {
     langname.src = 'images/' + langname.name + '.gif';
     langname.height = 14;
   }  
   else {
     langname.src = 'images/' + langname.name + '-act.gif';
     langname.height = 19;
   }  
}

function ChangeDomain(newdomain) {
  sLocation = new String(unescape(document.location));
  if (sLocation.indexOf('://www.') == -1) {
  	sLocation = 'http://www.' + sLocation.substring(sLocation.indexOf('//') + 2, sLocation.length);
  }
  sDocument = new String(sLocation.substring(sLocation.lastIndexOf('/') + 1, sLocation.length));
  domainname = new String (sLocation.substring(sLocation.indexOf('.') + 1, sLocation.length));
  domainname = domainname.substring(0, domainname.indexOf('.'));
  //if (newdomain =='de' )
//    sLocation = '/mt/mt/mv.pl?friend=http://www.' + domainname + '.' + newdomain + '/';
//  else
    sLocation = '/mt/mt/mv.pl?friend=http://www.' + domainname + '.' + newdomain + '/' + sDocument;
  window.location = sLocation;
}
