function showhideRow(){ var theRow = $('rowShowHide'); if (theRow.style.display == 'block') { theRow.style.display = 'none'; } else { theRow.style.display = 'block'; } }
var test = function() { alert("test"); }
var loadAccordionsV_new = function(index,defaut){
	var bottomAccordion = new accordion('vertical_container'+index);
	bottomAccordion.activate($$('#vertical_container'+index+' .accordion_toggle')[defaut]);
	var verticalAccordions = $$('.accordion_toggle'); verticalAccordions.each(function(accordion) { $(accordion.next(0)).setStyle({ height: '0px' }); });
}
var getLeft = function(element) {
	var left = 0, absoluteAncestor = false, computedStyle = (document.defaultView && document.defaultView.getComputedStyle), currentStyle = (element.currentStyle);
	while (element.offsetParent) {
		left += element.offsetLeft
		element = element.offsetParent;
		if (currentStyle && element.currentStyle.hasLayout && element.nodeName.toLowerCase() != 'html') {
			left += element.clientLeft;
			if (element.currentStyle['position'] == 'absolute') absoluteAncestor = true;
		} else if (computedStyle && document.defaultView.getComputedStyle(element, "").getPropertyValue('position') == 'absolute') {
			left += parseInt(document.defaultView.getComputedStyle(element, "").getPropertyValue('border-left-width'));
		absoluteAncestor = true;
		}
	}
	if (!absoluteAncestor && currentStyle) return left += document.getElementsByTagName('BODY')[0].offsetLeft;
	else if (!absoluteAncestor && computedStyle) return left += parseInt(document.defaultView.getComputedStyle(document.getElementsByTagName('BODY')[0], "").getPropertyValue('border-left-width'));
}
var getTop = function(element) {
	var top = 0, absoluteAncestor = false, computedStyle = (document.defaultView && document.defaultView.getComputedStyle), currentStyle = (element.currentStyle);
	while (element.offsetParent) {
		top += element.offsetTop
		element = element.offsetParent;
		if (currentStyle && element.currentStyle.hasLayout && (element.nodeName.toLowerCase() != 'html')) {
			top += element.clientTop;
			if (element.currentStyle['position'] == 'absolute') absoluteAncestor = true;
		} else if (computedStyle && document.defaultView.getComputedStyle(element, "").getPropertyValue('position') == 'absolute') {
			top += parseInt(document.defaultView.getComputedStyle(element, "").getPropertyValue('border-top-width'));
			absoluteAncestor = true;
		}
	}
	if (!absoluteAncestor && currentStyle) return top += document.getElementsByTagName('BODY')[0].offsetTop;
	else if (!absoluteAncestor && computedStyle) top += parseInt(document.defaultView.getComputedStyle(document.getElementsByTagName('BODY')[0], "").getPropertyValue('border-top-width'));
	return top;
}
var getZone = function() {
	if ($('coldata')) {
		$('coldata').style.visibility = 'hidden'; $('coldata').style.display = 'none';
		moveZone();
	}
}
var moveZone = function(str) {
	if ($('coldata')) {
		var agent = navigator.userAgent.toLowerCase();
		//if (agent.indexOf("msie") != -1) { $('coldata').style.top = (getTop($('row1'))+25)+"px"; } else { $('coldata').style.top = ($('row1').offsetTop+25)+"px"; }
		if (agent.indexOf("msie") != -1) { $('coldata').style.top = (getTop($('row1'))+85)+"px"; } else { $('coldata').style.top = ($('row1').offsetTop+85)+"px"; }
		if (agent.indexOf("msie") != -1) { $('coldata').style.left = (getLeft($('row1'))+145)+"px"; } else { $('coldata').style.left = ($('row1').offsetLeft+145)+"px"; }
	}
}
var showHiddenData = function(){
	if ($('coldata')) {
		if ($('linkClose')) { $('linkClose').remove(); }
		//$('coldata').innerHTML = '<a id="linkClose" href="javascript:hideHiddenData();"><p class="closeCase">&nbsp;</p></a><div class="dataContainer">' + $('coldata').innerHTML+'</div>';
		$('coldata').innerHTML = '<a class="close" href="javascript:hideHiddenData();">Close</a><div class="dataContainer"><p id=closeBtn><a href="javascript:hideHiddenData();">Close</a></p>' + $('coldata').innerHTML+'</div>';
		$('coldata').style.visibility = 'visible'; $('coldata').style.display = 'block';
	}
}
var hideHiddenData = function(){
	if ($('coldata')) {
		$('coldata').style.visibility = 'hidden'; $('coldata').style.display = 'none';
	}
}

/* Shadow Box */
var openShadowBox = function(url,width,height,title){
	Shadowbox.init();
	
	Shadowbox.open({
		player:		'iframe',//'html',
		title:		title,
		//content:	'http://www.google.fr',//strBox+strMap,
		//content:	'http://crt-poitoucharentes.thetheme.com/index.php?id=598',
		content:	url,
		width:		width,
		height:		height
	}/*,{ onFinish: function() {
			$('eritMap').hide();
			new Ajax.Request('<?php //echo $_SESSION['acwviewpath']; ?>loadPhotos.php', {method:'post', parameters:'fiche='+idFiche, onSuccess:handlerFunc2});
		}
	}*/);
}