// JavaScript Document


function showElement(layer){


	var myLayer = document.getElementById(layer);
	if(myLayer.style.display=="none"){
		myLayer.style.display="block";
		myLayer.backgroundPosition="top";
	} else { 
		myLayer.style.display="none";
	}
}
function negativo(){
		document.body.style.color="#fff";
		document.body.style.backgroundColor="#fff";
		document['logo'].src="http://semiotica.simbiotica.es/livesite09/logo_n.png";
		document['s'].src="http://semiotica.simbiotica.es/livesite09/img_comunes/s_NB.png";
		document.getElementById('borde_swt').style.borderColor="#000000";
		document.getElementById('menu_holder').style.borderColor="#fff";
		document.getElementById('holder').style.borderColor="#fff";		
		document.getElementById('holder').style.backgroundColor="#000000";
		document.getElementById('footer_top').style.borderColor="#FFF";
		changecss('a:link, a:visited','color','#fff');
		
		
		changecss('.col1','border-color','#fff');
		changecss('.col2','border-color','#fff');
		changecss('.col3','border-color','#fff');
		changecss('.col4','border-color','#fff');
		
		changecss('.main_content a:link img, .main_content a:visited img','color','#FFF');
		//changecss('.main_content a:visited img','color','#FFF');
		changecss('.menu .sel span','border-bottom','3px solid #FFF');
}
function positivo(){
		document.body.style.color="#000";
		document.body.style.backgroundColor="#fff";
		document['logo'].src="http://semiotica.simbiotica.es/livesite09/logo.png";
		document['s'].src="http://semiotica.simbiotica.es/livesite09/img_comunes/s_BN.png";
		document.getElementById('borde_swt').style.borderColor="#fff";
		document.getElementById('menu_holder').style.borderColor="#000";
		document.getElementById('holder').style.borderColor="#000000";
		document.getElementById('holder').style.backgroundColor="#FFF";
		document.getElementById('footer_top').style.borderColor="#000";
		changecss('a:link, a:visited','color','#000');
		
		
		changecss('.col1','border-color','#000');
		changecss('.col2','border-color','#000');
		changecss('.col3','border-color','#000');
		changecss('.col4','border-color','#000');
		
		changecss('.main_content a:link img, .main_content a:visited img','color','#000');
		//changecss('.main_content a:visited img','color','#000');
		changecss('.menu .sel span','border-bottom','3px solid #000');
}





function changecss(theClass,element,value) {
	//Last Updated on June 23, 2009
	//documentation for this script at
	//http://www.shawnolson.net/a/503/altering-css-class-attributes-with-javascript.html
	 var cssRules;

	 var added = false;
	 for (var S = 0; S < document.styleSheets.length; S++){

    if (document.styleSheets[S]['rules']) {
	  cssRules = 'rules';
	 } else if (document.styleSheets[S]['cssRules']) {
	  cssRules = 'cssRules';
	 } else {
	  //no rules found... browser unknown
	 }

	  for (var R = 0; R < document.styleSheets[S][cssRules].length; R++) {
	   if (document.styleSheets[S][cssRules][R].selectorText == theClass) {
	    if(document.styleSheets[S][cssRules][R].style[element]){
	    document.styleSheets[S][cssRules][R].style[element] = value;
	    added=true;
		break;
	    }
	   }
	  }
	  if(!added){
	  if(document.styleSheets[S].insertRule){
			  document.styleSheets[S].insertRule(theClass+' { '+element+': '+value+'; }',document.styleSheets[S][cssRules].length);
			} else if (document.styleSheets[S].addRule) {
				document.styleSheets[S].addRule(theClass,element+': '+value+';');
			}
	  }
	 }
	}

function genHex(){
colors = new Array(14)
colors[0]="0"
colors[1]="1"
colors[2]="2"
colors[3]="3"
colors[4]="4"
colors[5]="5"
colors[5]="6"
colors[6]="7"
colors[7]="8"
colors[8]="9"
colors[9]="a"
colors[10]="b"
colors[11]="c"
colors[12]="d"
colors[13]="e"
colors[14]="f"

digit = new Array(5)
color=""
for (i=0;i<6;i++){
digit[i]=colors[Math.round(Math.random()*14)]
color = color+digit[i]
}
//document.getElementById('hexc').style.backgroundCo lor=color
//document.getElementById('hexn').innerText="#"+colo r
return "#"+color;
}
//-->
window.addEventListener('mouseover', function(e){reloj()}, true);

//setInterval("reloj()",1000);
function reloj() {
micolor=genHex()
changecss(' a:hover','color',micolor);
changecss('.main_content a:hover','color',micolor);
changecss('.main_content a:hover img','color',micolor);
	
}




	
