function rozmebaby(obj,backme){
	if(!obj)
		return false;
	if(backme){
		obj.className =	obj.className.replace(/rozdiv/g,'');
	}
	else{
		obj.className =	obj.className + ' rozdiv';	
	}
}
function select_wanted(index,valo){
	if($(index) && $(index).options){
		h = $(index);
		for (i = h.options.length - 1; i>=0; i--) {
			if (h.options[i].value == valo) {
				h.options[i].selected = true;
			}
			else{
				h.options[i].selected = false;
			}
		}
	}

}

function $(id){
	if(m = document.getElementById(id))
		return m;
	return false;
}

function $$(id){
	if(m = document.getElementById(id))
		return m.style;
	return false;
}


function changeOpac(opacity, id) {
var object = document.getElementById(id).style;object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 
function opacity(id, opacStart, opacEnd, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}
var recompop_w = null;
var printpop_w = null;

function open_pop(url,type) {
	if(type==1) {
		lungim = 437;
		inalt = 350;
		numepop = 'recompop';
		scgP = recompop_w;
	}
	else {
		lungim = 700;
		inalt = 450;
		numepop = 'printpop';
		scgP = printpop_w;
	}
/* centru*/
	if( !scgP || scgP.closed ) {
		pnt_n = 1;			
		scgP = window.open( url, ''+numepop+'', 'toolbar=0,scrollbars='+pnt_n+',location=0,statusbar=1,menubar=0,resizable=0,width='+lungim+',height='+inalt+',left = 40,top = 62' );
		scgP.focus();
	} else scgP.focus();
	
/* miscarea inversa */
	if(type==1) {
		recompop_w = scgP;
	}
	else {
		printpop_w = scgP;
	}
	
	
}


function printit() {
	printovici=(document.layers==1);
	print();
    if (printovici) window.close(); 
	
	return true;
	}
