Type.registerNamespace("MySpace.Web.Modules.Common.Services");MySpace.Web.Modules.Common.Services.PrintService=function(){MySpace.Web.Modules.Common.Services.PrintService.initializeBase(this);this._timeout=0;this._userContext=null;this._succeeded=null;this._failed=null};MySpace.Web.Modules.Common.Services.PrintService.prototype={RecordPrint:function(I,D,G,F,B,C,A,J,H,E){return this._invoke(MySpace.Web.Modules.Common.Services.PrintService.get_path(),"RecordPrint",true,{featureName:I,userId:D,objectId:G,printType:F,pageCount:B,pageFunctionalContext:C,bucketId:A},J,H,E)}};MySpace.Web.Modules.Common.Services.PrintService.registerClass("MySpace.Web.Modules.Common.Services.PrintService",Sys.Net.WebServiceProxy);MySpace.Web.Modules.Common.Services.PrintService._staticInstance=new MySpace.Web.Modules.Common.Services.PrintService();MySpace.Web.Modules.Common.Services.PrintService.set_path=function(A){MySpace.Web.Modules.Common.Services.PrintService._staticInstance._path=A};MySpace.Web.Modules.Common.Services.PrintService.get_path=function(){return MySpace.Web.Modules.Common.Services.PrintService._staticInstance._path};MySpace.Web.Modules.Common.Services.PrintService.set_timeout=function(A){MySpace.Web.Modules.Common.Services.PrintService._staticInstance._timeout=A};MySpace.Web.Modules.Common.Services.PrintService.get_timeout=function(){return MySpace.Web.Modules.Common.Services.PrintService._staticInstance._timeout};MySpace.Web.Modules.Common.Services.PrintService.set_defaultUserContext=function(A){MySpace.Web.Modules.Common.Services.PrintService._staticInstance._userContext=A};MySpace.Web.Modules.Common.Services.PrintService.get_defaultUserContext=function(){return MySpace.Web.Modules.Common.Services.PrintService._staticInstance._userContext};MySpace.Web.Modules.Common.Services.PrintService.set_defaultSucceededCallback=function(A){MySpace.Web.Modules.Common.Services.PrintService._staticInstance._succeeded=A};MySpace.Web.Modules.Common.Services.PrintService.get_defaultSucceededCallback=function(){return MySpace.Web.Modules.Common.Services.PrintService._staticInstance._succeeded};MySpace.Web.Modules.Common.Services.PrintService.set_defaultFailedCallback=function(A){MySpace.Web.Modules.Common.Services.PrintService._staticInstance._failed=A};MySpace.Web.Modules.Common.Services.PrintService.get_defaultFailedCallback=function(){return MySpace.Web.Modules.Common.Services.PrintService._staticInstance._failed};MySpace.Web.Modules.Common.Services.PrintService.set_path("/Modules/Common/Services/PrintService.asmx");MySpace.Web.Modules.Common.Services.PrintService.RecordPrint=function(J,E,I,H,B,D,A,G,C,F){MySpace.Web.Modules.Common.Services.PrintService._staticInstance.RecordPrint(J,E,I,H,B,D,A,G,C,F)};Type.registerNamespace("MySpace.Web.Core.UI.MasterPages");if(typeof(MySpace.Web.Core.UI.MasterPages.PrintPreview_FeatureName)==="undefined"){MySpace.Web.Core.UI.MasterPages.PrintPreview_FeatureName=function(){throw Error.invalidOperation()};MySpace.Web.Core.UI.MasterPages.PrintPreview_FeatureName.prototype={Photos:0,Messaging:1,Blogs:2,ProfileComments:3,GoogleMap:4};MySpace.Web.Core.UI.MasterPages.PrintPreview_FeatureName.registerEnum("MySpace.Web.Core.UI.MasterPages.PrintPreview_FeatureName",true)}if(typeof(MySpace.Web.Modules.Common.Services.PrintService_PrintType)==="undefined"){MySpace.Web.Modules.Common.Services.PrintService_PrintType=function(){throw Error.invalidOperation()};MySpace.Web.Modules.Common.Services.PrintService_PrintType.prototype={Preview:0,Print:1};MySpace.Web.Modules.Common.Services.PrintService_PrintType.registerEnum("MySpace.Web.Modules.Common.Services.PrintService_PrintType",true)}var previewContainer=null;if(previewContainerID.length>0){previewContainer=$get(previewContainerID)}var commentContainer=null;if(commentContainerID.length>0){commentContainer=$get(commentContainerID)}var pageSize=900;if(!MySpace.Application.keyDisabled("DWBeaconPhotoPrint")){MySpace.ManualPageBeacon=true}window.setTimeout(LoadPrintPreview,1000);function LoadPrintPreview(){var B=finishPageCount();if(!MySpace.Application.keyDisabled("DWBeaconPhotoPrint")){MySpace.AdditionalPageBeaconKVPs={printType:MySpace.Web.Modules.Common.Services.PrintService_PrintType.Preview,pageCount:B};MySpace.ManualPageBeacon=false;if(MySpace.Beacon&&MySpace.BeaconData){MySpace.Beacon.SendPageBeacon()}}var A=new Sys.Net.WebRequest();A.set_url(String.format(printServiceUrl,printFeature,printUserId,objectID,MySpace.Web.Modules.Common.Services.PrintService_PrintType.Preview,B,pageFunctionalContext,testBucketId));A.set_httpVerb("GET");A.invoke()}function printFinal(){var B=finishPageCount();if(!MySpace.Application.keyDisabled("DWBeaconPhotoPrint")){MySpace.Beacon.Request({printType:MySpace.Web.Modules.Common.Services.PrintService_PrintType.Print,pageCount:B})}var A=new Sys.Net.WebRequest();A.set_url(String.format(printServiceUrl,printFeature,printUserId,objectID,MySpace.Web.Modules.Common.Services.PrintService_PrintType.Print,B,pageFunctionalContext,testBucketId));A.set_httpVerb("GET");A.invoke();window.print()}function toggleInclude(C){if(printHeaderID.length>0){var A=$get(printHeaderID);var B=1;if(previewContainer!==null&&commentContainer!==null){if(C!==null){if(!C.checked){previewContainer.removeChild(commentContainer);A.appendChild(commentContainer);commentContainer.style.display="none"}else{A.removeChild(commentContainer);previewContainer.appendChild(commentContainer);commentContainer.style.display=""}B=finishPageCount()}}}}function calculatePage(){var B=0;var A=null;if(previewContainer!==null){A=Sys.UI.DomElement.getBounds(document.body);B=A.height}return B}function finishPageCount(){var A=1;if(previewContainer!==null){var B=document.createElement("div");B.style.pageBreakAfter="always";var C=calculatePage();if(C<pageSize){B.setAttribute("ID","divBreaker0");previewContainer.appendChild(B);A=1}else{var D=Math.ceil(C/pageSize);A=D}}return A};