// common.js

//common functions
function fade(id,koef){
var objid = id;
if(op>100) op = 100;
if(op<0) op = 0;
if(browser=="IE"){
    dis(id).filter = "alpha(opacity="+(op+os)+")";
}else{
    dis(id).opacity = (op+os)/100;
}
op = op+os*koef;
if(op<=100 && op>=0) window.setTimeout("fade('"+objid+"','"+koef+"');",ts);
if(op==0) dis(id).display = mo[0];
}

function roll(id,koef){
var objid = id;
var exp = 'refExpand'+id;
var txt = 'refTxt'+id;
var hmax = refExpMaxHeight[id];
var hmin = refExpBaseHeight[id];
var hdif = hmax - hmin;

if(op>100) op = 100;
if(op<0) op = 0;
phs = hmin+(op/100)*hdif;
dis(exp).height = phs+'px';
op = op+os*koef;
if(op<=100 && op>=0) window.setTimeout("roll('"+objid+"','"+koef+"');",ts);
if(op==0){ dis(exp).display = mo[0]; dis(txt).display = mo[1]; }
}


function did(id){
if(document.getElementById(id)){
return document.getElementById(id);
}
}

function dis(id){
if(document.getElementById(id)){
return document.getElementById(id).style;
}
}

function dit(id){
if(document.getElementsByTagName(id)){
return document.getElementsByTagName(id);
}
}

function dif(el,form){
//if(document.forms[form].elements[el]){
return document.forms[form].elements[el];
//}
}
