//------
function showHand(mId){
	tObj = findObj(mId);
	tObj.style.cursor = "pointer";
}
function hideHand(mId){
	tObj = findObj(mId);
	tObj.style.cursor = "auto";
}
//----------------------------------------
function filmoOver(mId){
	var boxId = mId+"_short";
	var tBox = findObj(boxId);
	tBox.style.cursor = "pointer";
	tBox.style.backgroundColor = "#E9EEF0";
	var arrowId = mId+"_arrowA";
	var tSRC = '/images/arrowA_anim.gif'; 	
	MM_swapImage(arrowId,'',tSRC,1);
} 
function filmoOut(mId){
	var boxId = mId+"_short";
	var tBox = findObj(boxId);
	tBox.style.cursor = "auto";
	tBox.style.backgroundColor = "#FFFFFF";
	MM_swapImgRestore();
}
function filmoTitleOver(mId){
	var titleId = mId+"_title";
	var tTitle = findObj(titleId);
	tTitle.style.cursor = "pointer";
	tTitle.style.borderBottom = "1px solid #000000";
	var arrowId = mId+"_arrowB";
	var tSRC = '/images/arrowB_anim.gif'; 
	MM_swapImage(arrowId,'',tSRC,1);
}
function filmoTitleOut(mId){
	var titleId = mId+"_title";
	var tTitle = findObj(titleId);
	tTitle.style.cursor = "auto";
	tTitle.style.borderBottom = "1px solid #FFFFFF";
	MM_swapImgRestore();
}
//----------------
function filmoExpand(mId){
	var boxId = mId+"_short";
	var tBox = findObj(boxId);
	tBox.style.display = "none";
	var boxId = mId+"_long";
	var tBox = findObj(boxId);
	tBox.style.display = "block";
}
function filmoCollapse(mId){
	var boxId = mId+"_long";
	var tBox = findObj(boxId);
	tBox.style.display = "none";
	var boxId = mId+"_short";
	var tBox = findObj(boxId);
	tBox.style.display = "block";
}

//----------------
function adjustSizeFilmoPhoto(mW,mH){
	//-- get viewable window document size
	var wS = getWindowSize();
	var wW = wS[0];
	var wH = wS[1];
	//-- get scroll position in window document
	var tScroll = getScrollTop();
	//-- establishing holder frame padding size
	var tPadding = 40;
	//-- compute div holder size
	var tW = mW + 2*tPadding;
/*	alert("FlashW: "+mW);
	alert("tW: "+tW);*/
	var tH = mH + 2*tPadding;
	//-- computing top-left pos holder
	var tLeft = Math.floor((wW-tW)/2);
	var tTop = Math.floor((wH-tH)/2)+tScroll;
	//-- getting div holder in page
	var tHolderFP = findObj('holderFilmoPhoto');
	//-- applying changes
	tHolderFP.style.width = tW +"px";
	tHolderFP.style.height = tH +"px";
	tHolderFP.style.left = tLeft +"px";
	tHolderFP.style.top = tTop +"px";
	tHolderFP.style.backgroundImage = "none";
	//-- applying padding
	/*
	tHolderFP.style.paddingLeft = tPadding+"px";
	tHolderFP.style.paddingTop = tPadding+"px";
	tHolderFP.style.paddingRight = 0+"px";
	tHolderFP.style.paddingBottom = 0+"px";
	*/
	var tHolderFP_Top = findObj('holderFilmoPhotoTop');
	var tHolderFP_Bottom = findObj('holderFilmoPhotoBottom');
	tHolderFP_Top.style.display = "block";
	tHolderFP_Bottom.style.display = "block";
	//-- getting iframe for loader
	var ObjFrame = document.getElementById("frameFilmoPhoto");
	//-- adjusting iframe size
	ObjFrame.width = mW;
	ObjFrame.height = mH;
}

function openFilmoPhoto(mId,mIndex){
   //alert(mId)
   var newdiv = document.createElement('div');
   newdiv.setAttribute('id', 'divbox');
   var idbox = newdiv.getAttribute('id');
   document.body.appendChild(newdiv);
   document.getElementById(idbox).className='testdiv';
   winW = document.body.offsetWidth;
   winH = document.body.innerHeight;
   newdiv.style.left = (winW-500)/2+"px";
   newdiv.style.top = 100+"px";
   newdiv.innerHTML = '<img src="images/photos/'+mId+'_'+mIndex+'.jpg">';
}

/*function openFilmoPhoto(mId,mIndex){
	//-- covering whole page with disableGray
	showOverAll();
	//-- get viewable window document size
	var wS = getWindowSize();
	var wW = wS[0];
	var wH = wS[1];
	//-- get scroll position in window document
	var tScroll = getScrollTop();
	//-- defining holder pre-size
	var tW = 126;
	var tH = 50;
	//-- compute top-left position of holder
	var tLeft = Math.floor((wW-tW)/2);
	var tTop = Math.floor((wH-tH)/2)+tScroll;
	//-- getting div holder in page
	var tHolderFP = findObj('holderFilmoPhoto');
	//-- applying changes
	tHolderFP.style.left = tLeft +"px";
	tHolderFP.style.top = tTop +"px";
	tHolderFP.style.width = tW +"px";
	tHolderFP.style.height = tH +"px";
	tHolderFP.style.display = "block";
	tHolderFP.style.backgroundImage = "url('/images/loadingAnim.gif')";
	//-- getting iframe for loader
	var ObjFrame = document.getElementById("frameFilmoPhoto");
	//alert(ObjFrame);
	//-- adjusting iframe pre-size
	ObjFrame.width = tW;
	ObjFrame.height = tH;
	//-- establishing parameters
	var tSRC = "/images/photos/"+ mId +"_"+ mIndex +".jpg";
	var test = "empty";
	var URLfile = "/loadFilmoPhoto.php?src="+tSRC;
	//-- loading iframe content
	//ObjFrame.src = URLfile;
}*/
function closeFilmoPhoto(){
	hideOverAll();
	var tHolderFP = findObj('holderFilmoPhoto');
	tHolderFP.style.paddingLeft = 0+"px";
	tHolderFP.style.paddingTop = 0+"px";
	tHolderFP.style.display = "none";
	//----
	var tHolderFP_Top = findObj('holderFilmoPhotoTop');
	var tHolderFP_Bottom = findObj('holderFilmoPhotoBottom');
	tHolderFP_Top.style.display = "none";
	tHolderFP_Bottom.style.display = "none";
	//---
	var ObjFrame = document.getElementById("frameFilmoPhoto");
	var URLfile = "/null.html";
	ObjFrame.src = URLfile;
}
//--------------------------
function getScrollTop(){
	return Math.max(document.body.scrollTop,document.documentElement.scrollTop);
}
function getWindowSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
		myWidthB = document.documentElement.clientWidth;
		if(myWidth != myWidthB || (myWidth-myWidthB)<50)myWidth = myWidthB;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
	s = new Array(myWidth,myHeight);
	return s;
}
//--------------------------
function showOverAll(){
	var tHolderAll = findObj('holderAll');
	if(tHolderAll.offsetHeight) var tH = tHolderAll.offsetHeight;
	else var tH = tHolderAll.style.pixelHeight;
	var tOverAll= findObj('overAll');
	tOverAll.style.display = "block";
	tOverAll.style.height = tH+"px";
}
function hideOverAll(){
	var tOverAll= findObj('overAll');
	tOverAll.style.display = "none";
	tOverAll.style.height = "0px";
}