// v2.0
function displayNo(actor) {
	document.getElementById(actor).style.display = 'none';
}
function displayGo(actor) {
	document.getElementById(actor).style.display = 'inline';
}
function changeInnerHTML(content_id, target_id) {
	//var tmp_innerHTML = document.getElementById(target_id).innerHTML;
	document.getElementById(target_id).innerHTML = document.getElementById(content_id).innerHTML;
}

loading1 = '<img src="img/loading1.gif" alt="" /><br /><small>&nbsp;se incarca...</small>';

var tabs1 = new Array(); // meniul din dreapta
tabs1['td_loginclienti'] = ''; // top right bottom left
tabs1['td_webmail'] = '';
tabs1['td_newsletter'] = '';
tabs1['loading'] = loading1; // definit ca sa aiba loading messages diferite pt mai mult control (idem mai jos, obviously)
var tabs2 = new Array(); // meniul de pe home page
tabs2['td_anunturialimentatie'] = ''; // top right bottom left
tabs2['td_stirialimentatie'] = '';
tabs2['loading'] = '<div style="text-align:center;padding-top:100px;padding-bottom:100px">'+loading1+'</div>';
function tabRestyle(tab_id,tabs) {
// tabRestyle(tab in use:id, tab_row:array)
	for (tab in tabs) {
		if (tab !== 'loading') { // exclude mesajul de loading
			if (tab == tab_id) {
				border = 'none';
				background = 'white url(img/bg_menuAjaxActiv.gif) repeat-x';
				cursor = 'default';
			}
			else {
				border = '1px solid #EDAD68';
				background = 'white url(img/bg_menuAjax.gif) repeat-x';
				cursor = 'pointer';
			}
			document.getElementById(tab).style.borderBottom = border;
			document.getElementById(tab).style.background = background;
			document.getElementById(tab).style.cursor = cursor;
		}
	}
}
// MultiBox(activ tab id,tab array,content id (pentru innerHTML), target (unde pune content))
function MultiBox(tab_id,tab_array,content_id,target_id) {
	tabRestyle(tab_id,tab_array);
	document.getElementById(target_id).innerHTML = tab_array['loading'];
	repaint = setTimeout ( "changeInnerHTML('"+content_id+"','"+target_id+"')", 500 );
	//changeInnerHTML(content_id, target_id);
}
function MultiBoxIni(tab_id,tab_array,content_id,target_id) {
	tabRestyle(tab_id,tab_array);
	changeInnerHTML(content_id,target_id);
	//changeInnerHTML(content_id, target_id);
}


var tabs3 = new Array(); // meniul de la detalii firma - no need to definesc tabs ca nu le restilizez
tabs3['loading'] = 'se incarca ...';
// MultiBox la detalii firma
//function MultiBox(tab_id,tab_array,content_id,target_id) {
function changeInnerHTMLloading(tab_array,content_id,target_id) {
	//tabRestyle(tab_id,tab_array);
	document.getElementById(target_id).innerHTML = tab_array['loading'];
	repaint = setTimeout ( "changeInnerHTML('"+content_id+"','"+target_id+"')", 500 );
	//changeInnerHTML(content_id, target_id);
}



var galleryON = '';
function LoadGallery(pictureName,imageFile,titleCaption,captionText,theImage,photoID) {
	var picture = document.getElementById(pictureName);
	if (picture.filters) {
		picture.style.filter="blendTrans(duration=0.5)";
		picture.filters.blendTrans.Apply();
	}
	picture.src = imageFile;
	if (picture.filters) {
		picture.filters.blendTrans.Play();
	}
	imgWidth = getImageWidth(document.getElementById(photoID).src);
	if ( imgWidth > 200 ) {
		document.getElementById(pictureName).width = '200';
	}
	//document.getElementById(titleCaption).innerHTML = captionText+'<br /><small style="color:#AAAAAA">'+theImage+'</small>';
	document.getElementById(titleCaption).innerHTML = captionText;
	document.getElementById('GalleryURL').href = theImage;
	
	document.getElementById(photoID).style.border = '1px solid black';
	if ( galleryON !== '' && galleryON !== photoID ) {
		document.getElementById(galleryON).style.border = '1px solid #CCCCCC';
	}
	galleryON = photoID;
}
	function LoadGalleryIni(s) {
		document.getElementById(s).style.border = '1px solid black';
		galleryON = s;
	}
function getImgSize(imgSrc) {
	var newImg = new Image();
	newImg.src = imgSrc;
	var height = newImg.height;
	var width = newImg.width;
	//alert ('The image size is '+width+'*'+height);
}
function getImageWidth(imgSrc) {
	var newImg = new Image();
	newImg.src = imgSrc;
	var width = newImg.width;
	return width;
}
