function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function setFrame(Page,IDProduct){
	objFrame=MM_findObj('winFrame');
	gotoURL=Page+'?IDproduct=' + IDProduct;
	objFrame.src=gotoURL;
	MM_showHideLayers('winLarge','','show');
}

function setFrameSmall(Page,IDPage){
	objFrame=MM_findObj('winFrameSmall');
	gotoURL=Page+'?IDPage=' + IDPage;
	objFrame.src=gotoURL;
	MM_showHideLayers('winSmall','','show');
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_setTextOfLayer(objId,x,newText) { //v9.0
  with (document) if (getElementById && ((obj=getElementById(objId))!=null))
    with (obj) innerHTML = unescape(newText);
}

function setLeaves(pageType){	
	
	anyArray = new Array('1','2','3');
	anyArray.sort( randOrd );
	
	objName = 'blad'+anyArray[0];
	objX=randomNumber(500) +200
	if (pageType==1) {
		objY=20;
		}else{
		objY=75;	
	}
	oBlad1=MM_findObj(objName);
	oBlad1.style.left=objX +'px';
	oBlad1.style.top=objY +'px';
	oBlad1.style.visibility='visible';
	
	objName = 'blad'+anyArray[1];
	objX=-20
	objY=randomNumber(580) +20;
	oBlad1=MM_findObj(objName);
	oBlad1.style.left=objX +'px';
	oBlad1.style.top=objY +'px';
	oBlad1.style.visibility='visible';

	objName = 'blad'+anyArray[2];
	objX=850
	objY=randomNumber(600);
	oBlad1=MM_findObj(objName);
	oBlad1.style.left=objX +'px';
	oBlad1.style.top=objY +'px';
	oBlad1.style.visibility='visible';
	
	
}	

function randomNumber(limit){
  return Math.floor(Math.random()*limit);
}

function randOrd(){
return (Math.round(Math.random())-0.5); } 

function submitForm(frmName){
	oForm=MM_findObj(frmName);
	oForm.submit();
}

function setSearchTab(tabVisible,tabV){
	tab1=MM_findObj('searchDoc')
	tab2=MM_findObj('searchNews')
	tab3=MM_findObj('searchAgenda')
	tab4=MM_findObj('searchLink')
	tab1.style.display='none';
	tab2.style.display='none';
	tab3.style.display='none';
	tab4.style.display='none';
	
	tabx1=MM_findObj('tabDoc')
	tabx2=MM_findObj('tabNews')
	tabx3=MM_findObj('tabAgenda')
	tabx4=MM_findObj('tabLink')
	tabx1.style.backgroundColor='#EEEEEE';
	tabx2.style.backgroundColor='#EEEEEE';
	tabx3.style.backgroundColor='#EEEEEE';
	tabx4.style.backgroundColor='#EEEEEE';
	tabx1.style.fontWeight='normal';
	tabx2.style.fontWeight='normal';
	tabx3.style.fontWeight='normal';
	tabx4.style.fontWeight='normal';
	tabx1.style.color='#666666';
	tabx2.style.color='#666666';
	tabx3.style.color='#666666';
	tabx4.style.color='#666666';
	
	tabV=MM_findObj(tabV)
	tabV.style.backgroundColor="#ffffff";
	tabV.style.fontWeight="bold";
	tabV.style.color="#000000";

	tabVis=MM_findObj(tabVisible)
	tabVis.style.display='block';
	
}