window.onscroll = callJavascript;
window.onresize = callJavascript;

function popupwind(URL, width, height) {
	var x=(screen.width-width)/2;
	var y=(screen.height-height)/2;
	day = new Date();
	//id = day.getTime();
	id = 0;
	eval("page" + id + " = window.open(URL, '" + id + "','toolbar=0,scrollbars=auto,status=0,location=0,statusbar=0,menubar=0,resizable=0,width="+width+",height="+height+",left="+x+",top="+y+"');");
}


function PopupPic(sPicURL) { 
	window.open("popup.html?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}

function callJavascript(){
   var myOffset = 0, myHeight = 0;

   if( typeof( window.pageYOffset ) == 'number' ) {
   //Netscape compliant
	myOffset = window.pageYOffset;
   }else if(document.body && document.body.scrollTop){
   //DOM compliant
	myOffset = document.body.scrollTop;
   }else if(document.documentElement && document.documentElement.scrollTop ){
   //IE6 standards compliant mode
	myOffset = document.documentElement.scrollTop;
   }


   if( typeof( window.innerHeight ) == 'number' ) {
   //Non-IE
	myHeight = window.innerHeight;
   }else if( document.documentElement && document.documentElement.clientHeight ){
   //IE 6+ in 'standards compliant mode'
	myHeight = document.documentElement.clientHeight;
   }else if( document.body && document.body.clientHeight){
   //IE 4 compatible
	myHeight = document.body.clientHeight;
   }else{
	myHeight = 550;
   }


   window.document.sfflash.SetVariable("pageYOffset", myOffset);
   window.document.sfflash.SetVariable("innerHeight", myHeight);
}

function LightboxDelegate(url,caption) {
   var objLink = document.createElement('a');
   objLink.setAttribute('href',url);
   objLink.setAttribute('rel','lightbox');
   objLink.setAttribute('title',caption);
   Lightbox.prototype.start(objLink);
}
