var acitve2=0;

var _timer;

function changePictureOut()
{
	clearTimeout(_timer);
}

function changePictureOver(id, id2, arrayCount, intMyFormId) {
	if (intMyFormId) {
      _timer = setTimeout("changePicture('"+id+"','"+id2+"','"+arrayCount+"','"+intMyFormId+"')",200);
	} else {
      _timer = setTimeout("changePicture('"+id+"','"+id2+"','"+arrayCount+"')",200);
	}
}

function changePicture(id,id2,arrayCount,intMyFormId){

  if (!intMyFormId) { intMyFormId = ''; }

  var strFormName = 'myform'+intMyFormId;

/*
	if(document[strFormName]['imageText'+id2+id].value==""){
	 document.getElementById("TextImage"+id2).style.display="none";
	}else{
	  document.getElementById("TextImage"+id2).style.display="block";
	}
*/
	for(var i=0;i<arrayCount;i++){
		document.getElementById('thumb'+id2+i).className='inactive' ;
	}
	var acitve2="1";

	document.getElementById('thumb'+id2+id).className='active' ;
	if(document.getElementById("TextImage"+id2).firstChild!=null){
		for(var i=0;i<=document.getElementById("TextImage"+id2).childNodes.length;i++){
			document.getElementById("TextImage"+id2).removeChild(document.getElementById("TextImage"+id2).firstChild);
		}
	}
	
	document.getElementById("TextImage"+id2).appendChild(document.createTextNode(document[strFormName]['imageText'+id2+id].value));

	if(document[strFormName]['imageFull'+id2+id]) {
		document.images['img'+id2].src=document[strFormName]['imageFull'+id2+id].value;
	} else {
		
		// alle vorschaubilder auf grau ändern
		$$('img.pic_thumb').each(function(item) {
			item.src = $(item.name).value;
		});
		
		$('img'+id2).src = $('thumbImgSrc'+id2+id).value; // vollbild ändern
		$('thumbSrc'+id2+id).src = $('thumbImgSrc'+id2+id).value; // vorschaubild von grau auf farbig ändern
//		alert($('thumbSrc'+id2+id).name);
	}



	
//	alert("'"+id+",'"+id2+"','"+arrayCount+"','"+intMyFormId+"'");
	
}


function setacitve(id,id2){
		document.getElementById('thumb'+id2+id).className='active' ;
}


function setinacitve(id,id2){
	if(acitve2=="1"){
		acitve2="0";
	}else{
		document.getElementById('thumb'+id2+id).className='inactive' ;
	}
}
