var currFlashPluginVersion="10.1.102.64", highlightMenu=null, ppc=null, gallerySetup;

function windowResized()
	{
	var obj=document.getElementById("backgroundFlash");
	
	if (obj) obj.initialize(); 	
	}
	
	
function viewZoomed(id,pictUrl,alt,description,bigPictUrl,bigW,bigH)
	{
	var obj=document.getElementById("galleryRightFlash");
	
	if (obj) obj.showPicture(id,pictUrl,alt,description,bigPictUrl,bigW,bigH); 	
	}
	
	
function galleryCompleted()
	{
	var obj=document.getElementById("galleryCircles");
	
	if (!obj) return;
	obj=obj.getElementsByTagName("div");
	if (typeof(obj[0].onclick)=="function")	obj[0].onclick({target:obj});
	}
	
	
function gallery2ViewPicture(id,url,width,height)
	{
	ppc.showPicture(id,url,width,height);	
	}
	
	
function gallery4ViewPicture(id,url,alt,description,bigId,bigURL,bigWidth,bigHeight)
	{
	viewZoomed(bigId,url,alt,description,bigURL,bigWidth,bigHeight);
	}
	

	
function shareFacebook()
	{
	var url;

	url=escape(window.location);
	url+="&t="+escape(document.title);
	url=url.replace(/\//g, '%2F');
	url="http://www.facebook.com/sharer.php?u="+url;
	
	window.location=url;
	}
	

function gallery4Resize(newHeight)
	{
	var obj=document.getElementById("gallery4Flash");
	
	if (!obj) return;
	obj.style.height=newHeight+"px";
	}
	
	
function gallery4Setup(arr)
	{
	gallerySetup=Array();
	gallerySetup["ids"]=Array();
	gallerySetup["widths"]=Array();
	gallerySetup["heights"]=Array();
	gallerySetup["alts"]=Array();
	gallerySetup["descriptions"]=Array();
	
	for (var i=0; i<arr.length; i++)
		{
		gallerySetup["ids"].push(arr[i].id);
		gallerySetup["widths"].push(arr[i].width);
		gallerySetup["heights"].push(arr[i].height);
		gallerySetup["alts"].push(unescape(arr[i].alt));
		gallerySetup["descriptions"].push(unescape(arr[i].description));
		}
		
	ppc=new picturePresenterClass(gallerySetup);
	}
	
	
function insertFlash(file,w,h)
	{
	var divName="flash"+Math.floor(Math.random()*10000);
	
	document.writeln("<div id=\""+divName+"\"></div>");
	swfobject.embedSWF(file,divName,w,h,currFlashPluginVersion,"/common/expressInstall.swf",false,{quality:"high",wmode:"transparent",menu:"false"},{id:divName+"embeded", style:"margin-left:80px"});	
	}
	
	
	
function initPage()
	{
	var obj;
	
	ppc=new picturePresenterClass(typeof(gallerySetup)=="undefined" ? null : gallerySetup);
	obj = (typeof(currentDocId)!="undefined" && currentDocId!="#DOCUMENT_ID#") ? {docId:currentDocId} : false;
		
	swfobject.embedSWF("Skins/pl/photos/gallery1.swf","galleryLeftEmbed",212,294,currFlashPluginVersion,"/common/expressInstall.obj",obj,{quality:"high",wmode:"transparent",menu:"false"},{id:"galleryLeftFlash"});
	swfobject.embedSWF("Skins/pl/photos/gallery2.swf","galleryRightEmbed",405,298,currFlashPluginVersion,"/common/expressInstall.swf",obj,{quality:"high",wmode:"transparent",menu:"false"},{id:"galleryRightFlash"});
	swfobject.embedSWF("Skins/pl/photos/gallery3.swf","galleryCustomerEmbed",110,298,currFlashPluginVersion,"/common/expressInstall.swf",false,{quality:"high",wmode:"transparent",menu:"false"},{id:"galleryCustomerFlash"});
	swfobject.embedSWF("Skins/pl/photos/background.swf","backgroundEmbed","100%","100%",currFlashPluginVersion,"/common/expressInstall.swf",false,{quality:"high",wmode:"transparent",menu:"false"},{id:"backgroundFlash"});
	swfobject.embedSWF("Skins/pl/photos/gallery4.swf","gallery4Embed",571,286,currFlashPluginVersion,"/common/expressInstall.swf",false,{quality:"high",wmode:"transparent",menu:"false"},{id:"gallery4Flash"});
	swfobject.embedSWF("Skins/pl/photos/Calendar.swf","calendarEmbed",573,500,currFlashPluginVersion,"/common/expressInstall.swf",{rootCtg:"agenda"},{quality:"high",wmode:"transparent",menu:"false"},{id:"calendarFlash"});
	}
	
	
function debug(str)
	{
	alert(str);
	}


window.onload=init;
window.onresize=windowResized;
initClassObj.registerFunction(initPage);
