function OnLoad(){
	
	var cnt = 1;
	while (getCell('sp_'+ cnt + 'text'))
	{
		ToggleSpecs('sp_'+ cnt);
		cnt++;
	}
}

function getCell(id){
	
	return document.all ? document.all(id) : document.getElementById ? document.getElementById(id) : document.layers ? document['NS_' + id].document.layers[0] : null
}
/*
shopButton_on = new Image();
shopButton_on.src ='/images/topnav_goshop_on.gif';
shopButton_off = new Image();
shopButton_off.src ='/images/topnav_goshop_off.gif';
*/
function CheckBrowser(){
	
	var br = new Object();
	br.isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
	br.NS4 = (document.layers) ? true : false;
	br.IEmac = ((document.all)&&(br.isMac)) ? true : false;
	br.IE4plus = (document.all) ? true : false;
	br.IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
	br.IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
	br.IE6 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1)) ? true : false;
	ver4 = (br.NS4 || br.IE4plus) ? true : false;
	br.NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;

	br.IE5plus = br.IE5 || br.IE6;
	br.IEMajor = 0;

	if (br.IE4plus)
	{
		var start = navigator.appVersion.indexOf("MSIE");
		var end = navigator.appVersion.indexOf(".",start);
		br.IEMajor = parseInt(navigator.appVersion.substring(start+5,end));
		br.IE5plus = (br.IEMajor>=5) ? true : false;
	}
	return br
}



var Browser = CheckBrowser();

//Returns the document object
function getImage(id){
	
	if (Browser.IE4plus || Browser.IEmac) return document.all[id];
	if (Browser.NS4) return document.images[id];
	if (Browser.NS6) return document.getElementById(id);
}

//Returns the document object
function getElement(id){
	
	if (Browser.IE4plus || Browser.IEmac) return document.all[id];
	if (Browser.NS4) return document[id];
	if (Browser.NS6) return document.getElementById(id);
}
 
 
function ToggleSpecs(id){
 	
   var oImage = getCell(id + 'image');
   var oText = getCell(id + 'text');
   var oGutter = getCell(id + 'gutter');
   var oContent = getCell(id + 'content');
   if (oContent.style.display != 'none')
   {
     //Show (expand)
     if (oImage) oImage.src = '/img/public/flecha_titulo_closed.gif';
     if (oText) oText.style.color = '#DF9200';
     if (oGutter) oGutter.style.display = '';
     if (oContent) oContent.style.display = 'none';
   }
   else
   {
     //Hide (collapse)
     if (oImage) oImage.src = '/img/public/flecha_titulo_opened.gif';
     if (oText) oText.style.color = '#FF9900';
     if (oGutter) oGutter.style.display = 'none';
     if (oContent) oContent.style.display = '';
   }
}
