var newwindow;
function popupResimArsivi1(url)
{
	newwindow=window.open(url,'name','height=400,width=200');
	if (window.focus) {newwindow.focus()}
}

function OpenWin(ProductID, ImageWidth, ImageHeight, Lang) {

	ImageWidth = eval(ImageWidth) + 44;
	ImageHeight = eval(ImageHeight) + 71;
	ProductWin = window.open('/videoarsiviNew.asp?WorkNumber=' + ProductID + '&Lang=' + Lang,'','status=0,toolbar=0,menubar=0,width=' + ImageWidth + ',height=' + ImageHeight + ' resizable=no,scrollbars=no');
}

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
	alert("js1112222");
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings    = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',,';
	win = window.open(mypage,myname,settings);
	if (window.focus) {win.focus()}

}

function popupResimArsivi(url)
{

    var the_x=550;
    var the_y=480;
  
    the_x -= 0;
    the_y -= 0;
    
    var how_wide = 550;
    var how_high = 480;
    
    top_pos = (how_high/2) -  (the_y/2);
    left_pos = (how_wide/2) -  (the_x/2);
  
    window.open(url,"win1","height="+how_high+",width="+how_wide+",left="+left_pos+",top="+top_pos+",toolbar=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=no,minimize=no,maximize=no,alwaysraised=0");

}

var dhtmlgoodies_slideSpeed = 10;	// Higher value = faster
var dhtmlgoodies_timer = 10;	// Lower value = faster

var objectIdToSlideDown = false;
var dhtmlgoodies_activeId = false;
function showHideContent(e,inputId) {	
/*	if (!e) 
		var e = window.event;
	e.cancelBubble = true;*/
	var ss=event.srcElement.id;
	if(event.type=='mouseout'){
		if (ss.indexOf('dhtmlgoodies_ac')>-1){
			alert("event.srcElement.id-->"+event.srcElement.id+"\nevent.toElement.id-->"+event.toElement.tagName);
		}else
			return;
	}
	
	
	if	(!inputId)
		inputId = this.id;
	inputId = inputId + '';
	var numericId = inputId.replace(/[^0-9]/g,'');

	var answerDiv = document.getElementById('dhtmlgoodies_a' + numericId);
	objectIdToSlideDown = false;
	
	if(!answerDiv.style.display || answerDiv.style.display=='none'){

		if(dhtmlgoodies_activeId &&  dhtmlgoodies_activeId!=numericId){			
			objectIdToSlideDown = numericId;
			slideContent(dhtmlgoodies_activeId,(dhtmlgoodies_slideSpeed*-1));
		}else{
			
			answerDiv.style.display='block';
			answerDiv.style.visibility = 'visible';
			
			slideContent(numericId,dhtmlgoodies_slideSpeed);
		}
	}else{
		slideContent(numericId,(dhtmlgoodies_slideSpeed*-1));
		dhtmlgoodies_activeId = false;
	}	
}

function slideContent(inputId,direction)
{
	var obj =document.getElementById('dhtmlgoodies_a' + inputId);
	var contentObj = document.getElementById('dhtmlgoodies_ac' + inputId);
	height = obj.clientHeight;
	height = height + direction;
	rerunFunction = true;
	if(height>contentObj.offsetHeight){
		height = contentObj.offsetHeight;
		rerunFunction = false;
	}
	if(height<=1){
		height = 1;
		rerunFunction = false;
	}

	obj.style.height = height + 'px';
	var topPos = height - contentObj.offsetHeight;
	if(topPos>0)topPos=0;
	contentObj.style.top = topPos + 'px';
	if(rerunFunction){
		setTimeout('slideContent(' + inputId + ',' + direction + ')',dhtmlgoodies_timer);
	}else{
		if(height<=1){
			obj.style.display='none'; 
			if(objectIdToSlideDown && objectIdToSlideDown!=inputId){
				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.display='block';
				document.getElementById('dhtmlgoodies_a' + objectIdToSlideDown).style.visibility='visible';
				slideContent(objectIdToSlideDown,dhtmlgoodies_slideSpeed);				
			}
		}else{
			dhtmlgoodies_activeId = inputId;
		}
	}
}



function initShowHideDivs()
{
	var divs = document.getElementsByTagName('DIV');
	for(var no=0;no<divs.length;no++){
		if(divs[no].className=='headerDIV'){
			divs[no].onclick = showHideContent;
		}else if(divs[no].className=='detailDIV'){
			contentDiv = divs[no].getElementsByTagName('DIV')[0];
			contentDiv.style.top = 0 - contentDiv.offsetHeight + 'px'; 	
			contentDiv.className='detailDIV_content';
			divs[no].style.display='none';
			divs[no].style.height='1px';
		}		
	}	
}
