var dom = (document.getElementById)? true:false;
var ie = (document.all)? true:false; 
var agt=navigator.userAgent.toLowerCase();
var Opera = (agt.indexOf("opera") != -1);

var tID='';
var tempo = 500;
var objEncours = false;
var tabSelect = [];
var objImg = false;

function viewNav(id,obj){
	eteint();
	objImg = obj.getElementsByTagName('img')[0];
	x = new getObj("s"+id);
	y = new getObj(objImg.id);

	if(y.obj.offsetLeft==0) posLeft = y.obj.offsetParent.offsetLeft;
	else posLeft = y.obj.offsetLeft;
	
	if(posLeft+180>980) posLeft = 799;
	
	x.style.left = posLeft+"px";
	x.style.visibility="visible";
	swapImgin(objImg);
	maskSelect(x,posLeft);
	clearTimeout(tID);
}
function deviewNav(){
	clearTimeout(tID);
	tID=setTimeout('eteint()',tempo);
}
function eteint(){
	try{
	for(i=2;i<8;i++){
		x = new getObj("s"+i);
		x.style.visibility="hidden";
	}
	if(objImg) swapImgOut(objImg);
	viewSelect();
	}catch(Exeption) {
	}
}
function swapImgin(obj){
	var ch = obj.src;
	var finfin=ch.substring(ch.length-3,ch.length);
	var fin=ch.substring(ch.length-5,ch.length-4);
	if(fin=="1") objEncours = obj;
	ch=ch.substring(0,ch.length-5);
	if(fin != "1") obj.src=ch+"1."+finfin;
}
function swapImgOut(obj){
	if(objEncours == obj) return;
	var ch = obj.src;
	var finfin=ch.substring(ch.length-3,ch.length);
	var fin=ch.substring(ch.length-5,ch.length-4);
	ch=ch.substring(0,ch.length-5);
	if(fin != "0"){
		 obj.src=ch+"0."+finfin;
	}
	objImg = false;
}

function maskSelect(obj,posLeft){
	if(!document.all || navigator.userAgent.indexOf("MSIE 5.0")!=-1 || navigator.userAgent.indexOf("pera")!=-1) return;
	
	frame = '<iframe id="myMaskSelect" scroll="no" frameborder="0" style="border:0;width:181px;height:'+(getHeight(obj.obj)-1)+'px;" src="about:blank" scrolling="no" frameborder="0"></iframe>';
	document.all["maskIframe"].innerHTML = frame;
	document.all["maskIframe"].style.visibility="visible";
	document.all["maskIframe"].style.width="181px";
	document.all["maskIframe"].style.height=getHeight(obj.obj)+"px";
	document.all["maskIframe"].style.position="absolute";
	document.all["maskIframe"].style.left=posLeft+"px";
	document.all["maskIframe"].style.top=35+"px";
}
function viewSelect(){
	for(i in tabSelect){
		tabSelect[i].style.visibility = "visible";
	}
	if(document.all) document.all["maskIframe"].style.visibility="hidden";
}
function viewService(obj){
	new getObj(obj).style.visibility = "visible";
}

function deviewService(obj){
	new getObj(obj).style.visibility = "hidden";
}
function getObj2(name)
{
  if (document.getElementById)
  {
    return document.getElementById(name);
  }
  else if (document.all)
  {
    return document.all[name];
  }
  else if (document.layers)
  {
    return document.layers[name];
  }
  else return false;
}
function blockEnter(e,buttonName)
{ 	var characterCode ;
	if(!ie)
	{e = e;characterCode = e.which 
	;}
	else
	{characterCode = e.keyCode 
	
	;}
	if(characterCode == 13)
	{
	
	if (getObj2(buttonName))
	{
		if (ie){
		
		setTimeout("getObj2('" + buttonName + "').click()",100);
		}
		else
		setTimeout("getObj2('" + buttonName + "').click;",100);
		
		return false ;	
	}
	else
		return false ;	
	}
	else
	{return true ;}
}	