// JavaScript Document
var d = document;
var winIE = (navigator.userAgent.indexOf("Opera")==-1 && (d.getElementById && d.documentElement.behaviorUrns)) ? true : false;
function bodySize()
{
	if(winIE && d.documentElement.clientWidth) 
	{
		sObj = d.getElementsByTagName("body")[0].style;
		sObj.width = (d.documentElement.clientWidth<1000) ? "1000px" : "auto";
		
	}
 }

 function init()
 {
	var a = d.getElementsByTagName("a");
	for(var i=0;i<a.length;i++) if(a[i].href == d.location.href) {
		a[i].href = "javascript:void(0);";
	}
	if(winIE) { bodySize(); }
 }
 onload = init;
 if(winIE) { onresize = bodySize; }
 
 
 
function ShowHide(divId) {
var id = document.getElementById(divId);
if (id.style.display == "none") {
eval("id.style.display = 'block'");
} else {
eval("id.style.display = 'none'");
}
}


  var rot1	= new Image(1181,338); rot1.src = "/images/template/foto/pic_index1.jpg";
  var rot2	= new Image(1181,338); rot2.src = "/images/template/foto/pic_index2.jpg";
  var rot3	= new Image(1181,338); rot3.src = "/images/template/foto/pic_index3.jpg";
  var rot4	= new Image(1181,338); rot4.src = "/images/template/foto/pic_index4.jpg";  


setInterval(ToBlack, 12000);
tim = null;
count=1;


function ChangeImg1(){
	nom++;
	if (nom>4) nom=1;
	if (nom<1) nom=4;
	$(".subContenerFotoIndex1").css(
//	  {backgroundImage: "url(/images/template/foto/pic_index"+nom+".jpg)"  } 	);
	  {backgroundImage: "url(" + eval("rot" + nom + ".src") + ")"  } 	);
	for (var i=1; i<=4; i++){
		$(".aa" + i + ">a " ).attr("class","");
	}
	$(".aa" + nom + ">a " ).attr("class","activ1");	
}

function ToBlack(){
//	tim = setInterval(SetOpasity, 100);
	SetOpasity();
}

function SetOpasity(){
	$(".imgblack").animate({opacity: 1 }, 2000, function(){
		nom++;
		ChangeImg();
		$(".imgblack").animate({opacity: 0 }, 2000);
	} );
/*
	if (count < 10){
		opa = 0.1 * count;
		$(".imgblack").css(
	  	{
			opacity: opa,
			display: "block",
			background: "#111111 none repeat scroll 0%",
			height: "100%"
		} );
	}
	if (count == 10) ChangeImg1();
	if (count > 10){
		opa = 0.1 * (20 - count);
		$(".imgblack").css(
	  	{
			opacity: opa,
			display: "block",
			background: "#111111 none repeat scroll 0%",
			height: "100%"
		} );
	}
	if (count > 19) {
		count = 1;		
		clearInterval(tim);
	}
	count++;
*/
}

