//this file load function wrote in javascript

var tabid = new Array(100);

//to know what is the navigator used

n4=(document.layers) ? true : false
n6=(!document.all && document.getElementById) ? true:false
e4=(document.all)? true:false


//function to change the color and the bachground at the cell c

function chg(t,c,bc)
{
	document.getElementById(t).style.color=c;
	document.getElementById(t).bgColor=bc;
}


//function to show the layer1 
function showIt(layer1)
	{
		if(n4) {document.layers[layer1].visibility="show";}
		else if (n6) document.getElementById(layer1).style.visibility="visible"
		else document.all[layer1].style.visibility="visible";	
	}

//function to hide the layer1
function hideIt(layer1)
	{
		if (n4) document.layers[layer1].visibility = "hide"
		else if (n6) document.getElementById(layer1).style.visibility="hidden"
		else document.all[layer1].style.visibility = "hidden"	
	}


//function to change the picture call name when the mouse is over her	
function localover( name, num ,dir)  { if ( document.images ) { document[name].src = "images/"+dir+"/"+name+num+"_ro.gif"; } }

//function to change the picture call name when the mouse is out her	
function localoff( name ,dir )  { if ( document.images ) { document[name].src = "images/"+dir+"/"+name+".gif"; } }	


//function to change the picture call name when the mouse is over her	
function imageover( name,dir )  { if ( document.images ) { document[name].src = "images/"+dir+"/"+name+"_ro.gif"; } }

//function to change the picture call name when the mouse is out her
function imageoff( name,dir )  { if ( document.images ) { document[name].	src = "images/"+dir+"/"+name+".gif"; } }	
	
//function to change the map picture call name when the mouse is over her	
function imageovermap( name,ext )  { if ( document.images ) { document[name].src = "images/map/"+name+"_"+ext+".gif"; } }
		
	//function to change the map picture call name when the mouse is over her and flicker	
	function imageovermapflash(i,name,ext,ext1,ext2) 
	{
		if ( document.images ) 
		{
			var tabb=new Array( ext1, ext2);
                        if (i==2){i=0;}
			var namepic=name+'_'+ext;
	 		document[name].src='images/map/'+name+tabb[i];
                        i++;
			name='\''+name+'\'';
			ext='\''+ext+'\'';
                        ext1='\''+ext1+'\'';
                        ext2='\''+ext2+'\'';
//the last argument in the function settimeout is to definit the time to flash here 500
			tabid[namepic]=setTimeout('imageovermapflash('+(i)+','+name+','+ext+','+ext1+','+ext2+')',500);
	 		
		 }
	}

//function to change the picture call name when the mouse is out her and fliker
function imageoverflash(i,name,ext1,ext2) 
{
	if ( document.images ) 
	{
                var tabb=new Array(ext1,ext2);
                if (i==2){i=0;}
        	namepic='images/products/'+name+tabb[i];        
         	document[name].src=namepic;
		i++;
                nameid=name;
		name='\''+name+'\'';
                ext1='\''+ext1+'\'';
                ext2='\''+ext2+'\'';
//the last argument in the function settimeout is to definit the time to flash here 500
		tabid[nameid]=setTimeout('imageoverflash('+(i)+','+name+','+ext1+','+ext2+')',500);
	}
}

//function to stop fliking on the product picture call name when the mouse is out her
function imageofflash( name )  
{ 
        clearTimeout(tabid[name]);
	if ( document.images ) { document[name].src = "images/products/"+name+".gif"; } 
}

//function to stop fliking on the map picture call name when the mouse is out her
function imageoffmap( name ,ext)  
{ 
	var namepic=name+'_'+ext;
	clearTimeout(tabid[namepic]);
	if ( document.images ) { document[name].src = "images/map/"+name+".gif"; } 		
}

//exect the function right to not let the permission to use the right button of the mouse
document.onmousedown = right;

//function not to permit use the right button to save picture
function right(e)
{
	var msg;
	lang='E';
	msg = "Sorry, the left button is disable!";

	if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
	{
		alert(msg);
	}
	else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button==2 || event.button==3))
	{
		alert(msg);
	}
	return true;
}


//function to get the height of the current window
function geth()

{
	if (document.body)
        {
                var haut = (document.body.clientHeight);
        }       
	else
	{
		var haut = (window.innerHeight);
	}
return haut;
}

//function to get the size of the current page to download
function dl(incr,cpt)

{
	if (document.body)
	{
		var larg = (document.body.clientWidth);
	} 
	else
	{
		var larg = (window.innerWidth);
	}
	if(larg<cpt+incr){document.write("<tr>");cpt=0}
	else {cpt=cpt+200}

	return cpt;
}			