﻿var popup_uid_name = 0;

function openWin(wUri, wName, wWidth, wHeight, Scroll, wMenu, Resize) {
	if(wName==''){
		popup_uid_name++;
		wName=popup_uid_name;
	}
//	if (wWidth > 700){
//		wWidth = 700; Scroll = 1;
//		if (wHeight < 500){
//			wHeight = wHeight + 16;
//		}
//	}
//        if (wHeight > 600){
//		wHeight = 600; Scroll = 1;
//		if (wWidth < 700){
//			wWidth = wWidth + 16;
//		}
//	}
	var resizable = (Resize==0) ? 0 : 1;
	var scrollBars = (Scroll!=0) ? 1 : 0;
	var menuBars = (wMenu) ? 1 : 0;
	var positionLeft = (screen.width - wWidth)/2;
	//var positionTop = (screen.height - wHeight)/2;
	var positionTop =5
	var myW = window.open(wUri,wName,'width='+wWidth+',height='+wHeight+',top='+positionTop+',left='+positionLeft+',location=0,menubar='+menuBars+',resizable=1,scrollbars='+scrollBars+',status=0,titlebar=0,toolbar=0,directories=0,hotkeys=0')
	myW.focus();
}


function onclick_picture(picFile,picNumber){
   var sourceHTML=""
   if (document.images['picture_Big'] && picFile!=''){
      if (document.all){
           document.images['picture_Big'].style.filter="blendTrans(duration=1)";
           document.images['picture_Big'].filters.blendTrans.Apply();
       }
       document.images['picture_Big'].style.visibility='hidden';
	   document.images['picture_Big'].src = picFile;
	   document.images['picture_Big'].style.visibility='visible';		
       if (document.all){
           document.images['picture_Big'].filters.blendTrans.Play();
       }
       if (picNumber!=''){
           if (document.getElementById("pictureTitle_"+picNumber)){
               sourceHTML=document.getElementById("pictureTitle_"+picNumber).value
           }    
           changeHTML('picture_Big_Title',sourceHTML);
           document.images['picture_Big'].alt=sourceHTML
           changeHTML('SlideImageId',picNumber);
       }
   }
   return false;
}
function changeHTML(spanId,code){
    var element = document.getElementById(spanId);
	if(element) {
	    element.innerHTML = code;
	}
}