

if (top.location != document.location)
	top.location = document.location;

function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) // if too long...trim it!
	{
		field.value = field.value.substring(0, maxlimit);
	}
	// otherwise, update 'characters left' counter
	else 
	{
		countfield.value = maxlimit - field.value.length;
	}
}

function getBody(){
	if(document.compatMode && document.compatMode!="BackCompat"){
		return document.documentElement;
	}else{
		return document.body;
	}
}
function showDetails( e, name, IDArma,IDVitrine, Details,Cat  ){
	document.getElementById( "bubble" ).style.visibility = "visible";
	//alert(document.documentElement.scrollTop);
	document.getElementById( "bubble" ).style.left = ( e.clientX - 10  ) + "px";//- 23 + getBody().scrollLeft ) + "px";
	document.getElementById( "bubble" ).style.top = ( e.clientY + 15  )  + "px";//- 185 + getBody().scrollTop )  + "px";
	if (IDArma=='-1' || IDArma=='0')
	    document.getElementById( "name" ).innerHTML = "";
	else
	    document.getElementById( "name" ).innerHTML = "<img style='width:192px;' src='Images_Stores/store_arma_" + IDArma + ".jpg' alt='' />";//name;
	if (IDVitrine=='-1')
	    document.getElementById( "type" ).innerHTML = "<table style='height:80px;' align='center'><tr><td><img src='Images_Stores/StoreCat" + Cat + ".png' alt='' /></td></tr></table>";
	else
	    document.getElementById( "type" ).innerHTML = "<img style='width:192px;' src='Images_Stores/store_vitrine_" + IDVitrine + ".jpg' alt='' />";
	var str='';
	str=str +'<table style="width:100%;">';
	str=str +'<tr><td class="StorePopUpBallonName">'+name+'</td><td style="text-align:right;"><img style="width:15px;" src="Images/logo.png" alt="" /></td></tr>';
	str=str +'<tr><td class="StorePopUpBallonCategory">'+Cat+'</td><td style="text-align:right;"><img style="width:15px;" src="Images_Stores/StoreCat' + Cat + '.png" alt="" /></td></tr>';
	str=str +'<tr><td colspan="2" class="StorePopUpBallonDetails">'+Details+'</td></tr>';
	str=str +'</table>';
	
	document.getElementById( "score" ).innerHTML = str;
	//$("#bubble").animate({opacity: '0'},"fast");
	//alert("<img src='images/store_arma_" + type + ".jpg' />");
    $("#bubble").stop().animate({opacity:'0.9'},'fast');
}


function hideDetails(){
//	document.getElementById( "bubble" ).style.left = "0px";
//	document.getElementById( "bubble" ).style.top = "0px";
	document.getElementById( "bubble" ).style.visibility = "hidden";
    $("#bubble").stop().animate({opacity:'0'},'fast');
}

