/*
* Project: SNA
* File: functions.js
* Description: Contine niste functii care schimba buttoanele cand trec peste ele cu mousul
* Company: Aliat.net
* Created: April, 07 2004 by Péter Zsolt
* Modified: April, 07 2004 by Péter Zsolt
* Comments:
*/
//locul imaginelor care alcatuiesc meniul din partea stanga
var menuImg = "./img/common/menu/";


var imgNames = new Array("brat","home","introducere","structura","regulament","termene","metodologie","livrari","chestionar","intrebari","contact","sesizari");

var numImgs = imgNames.length;

var imgsOff = new Array(numImgs);
var imgsOn = new Array(numImgs);

var flag = false;

function preload() {
	if(document.images) {
	    for(var i = 0 ; i < numImgs ; i++) {
	        if (imgNames[i] == "brat") {
 	            imgsOff[i] = new Image();
 	            imgsOff[i].src = "./img/common/header/"+ imgNames[i] + "_off.gif";
 	            imgsOn[i] = new Image();
 	            imgsOn[i].src = "./img/common/header/"+ imgNames[i] + "_on.gif";
            } else {
                imgsOff[i] = new Image();
       	        imgsOff[i].src = menuImg + imgNames[i] + "_off.gif";
	            imgsOn[i] = new Image();
	            imgsOn[i].src = menuImg + imgNames[i] + "_on.gif";
	        }
	    }
        flag=true;
    }
}

function rollOn(index) {
//alert(imgsOff);
	if (document.images && flag) {
//	alert(imgNames[index] + '    index=' + index + '\n' + 'filename: ' + document.images[imgNames[index]].src);
    document.images[imgNames[index]].src = imgsOn[index].src;
  }
}

function rollOff(index, selected){
  if (document.images && flag) {
      if (selected != 1) {
          document.images[imgNames[index]].src = imgsOff[index].src;
      }
  }
}

function openCifre(id, index, currentSelect) {
    var indexPer = currentSelect.options[currentSelect.selectedIndex].value;
    document.location = "index.php?page=publications&id="+id+"&index="+index+"&indexPer="+indexPer;
}
var resetRolls = new Object();

function resetimage(src) {
    this.src=src;
    this.confirm=true;
    this.alt="Reset";
    this.write=resetimage_write;
}

function resetimage_write() {
    document.write('<A ');
    if (this.rollover) {
        if (! this.name) {
            return;
        }
        resetRolls[this.name] = new Object();
        resetRolls[this.name].over = new Image();
        resetRolls[this.name].over.src=this.rollover;
        resetRolls[this.name].out = new Image();
        resetRolls[this.name].out.src=this.src;
        document.write(' onMouseOver="if (document.images)document.images[\'' + this.name + '\'].src=resetRolls[\'' + this.name + '\'].over.src"' + ' onMouseOut="if (document.images)document.images[\'' + this.name + '\'].src=resetRolls[\'' + this.name + '\'].out.src"');
    }
    document.write(' HREF="javascript:');
    if (this.confirm)
        document.write('if(confirm(\'Are you sure you want to reset?\'))');
    document.write(
            'document.forms[' + 
            (document.forms.length - 1) + '].reset();void(0);">');
    document.write('<IMG SRC="' + this.src + '" ALT="' + this.alt + '"');
    document.write(' BORDER=0');
    if (this.name)document.write(' NAME="' + this.name + '"');
    if (this.height)document.write(' HEIGHT=' + this.height);
    if (this.width)document.write(' WIDTH=' + this.width);
    if (this.otheratts)document.write(' '+ this.otheratts);
    document.write('></A>');
}
//-->

