if(typeof (NamepaceManager)=="undefined"){ var NamepaceManager={Register:function(_1){ var o=window; var x=false; for(var a=_1.split(".");a.length>0;){ var s=a.shift(); if(a.length==0){ if(o[s]){ x=true; } } if(!o[s]){ o[s]={}; } o=o[s]; } if(x){ return 1; } }}; NamepaceManager.Register("Apc.JS"); if(typeof (Apc.JS.Browser)=="undefined"||typeof (Apc.JS.Browser.Version)==null||Apc.JS.Browser.Version<1){ Apc.JS.Browser={Version:1}; Apc.JS.Browser.ParseBrowserInfo=function(){ this.IsMacIE=(navigator.appName=="Microsoft Internet Explorer")&&((navigator.userAgent.toLowerCase().indexOf("mac")!=-1)||(navigator.appVersion.toLowerCase().indexOf("mac")!=-1)); this.IsSafari=(navigator.userAgent.toLowerCase().indexOf("safari")!=-1); this.IsChrome=(navigator.userAgent.toLowerCase().indexOf("chrome")!=-1); this.IsMozilla=window.netscape&&!window.opera; this.IsNetscape=/Netscape/.test(navigator.userAgent); this.IsOpera=window.opera; this.IsOpera9=window.opera&&(parseInt(window.opera.version())>8); this.IsIE=!this.IsMacIE&&!this.IsMozilla&&!this.IsOpera&&!this.IsSafari; this.IsIE7=/MSIE 7/.test(navigator.appVersion); this.IsIE8=/MSIE 8/.test(navigator.appVersion); this.StandardsMode=this.IsSafari||this.IsOpera9||this.IsMozilla||document.compatMode=="CSS1Compat"; this.IsMac=/Mac/.test(navigator.userAgent); this.DocumentBody=((!window.opera&&document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body); }; Apc.JS.Browser.ParseBrowserInfo(); } Apc.JS.CloneObject=function(_6){ var _7; if(typeof (_6.length)!="undefined"){ _7=new Array(); }else{ _7=new Object(); } for(i in _6){ if(typeof (_6[i])=="object"){ _7[i]=Apc.JS.CloneObject(_6[i]); }else{ _7[i]=_6[i]; } } return (_7); }; Apc.JS.GetCheckedValue=function(_8){ if(!_8){ return ""; } var _9=_8.length; if(_9==undefined){ if(_8.checked){ return _8.value; }else{ return ""; } } for(var i=0;i<_9;i++){ if(_8[i].checked){ return _8[i].value; } } return ""; }; Apc.JS.FollowMouse=function(_b,_c){ var _d=[15,15]; var _e=0; var _f=450; var _10=270; var _11=document.getElementById(_b); var _12=document.getElementById(_c); this.ShowLayer=function(_13,_14,_15){ try{ _12.src=_13; _f=_14; _10=_15; document.onmousemove=FollowMouse; _11.style.display="block"; } catch(err){ } }; this.GetType=function(){ return "Apc.JS.FollowMouse"; }; this.HideLayer=function(){ try{ _11.style.display="none"; document.onmousemove=""; _11.style.left="-500px"; _12.src="images/wait.gif"; } catch(err){ } }; function FollowMouse(e){ try{ e=(e)?e:((window.event)?window.event:""); var _17=_d[0]; var _18=_d[1]; var _19=Apc.JS.Browser.DocumentBody; var _1a=document.all?_19.scrollLeft+_19.clientWidth:pageXOffset+window.innerWidth-15; var _1b=document.all?Math.min(_19.scrollHeight,_19.clientHeight):Math.min(document.body.offsetHeight,window.innerHeight); if(_1a-e.clientX<_f+25){ _17=e.clientX+(document.documentElement.scrollLeft-15-_17-_f); }else{ _17+=_19.scrollLeft+e.clientX; } if(_1b-e.clientY<(_10+110)){ _18+=e.clientY+_19.scrollTop-Math.max(0,(110+_10+e.clientY-_1b)); }else{ _18+=_19.scrollTop+e.clientY; } _11.style.left=_17+"px"; _11.style.top=_18+"px"; } catch(err){ } }; }; Apc.JS.ToJSON=function(obj){ if(typeof obj=="undefined"){ return "undefined"; }else{ if(obj===null){ return "null"; } } var _1d={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"}; var _1e=null,i,l,v,a=[]; switch(obj.constructor){ case Array: l=obj.length; for(i=0;i1){ if(_1b[1]!=null){ _9=_1b[1]; } } if(_1b.length>2){ _d=_1b[2]; } if(_1b.length>3){ _e=_1b[3]; } }; this.SendRequest=function(){ var _1c=Apc.JS.Ajax; var _1d=_1c.Request("POST",_6,HandleResponse,true); _9.Page=_a; _1d.AddParam("cmd",_c); _1d.AddParam("c",_b); _1d.AddParam("b",_e); _1d.AddParam("hsid",_8); _1d.AddParam("cl",_d); _1d.AddParam("pgName",_f); _1d.AddParam("backLink",_10); _1d.AddParam("imgft",_11); _1d.AddParam("options",Apc.JS.ToJSON(_9)); _1d.AddParam("rand",Math.round(10000000000*Math.random())); var _1e=_1c.PageRequests(); _1e.AddRequest(_1d); var _1f=new _1c.Connection(_1e); _1f.Open(); }; function HandleResponse(_20){ if(_20.ReadyState==4){ if(_20.Status==200&&_20.ResponseText!=null){ try{ _7.innerHTML=_20.ResponseText; checkBackLink(); } catch(e){ } }else{ } } }; function checkBackLink(){ var _21=document.getElementById("tblImageSearchCatLabel"); if(_21!=null){ var _22=document.getElementById("disableBackLink"); if(_22!=null){ if(_22.value=="true"){ _21.removeAttribute("href"); _21.style.color="black"; _21.style.textDecoration="none"; _21.style.cursor="auto"; _21.onmouseover=function(){ _21.style.color="black"; _21.style.textDecoration="none"; _21.style.cursor="auto"; }; }else{ _21.setAttribute("href","javascript:SelectCat()"); _21.style.color="Blue"; _21.style.textDecoration="underline"; _21.style.cursor="pointer"; _21.onmouseover=function(){ _21.style.color="Blue"; _21.style.textDecoration="underline"; _21.style.cursor="pointer"; }; } } } }; }; } NamepaceManager.Register("Apc.JS"); if(typeof (Apc.JS.ImageSearch)=="undefined"){ Apc.JS.ISCommands={GetCategoryImages:1,GetUserImages:2,KeywordSearch:3,GetLatestImages:4,GetMostPopularImages:5,GetSimilarImages:6}; Apc.JS.ClientSideEvents={OnClick:1,OnMouseOver:2,OnMouseOut:3,AddFavorite:4,ShowSimilarImages:5,ViewDetails:6,Pager:100}; Apc.JS.ISOptions=function(){ return {ShowDesignButton:true,ShowImageCategoryButton:false,ShowMediumImageOnMouseOver:false,UseTinyCells:false,ClientEventHandler:"OnClientEvent",PageSize:8,Page:0,Init:function(){ return (this); }}.Init(arguments); }; Apc.JS.ImageSearch=function(_1,_2,_3,_4,_5){ var _6="There was a problem retrieving data from the server."; var _7=0; var _8="HttpHandlers/GetImageArray.ashx"; var _9=_1; var _a=null; var _b=Apc.JS.ISCommands.GetCategoryImages; var _c=""; var _d="All"; var _e=new Apc.JS.ISOptions(); var _f=0; var _10=0; var _11=_2; var _12=_3; var _13=_4; var _14=_5; this.SearchByCategory=function(_15){ _b=Apc.JS.ISCommands.GetCategoryImages; _c=_15; this.RequestPage(1); }; this.SearchByKeywords=function(_16){ _b=Apc.JS.ISCommands.KeywordSearch; _c=_16; this.RequestPage(1); }; this.SearchLatestImages=function(_17){ _b=Apc.JS.ISCommands.GetLatestImages; _c=_17; this.RequestPage(1); }; this.ShowSimilarImages=function(_18){ _b=Apc.JS.ISCommands.GetSimilarImages; _c=_18; this.RequestPage(1); }; this.SearchMostPopularImages=function(){ _b=Apc.JS.ISCommands.GetMostPopularImages; _c=Apc.JS.ImageSource.System+":"+"100"; this.RequestPage(1); }; this.SearchUserImages=function(_19){ if(typeof (_19)=="undefined"){ _c=Apc.JS.ImageSource.User+":"+Apc.JS.BCEditMode.Logo; }else{ _c=Apc.JS.ImageSource.User+":"+_19; } _b=Apc.JS.ISCommands.GetUserImages; this.RequestPage(1); }; this.GetType=function(){ return "Apc.JS.ImageSearch"; }; this.RequestPage=function(_1a){ _7=_1a-1; this.SendRequest(); }; this.Init=function(_1b){ _a=document.getElementById(_1b[0]); if(_1b.length>1){ if(_1b[1]!=null){ _e=_1b[1]; } } if(_1b.length>2){ _d=_1b[2]; } if(_1b.length>3){ _f=_1b[3]; } if(_1b.length>4){ _10=_1b[4]; } }; this.AutoSearch=function(_1c,_1d,_1e){ _b=_1c; _c=_1d; this.RequestPage(_1e); }; this.SendRequest=function(){ var _1f=Apc.JS.Ajax; var _20=_1f.Request("POST",_8,HandleResponse,true); _e.Page=_7; _20.AddParam("cmd",_b); _20.AddParam("b",_f); _20.AddParam("c",_c); _20.AddParam("bw",_10); _20.AddParam("hsid",_9); _20.AddParam("pgName",_11); _20.AddParam("backLink",_12); _20.AddParam("imgft",_13); _20.AddParam("it",_14); _20.AddParam("cl",_d); _20.AddParam("options",Apc.JS.ToJSON(_e)); _20.AddParam("rand",Math.round(10000000000*Math.random())); var _21=_1f.PageRequests(); _21.AddRequest(_20); var _22=new _1f.Connection(_21); _22.Open(); }; function HandleResponse(_23){ if(_23.ReadyState==4){ if(_23.Status==200&&_23.ResponseText!=null){ try{ _a.innerHTML=_23.ResponseText; if(typeof (MouseFollower)!="undefined"){ MouseFollower.HideLayer(); } if(_a.id!="UserImagesDisplayArea"){ checkBackLink(); } } catch(e){ } }else{ } } }; function checkBackLink(){ var _24=document.getElementById("tblImageSearchCatLabel"); if(_24!=null){ _24.setAttribute("href","javascript:SelectCat()"); _24.style.color="Blue"; _24.style.textDecoration="underline"; _24.style.cursor="pointer"; _24.onmouseover=function(){ _24.style.color="Blue"; _24.style.textDecoration="underline"; _24.style.cursor="pointer"; }; } }; }; } if(typeof (Apc.JS.ImageUsage)=="undefined"){ Apc.JS.ImageUsage={Unknown:0,MultiPurpose:1,Logo:2,Background:3}; Apc.JS.ImageSource={Unknown:0,Uploaded:1,System:2,User:3}; Apc.JS.ImageEffectNames={Blur:"Blur",BlurUp:"BlurU",BlurDown:"BlurD",Contrast:"Contrast",ContrastUp:"ContrastU",ContrastDown:"ContrastD",Invert:"Invert",HFlip:"HFlip",GreyScale:"GreyScale",AutoLevel:"AutoLevel",BlackAndWhite:"BlackAndWhite",Mirror:"Mirror",Brightness:"Brightness",BrightnessUp:"BrightnessU",BrightnessDown:"BrightnessD",Sharpness:"Sharpness",VFlip:"VFlip",Rotation:"Rotation",RotateClockWise:"RotateClockWise",RotateAntiClockWise:"RotateClockWise",ReserAll:"ResetAllEffects"}; Apc.JS.BCEditCommand={None:0,AddBackSide:1,ApplyEditBg:2,ApplyEditLogo:3,BeginEditBg:4,BeginEditLogo:5,CancelEditBg:6,CancelEditLogo:7,DeleteBackSide:8,DeleteBgImage:9,DeleteLogo:10,EditBgColor:11,EditBgCropBox:12,EditBgImage:13,EditLogo:14,EditLogoCropBox:15,EditPage:16,EditTextLine:17,EndEditBg:18,EndEditLogo:19,SelectLayout:20,SelectSide:21}; Apc.JS.BCParameters={BgColor:"bc",Command:"cmd",CustomerId:"hsid",CropTop:"cy",CropLeft:"cx",CropWidth:"cw",CropHeight:"ch",Page:"pg",RenderMode:"rm",RenderSize:"imgsz",ImageEffects:"imgfx",LayoutId:"lid",EditMode:"em",ImageKey:"in",TextLines:"txtLines",ImageLeft:"x",ImageTop:"y",ImageWidth:"w",ImageHeight:"h",ProductTemplateId:"pd",UserImageid:"ii"}; Apc.JS.BCEditMode={None:0,Logo:1,Background:2}; Apc.JS.BCRenderMode={Design:0,DesignWithoutLogo:1,DesignWithSelectedLayout:2,LogoOnly:3,PDFDocument:4}; Apc.JS.ImageSize={None:0,Large:1,Medium:2,Thumbnail:3,Tiny:4,Preview:5}; Apc.JS.ColorOption={NoColor:0,OneColor:1,TwoColor:2,ThreeColor:3,FourColor:4}; Apc.JS.BackgroundOption={SolidColor:0,Image:1,LayerMask:2}; Apc.JS.LSPage={BCD:"Designer",ICD:"CategoryDisplay",BCE:"Editor",Search:"Search"}; Apc.JS.MessageDisplayCommands={ISMSG:1,UploadMSG:2,CMSG:3,AddBackMSG:4,DSGClickMSG:5,PrdChangeMSG:6}; Apc.JS.ImageFit={SmallerSameRatio:1,Smaller:2,Exact:4,Larger:8,LargerSameRatio:16}; Apc.JS.DesignerMode={Full:0,SimpleFileUpload:1}; } NamepaceManager.Register("Apc.JS"); if(typeof (Apc.JS.TextValue)=="undefined"){ Apc.JS.TextValue=function(){ this.TextType="G"; this.Text=""; }; Apc.JS.TextLineData=function(){ this.Bold=0; this.Color="000000"; this.Font="Arial"; this.FontSize=8; this.Italics=0; this.Shadow=0; this.Underline=0; this.ControlId="ControlId"; this.TextValues=new Array(); }; Apc.JS.TextLineData.prototype={GetType:function(){ return "Apc.JS.TextLineData"; },clearTextValues:function(){ var _1=this.TextValues.length; for(j=0;j<_1;j++){ this.TextValues[j]=new Apc.JS.TextValue(); } },changeValue:function(_2,_3){ switch(_3){ case Apc.WC.TextItemValues.Bold: this.Bold=_3; break; case Apc.WC.TextItemValues.Color: this.Color=_3; break; case Apc.WC.TextItemValues.Font: this.Font=_3; break; case Apc.WC.TextItemValues.FontSize: this.FontSize=_3; break; case Apc.WC.TextItemValues.Italics: this.Italics=_3; break; case Apc.WC.TextItemValues.Shadow: this.Shadow=_3; break; case Apc.WC.TextItemValues.Underline: this.Underline=_3; break; case Apc.WC.TextItemValues.ControlId: this.ControlId=_3; break; case Apc.WC.TextItemValues.Texts: this.TextValues=_3; break; } }}; Apc.JS.ImageEffects=function(){ this.AutoLevel=false; this.BlackAndWhite=false; this.Brightness=0; this.Blur=0; this.Contrast=0; this.GreyScale=false; this.HFlip=false; this.ImageId=0; this.ImageSource=0; this.Invert=false; this.Mirror=false; this.Rotation=0; this.Sharpness=false; this.VFlip=false; }; Apc.JS.ImageEffects.prototype={MAX_BRIGHTNESS:7,MIN_BRIGHTNESS:0,MAX_CONTRAST:7,MIN_CONTRAST:0,MAX_AUTOLEVEL:1,MIN_AUTOLEVEL:0,MAX_BLUR:7,MIN_BLUR:0,ROTATION_STEP:15,ToggleValue:function(_4){ if(_4==false){ _4=true; }else{ _4=false; } return (_4); },ChangeImageValues:function(_5){ this.AutoLevel=_5.AutoLevel; this.BlackAndWhite=_5.BlackAndWhite; this.Brightness=_5.Brightness; this.Blur=_5.Blur; this.Contrast=_5.Contrast; this.GreyScale=_5.GreyScale; this.HFlip=_5.HFlip; this.ImageId=_5.ImageId; this.ImageSource=_5.ImageSource; this.Invert=_5.Invert; this.Mirror=_5.Mirror; this.Rotation=_5.Rotation; this.Sharpness=_5.Sharpness; this.VFlip=_5.VFlip; },ResetAllEffects:function(){ this.AutoLevel=false; this.BlackAndWhite=false; this.Brightness=0; this.Blur=0; this.Contrast=0; this.GreyScale=false; this.HFlip=false; this.Invert=false; this.Mirror=false; this.Rotation=0; this.Sharpness=false; this.VFlip=false; },ToggleAutoLevel:function(){ this.AutoLevel=this.ToggleValue(this.AutoLevel); },ToggleInvert:function(){ this.Invert=this.ToggleValue(this.Invert); },ToggleBlackAndWhite:function(){ this.BlackAndWhite=this.ToggleValue(this.BlackAndWhite); },ToggleGreyScale:function(){ this.GreyScale=this.ToggleValue(this.GreyScale); },ToggleHFlip:function(){ this.HFlip=this.ToggleValue(this.HFlip); },ToggleVFlip:function(){ this.VFlip=this.ToggleValue(this.VFlip); },ToggleMirror:function(){ this.Mirror=this.ToggleValue(this.Mirror); },ToggleSharpness:function(){ this.Sharpness=this.ToggleValue(this.Sharpness); },SetRotation:function(_6){ if(_6<=360&_6>=0){ this.Rotation=_6; } },RotateClockwise:function(){ var _7=this.Rotation; _7+=this.ROTATION_STEP; if(_7>=360){ _7=0; } this.Rotation=_7; },RotateAntiClockwise:function(){ var _8=this.Rotation; _8-=this.ROTATION_STEP; if(_8<=0){ _8+=360; } this.Rotation=_8; },SetBlur:function(_9){ if(_9<=this.MAX_BLUR&_9>=this.MIN_BLUR){ this.Blur=_9; } },BlurUp:function(){ if(this.Blurthis.MIN_BLUR){ this.Blur-=1; } },SetContrast:function(_a){ if(_a<=this.MAX_CONTRAST&_a>=this.MIN_CONTRAST){ this.Contrast=_a; } },ContrastUp:function(){ if(this.Contrastthis.MIN_CONTRAST){ this.Contrast-=1; } },SetBrightness:function(_b){ if(_b<=this.MAX_BRIGHTNESS&_b>=this.MIN_BRIGHTNESS){ this.Brightness=_b; } },BrightnessUp:function(){ if(this.Brightnessthis.MIN_BRIGHTNESS){ this.Brightness-=1; } }}; Apc.JS.CardPageData=function(){ this.DataLines=new Array(); this.LayoutId=0; this.BGImage=new Apc.JS.ImageEffects(); this.BGColor=""; this.Images=new Array(); }; Apc.JS.CardPageData.prototype={GetType:function(){ return "Apc.JS.CardPageData"; },addDataLine:function(_c){ this.DataLines[this.DataLines.length]=_c; },clearBG:function(){ this.BGImage=new Apc.JS.ImageEffects(); },deleteDataLine:function(_d){ if(typeof (_d)=="undefined"){ if(this.dataLines.length>0){ this.dataLines.splice(this.dataLines.length-1,1); } }else{ if(typeof (this.dataLines[_d])!="undefined"){ this.dataLines.splice(_d,1); } } },changeBGColor:function(_e){ this.BGColor=_e; },changeDataLine:function(_f){ if(_f.ControlId!=null&&_f.ControlId!=""){ var _10=false; for(var i=0;i_2e){ if(_27<_23){ w=_27; h=_24*(_27/_23); }else{ w=_23; h=_24; } }else{ if(_28<_24){ h=_28; w=_23*(_28/_24); }else{ w=_23; h=_24; } } x=_25+((_27-w)/2); y=_26+((_28-h)/2); return ([x,y,w,h]); },RestrictSizeAndPos:function(_2f,_30,_31,_32,_33,_34){ this.EnsureObjectsCreated(); _2f.maxoffl=_30[0]-_31; _2f.maxoffr=_31+_33-_2f.w-_30[0]; _2f.maxofft=_30[1]-_32; _2f.maxoffb=_32+_34-_2f.h-_30[1]; },RestrictCropLayer:function(){ this.EnsureObjectsCreated(); this.RestrictSizeAndPos(this.CropObject,this.CropObjectInitPos,this.SelectedImagePos[0],this.SelectedImagePos[1],this.SelectedImageSize[0],this.SelectedImageSize[1]); },RestrictLogoImageContainer:function(){ this.EnsureObjectsCreated(); this.RestrictSizeAndPos(this.LogoImageContainer,this.LogoImageContainerInitPos,this.BackgroundImage.x+this.BleedSize[0],this.BackgroundImage.y+this.BleedSize[1],this.BackgroundImage.w-(this.BleedSize[0]*2),this.BackgroundImage.h-(this.BleedSize[1]*2)); },RestrictLogoImage:function(){ this.EnsureObjectsCreated(); this.RestrictSizeAndPos(this.LogoImage,this.LogoImageInitPos,this.BackgroundImage.x+this.BleedSize[0],this.BackgroundImage.y+this.BleedSize[1],this.BackgroundImage.w-(this.BleedSize[0]*2),this.BackgroundImage.h-(this.BleedSize[1]*2)); },SetCropMode:function(_35){ this.EnsureObjectsCreated(); if(_35=="off"){ this.CropObject.hide(); this.BleedLayer.hide(); this.LogoImageContainer.div.style.background=""; var dx=this.LogoImage.x-this.LogoImageContainer.x; var dy=this.LogoImage.y-this.LogoImageContainer.y; this.LogoImageContainer.moveBy(dx,dy); this.LogoImage.moveBy(-dx,-dy); this.LogoImageContainer.resizeTo(this.LogoImage.w,this.LogoImage.h); this.LogoImageContainer.setScalable(true); this.LogoImageContainer.setResizable(false); this.LogoImageContainerResize(); this.LogoImageResizeFunction(); this.LogoImage.setScalable(true); this.LogoImage.setDraggable(true); this.RestrictLogoImageContainer(); this.RestrictLogoImage(); this.ImageProportion=this.LastSelectedImageProportion; this.OriginalSelectedAreaSize=this.LastSelectedAreaSize.slice(); var _38=this.ImageProportion; if(this.ImageProportion<1){ _38=1; } this.OriginalSelectedAreaPos=[this.LogoImage.x*_38,this.LogoImage.y*_38]; this.LogoImageContainer.show(); this.LogoImage.show(); this.BackgroundImage.show(); this.BackgroundImageGlass.show(); }else{ var _38=this.ImageProportion; if(this.ImageProportion<1){ _38=1; } this.CropObject.resizeTo(this.OriginalSelectedAreaSize[0]/_38,this.OriginalSelectedAreaSize[1]/_38); this.CropObject.moveTo(this.SelectedImagePos[0]+(this.OriginalSelectedAreaPos[0]/_38),this.SelectedImagePos[1]+(this.OriginalSelectedAreaPos[1]/_38)); this.CropObject.show(); this.CropObject.maximizeZ(); this.RestrictCropLayer(); if(this.DesignMode==Apc.JS.BCEditMode.Logo){ this.BleedLayer.hide(); this.BackgroundImage.hide(); }else{ this.BleedLayer.show(); this.CropObject.setScalable(true); this.CropObject.setResizable(false); this.LogoImageContainer.hide(); } this.CropResizeFunction(); this.LogoImageContainer.hide(); this.LogoImage.hide(); this.BackgroundImageGlass.hide(); } },KeepRatio:function(_39){ this.EnsureObjectsCreated(); if(this.DesignMode==Apc.JS.BCEditMode.Logo){ this.IsRatioKept=_39; if(this.IsRatioKept==true){ this.CropObject.setScalable(true); this.CropObject.setResizable(false); this.LogoImageContainer.setScalable(true); this.LogoImageContainer.setResizable(false); var _3a=1; if(this.ImageProportion<1){ _3a=this.LargeMediumRatio; } var w=this.LogoImageContainer.w>this.MinimumSize[0]*_3a?this.LogoImageContainer.w:this.MinimumSize[0]*_3a; var h=this.LogoImageContainer.h>this.MinimumSize[1]*_3a?this.LogoImageContainer.h:this.MinimumSize[1]*_3a; this.CropObject.resizeTo(w,h); var _3d=(this.SelectedImagePos[0]+this.SelectedImageSize[0])-(this.CropObject.w+this.CropObject.x); var _3e=(this.SelectedImagePos[1]+this.SelectedImageSize[1])-(this.CropObject.h+this.CropObject.y); if(_3d>0){ _3d=0; } if(_3e>0){ _3e=0; } this.CropObject.moveBy(_3d,_3e); this.CropResizeFunction(); }else{ this.CropObject.setScalable(false); this.CropObject.setResizable(true); this.LogoImageContainer.setScalable(false); this.LogoImageContainer.setResizable(true); } } },GetCroppedCoordinates:function(){ this.EnsureObjectsCreated(); var _3f=new Array(); _3f[0]=(this.CropObject.x-this.SelectedImagePos[0]); _3f[1]=(this.CropObject.y-this.SelectedImagePos[1]); _3f[2]=this.CropObject.w; _3f[3]=this.CropObject.h; return (_3f); },LogoImageResizeFunction:function(){ this.EnsureObjectsCreated(); this.RestrictLogoImage(); var _40=this.GetMaxSize(); this.LogoImage.maxw=_40[0]; this.LogoImage.maxh=_40[1]; },GetMaxSize:function(){ this.EnsureObjectsCreated(); var _41=this.BackgroundImage.w-(this.LogoImage.x-this.BackgroundImage.x)-(this.BleedSize[0]); var _42=this.BackgroundImage.h-(this.LogoImage.y-this.BackgroundImage.y)-(this.BleedSize[1]); var _43=this.OriginalSelectedAreaSize[0]; var _44=this.OriginalSelectedAreaSize[1]; if(_43<_41){ _41=_43; } if(_44<_42){ _42=_44; } return ([_41,_42]); },LogoImageContainerResize:function(){ this.EnsureObjectsCreated(); var _45=this.GetMaxContainerSize(); this.LogoImageContainer.maxw=_45[0]; this.LogoImageContainer.maxh=_45[1]; var _46=this.GetBestCoordinates([this.OriginalSelectedAreaSize[0],this.OriginalSelectedAreaSize[1]],[this.LogoImageContainer.x,this.LogoImageContainer.y],[this.LogoImageContainer.w,this.LogoImageContainer.h]); if(_46[2]_50){ _51=this.MinimumSize[1]; _52=_4f[2]*(this.MinimumSize[1]/_4f[3]); }else{ _52=this.MinimumSize[0]; _51=_4f[3]*(this.MinimumSize[0]/_4f[2]); } if(_4f[2]<_52||_4f[3]<_51){ _4f[2]=_52; _4f[3]=_51; } this.LogoImageContainer.minH=_51; this.LogoImageContainer.minW=_52; if(this.LogoImageContainer.w<_52||this.LogoImageContainer.h<_51){ this.LogoImageContainer.resizeTo(_4f[2],_4f[3]); } this.LogoImage.resizeTo(_4f[2],_4f[3]); var _53=this.FitRectIntoBG(_4f); this.LogoImage.moveTo(_53[0],_53[1]); this.RestrictLogoImageContainer(); this.RestrictLogoImage(); },FitRectIntoBG:function(_54){ this.EnsureObjectsCreated(); var _55=_54.slice(); if(_55[0]this.BackgroundImage.x+this.BackgroundImage.w-this.BleedSize[0]){ _55[0]=this.BackgroundImage.x+this.BackgroundImage.w-this.BleedSize[0]-_55[2]; } if(_55[1]this.BackgroundImage.y+this.BackgroundImage.h-this.BleedSize[1]){ _55[1]=this.BackgroundImage.y+this.BackgroundImage.h-this.BleedSize[1]-_55[3]; } return (_55); }}; Apc.JS.BGCropDesigner=function(_56,_57,_58,_59){ this.ObjectsCreated=false; }; Apc.JS.BGCropDesigner.prototype={EnsureObjectsCreated:function(){ if(!this.ObjectsCreated){ this.ObjectsCreated=true; } }}; Apc.JS.ImageEditor=function(_5a,_5b,_5c,_5d,_5e,_5f,_60,_61,_62,_63,_64,_65){ this.BGImageObject=_5a; this.LogoImageObject=_5b; this.SelectedImageObject=_5c; this.CurrentMode=_63; this.CropPos=_60.slice(); this.CropSize=_61.slice(); this.MinCropSize=_62; this.UserSessionId=_5e; this.GreyScale=_65; this.ImageEffectsObject=_5d; this.ProductCreatorBaseUrl=null; this.MediumImageRendererUrl=null; this.LogoImageName=null; this.SelectedImageInfo=null; this.ObjectsCreated=false; }; Apc.JS.ImageEditor.prototype={EnsureObjectsCreated:function(){ if(this.ObjectsCreated!=true){ this.ProductCreatorBaseUrl="HttpHandlers/GetProductImage.ashx?"; this.ProductCreatorBaseUrl+=Apc.JS.BCParameters.CustomerId+"="+this.UserSessionId; this.ProductCreatorBaseUrl+="&"+Apc.JS.BCParameters.Page+"="+page; this.MediumImageRendererUrl="HttpHandlers/GetMediumImage.ashx?"; this.MediumImageRendererUrl+="hsid="+this.UserSessionId; this.MediumImageRendererUrl+="&bw="+this.GreyScale; this.BCCommandHandlerUrl="HttpHandlers/CommandHandler.ashx"; this.LogoImageName="logo"; this.SelectedImageInfo=new Array(); this.ObjectsCreated=true; } },SetSelectedImage:function(id,_67){ this.EnsureObjectsCreated(); var _68=id.split(":"); var _69=_68[1]; var _6a=_68[0]; var url=this.MediumImageRendererUrl; url+="&id="+_69; url+="&c="+_6a; url+="&bw="+this.GreyScale; this.SelectedImageInfo=[_69,_6a]; this.SelectedImageObject.src=url; },SetCropPosAndSize:function(_6c,_6d){ this.CropPos=_6c.slice(); this.CropSize=_6d.slice(); },SetEditorMode:function(_6e){ this.EnsureObjectsCreated(); this.CurrentMode=_6e; },ResetAllEffects:function(){ this.ImageEffectsObject.ResetAllEffects(); this.UpdateImage(); },ApplyImageEffect:function(_6f,_70){ this.EnsureObjectsCreated(); var _71=this.ImageEffectsObject; switch(_6f){ case Apc.JS.ImageEffectNames.Blur: _71.SetBlur(_70); break; case Apc.JS.ImageEffectNames.BlurUp: _71.BlurUp(); break; case Apc.JS.ImageEffectNames.BlurDown: _71.BlurDown(); break; case Apc.JS.ImageEffectNames.Contrast: _71.SetContrast(_70); break; case Apc.JS.ImageEffectNames.ContrastUp: _71.ContrastUp(); break; case Apc.JS.ImageEffectNames.ContrastDown: _71.ContrastDown(); break; case Apc.JS.ImageEffectNames.Invert: _71.ToggleInvert(); break; case Apc.JS.ImageEffectNames.HFlip: _71.ToggleHFlip(); break; case Apc.JS.ImageEffectNames.GreyScale: _71.ToggleGreyScale(); break; case Apc.JS.ImageEffectNames.AutoLevel: _71.ToggleAutoLevel(); break; case Apc.JS.ImageEffectNames.Mirror: _71.ToggleMirror(); break; case Apc.JS.ImageEffectNames.Rotation: _71.SetRotation(_70); break; case Apc.JS.ImageEffectNames.RotateClockWise: _71.RotateClockwise(); break; case Apc.JS.ImageEffectNames.RotateAntiClockWise: _71.RotateAntiClockwise(); break; case Apc.JS.ImageEffectNames.Sharpness: _71.ToggleSharpness(); break; case Apc.JS.ImageEffectNames.Brightness: _71.SetBrightness(_70); break; case Apc.JS.ImageEffectNames.BrightnessUp: _71.BrightnessUp(); break; case Apc.JS.ImageEffectNames.BrightnessDown: _71.BrightnessDown(); break; case Apc.JS.ImageEffectNames.VFlip: _71.ToggleVFlip(); break; case Apc.JS.ImageEffectNames.BlackAndWhite: _71.ToggleBlackAndWhite(); break; } this.UpdateImage(); },SendCommand:function(_72,_73,_74){ var _75=Apc.JS.Ajax; var _76=this; var _77=null; if(_74==true){ _77=_76.HandleCommandResponse; } var _78=_75.Request("GET",this.BCCommandHandlerUrl,_77,true); _78.Context=this; _78.AddParam(Apc.JS.BCParameters.Command,_72); _78.AddParam(Apc.JS.BCParameters.CustomerId,this.UserSessionId); if(this.CurrentMode==Apc.JS.BCEditMode.Logo){ _78.AddParam(Apc.JS.BCParameters.ImageKey,this.LogoImageName); } if(_73!=null){ for(var i=0;i<_73.length;i++){ _78.AddParam(_73[i][0],_73[i][1]); } } _78.AddParam("rand",Math.round(10000000000*Math.random())); var _7a=_75.PageRequests(); _7a.AddRequest(_78); var _7b=new _75.Connection(_7a); _7b.Open(); },HandleCommandResponse:function(_7c){ if(_7c.ReadyState==4){ if(_7c.Status==200&&_7c.ResponseText!=null){ _7c.Context.RefreshDesign(); } } },RefreshDesign:function(){ var url=this.ProductCreatorBaseUrl; url+="&rand="+Math.round(10000000000*Math.random()); if(this.CurrentMode==Apc.JS.BCEditMode.Logo){ url+="&"+Apc.JS.BCParameters.RenderMode+"="+Apc.JS.BCRenderMode.LogoOnly; url+="&"+Apc.JS.BCParameters.ImageKey+"="+this.LogoImageName; this.LogoImageObject.swapImage(url); }else{ url+="&"+Apc.JS.BCParameters.RenderMode+"="+Apc.JS.BCRenderMode.Design; this.BGImageObject.swapImage(url); } },GetCropBox:function(){ this.EnsureObjectsCreated(); var x=this.LogoImageObject.x-this.BGImageObject.x; var y=this.LogoImageObject.y-this.BGImageObject.y; var w=this.LogoImageObject.w; var h=this.LogoImageObject.h; return ([x,y,w,h]); },GetCoordinatesParams:function(){ this.EnsureObjectsCreated(); var x=this.LogoImageObject.x-this.BGImageObject.x; var y=this.LogoImageObject.y-this.BGImageObject.y; var w=this.LogoImageObject.w; var h=this.LogoImageObject.h; var _86=[[Apc.JS.BCParameters.ImageLeft,(x)],[Apc.JS.BCParameters.ImageTop,(y)],[Apc.JS.BCParameters.ImageWidth,(w)],[Apc.JS.BCParameters.ImageHeight,(h)]]; return (_86); },GetCoordinates:function(){ this.EnsureObjectsCreated(); var x=this.LogoImageObject.x-this.BGImageObject.x; var y=this.LogoImageObject.y-this.BGImageObject.y; var w=this.LogoImageObject.w; var h=this.LogoImageObject.h; return ([x,y,w,h]); },ApplyChanges:function(){ this.EnsureObjectsCreated(); if(this.CurrentMode==Apc.JS.BCEditMode.Logo){ var _8b=this.GetCoordinatesParams(); this.SendCommand(Apc.JS.BCEditCommand.ApplyEditLogo,_8b,true); }else{ this.SendCommand(Apc.JS.BCEditCommand.ApplyEditBg,null,true); } },RenderBGDesign:function(){ this.EnsureObjectsCreated(); var url=this.ProductCreatorBaseUrl; if(this.CurrentMode==Apc.JS.BCEditMode.Logo){ url+="&rm="+Apc.JS.BCRenderMode.DesignWithoutLogo; } url+="&rand="+Math.round(10000000000*Math.random()); this.BGImageObject.swapImage(url); },GetImageEncryptedCode:function(){ this.EnsureObjectsCreated(); var _8d=new Apc.JS.CardPageData(); _8d.LayoutId=1; _8d.BGImage=this.ImageEffectsObject; var _8e=new Apc.JS.Encryption(_8d,"3,"+"3,"+"3,"+"5,"+"5,"+"5",15); return (_8e.getImageEffectsEncodedText()); },UpdateImage:function(){ this.EnsureObjectsCreated(); var _8f=new Array(); _8f[0]=[Apc.JS.BCParameters.ImageEffects,this.GetImageEncryptedCode()]; if(this.CurrentMode==Apc.JS.BCEditMode.Logo){ this.SendCommand(Apc.JS.BCEditCommand.EditLogo,_8f,true); }else{ this.SendCommand(Apc.JS.BCEditCommand.EditBgImage,_8f,true); } },ApplyCrop:function(_90,_91){ this.EnsureObjectsCreated(); this.CropPos=_90; this.CropSize=_91; this.ImageEffectsObject.ImageId=this.SelectedImageInfo[0]; this.ImageEffectsObject.ImageSource=this.SelectedImageInfo[1]; var _92=[[Apc.JS.BCParameters.CropLeft,this.CropPos[0]],[Apc.JS.BCParameters.CropTop,this.CropPos[1]],[Apc.JS.BCParameters.CropWidth,this.CropSize[0]],[Apc.JS.BCParameters.CropHeight,this.CropSize[1]],[Apc.JS.BCParameters.ImageEffects,this.GetImageEncryptedCode()]]; var cmd=Apc.JS.BCEditCommand.EditBgCropBox; if(this.CurrentMode==Apc.JS.BCEditMode.Logo){ cmd=Apc.JS.BCEditCommand.EditLogoCropBox; } this.UpdateImage(); this.SendCommand(cmd,_92,true); this.UpdateImage(); },RefreshBGDesign:function(_94){ this.EnsureObjectsCreated(); var url=this.ProductCreatorBaseUrl+"&"+Apc.JS.BCParameters.RenderMode+"="; url+="&rand="+Math.round(10000000000*Math.random()); if(this.CurrentMode==Apc.JS.BCEditMode.Logo){ url+=Apc.JS.BCRenderMode.DesignWithoutLogo; }else{ url+=Apc.JS.BCRenderMode.Design; } this.BGImageObject.swapImage(url+Apc.JS.BCRenderMode.Design); }}; Apc.JS.CroppedImage=function(){ this.ImageType=Apc.JS.BCEditMode.Logo; this.SourceImageId=0; this.SourceImageSize=[0,0]; this.CroppedPos=[0,0]; this.CroppedSize=[0,0]; }; Apc.JS.CroppedImagesManager=function(){ this.CroppedImages=null; this.ObjectsCreated=false; }; Apc.JS.CroppedImagesManager.prototype={ensureObjectsCreated:function(){ if(this.ObjectsCreated!=true){ this.CroppedImages=new Array(); this.ObjectsCreated=true; } },addCroppedImage:function(_96){ this.ensureObjectsCreated(); var _97=this.getCroppedImageIndex(_96.SourceImageId,_96.ImageType); this.CroppedImages[_97]=_96; },editCroppedImage:function(_98){ this.ensureObjectsCreated(); addCroppedImage(_98); },getCroppedImageIndex:function(_99,_9a){ this.ensureObjectsCreated(); var _9b=this.CroppedImages.length; for(var i=0;i0){ url+="&"+Apc.JS.BCParameters.RenderSize+"="+Apc.JS.ImageSize.Preview; _7[_5].src=url; } }; function GetType(){ return "Apc.JS.ProductCreator"; }; this.GetPageCount=function(){ return (_6.length); }; this.DeleteBackSide=function(){ if(typeof (_6[1])!="undefined"){ _6.splice(1,1); _5=0; this.SendCommand(Apc.JS.BCEditCommand.DeleteBackSide,null,false); } }; this.AddBackSide=function(_29){ var _2a=[[Apc.JS.BCParameters.ProductTemplateId,_29]]; this.SendCommand(Apc.JS.BCEditCommand.AddBackSide,_2a,true); }; this.DeleteBG=function(){ _6[_5].clearBG(); this.SendCommand(Apc.JS.BCEditCommand.DeleteBgImage,null,true); }; this.DeleteImage=function(_2b){ this.SendCommand(Apc.JS.BCEditCommand.DeleteLogo,[[Apc.JS.BCParameters.ImageKey,_2b]],true); }; this.ChangeBGColor=function(_2c){ _6[_5].changeBGColor(_2c); this.SendCommand(Apc.JS.BCEditCommand.EditBgColor,[[Apc.JS.BCParameters.BgColor,_2c]],true); }; this.ChangeDataLines=function(_2d){ _6[_5].changeDataLines(_2d); this.UpdateTextLine(_6[_5].DataLines); }; this.ClearTextValues=function(){ var len=_6[_5].DataLines.length; for(i=0;i127)&&(c<2048)){ _9+=String.fromCharCode((c>>6)|192); _9+=String.fromCharCode((c&63)|128); }else{ _9+=String.fromCharCode((c>>12)|224); _9+=String.fromCharCode(((c>>6)&63)|128); _9+=String.fromCharCode((c&63)|128); } } } return _9; },getImageEffectsArray:function(id){ var _d; if(typeof (id)=="undefined"){ _d=this.CardData.BGImage; }else{ if(id0){ for(var i=0;i=0&&document.all&&this.db&&!this.op); this.iemac=!!(this.ie&&this.n.indexOf("mac")>=0); this.ie4=!!(this.ie&&!document.getElementById); this.n4=!!(document.layers&&typeof document.classes!=dd_u); this.n6=!!(typeof window.getComputedStyle!=dd_u&&typeof document.createRange!=dd_u); this.w3c=!!(!this.op&&!this.ie&&!this.n6&&document.getElementById); this.ce=!!(document.captureEvents&&document.releaseEvents&&!this.n6); this.px=this.n4?"":"px"; this.tWait=this.w3c?40:10; this.noRecalc=false; }; var dd=new WZDD(); dd.Int=function(_1,_2){ return isNaN(_2=parseInt(_1))?0:_2; }; dd.getWndW=function(){ return dd.Int((dd.db&&!dd.op&&!dd.w3c&&dd.db.clientWidth)?dd.db.clientWidth:(window.innerWidth||0)); }; dd.getWndH=function(){ return dd.Int((dd.db&&!dd.op&&!dd.w3c&&dd.db.clientHeight)?dd.db.clientHeight:(window.innerHeight||0)); }; dd.getScrollX=function(){ return dd.Int(window.pageXOffset||(dd.db?dd.db.scrollLeft:0)); }; dd.getScrollY=function(){ return dd.Int(window.pageYOffset||(dd.db?dd.db.scrollTop:0)); }; dd.getPageXY=function(_3){ if(dd.n4&&_3){ dd.x=_3.pageX||0; dd.y=_3.pageY||0; }else{ dd.x=dd.y=0; while(_3){ dd.x+=dd.Int(_3.offsetLeft); dd.y+=dd.Int(_3.offsetTop); _3=_3.offsetParent||null; } } }; dd.getCssXY=function(_4){ if(_4.div){ if(dd.n4){ _4.cssx=_4.div.x; _4.cssy=_4.div.y; }else{ if(dd.ie4){ _4.cssx=_4.css.pixelLeft; _4.cssy=_4.css.pixelTop; }else{ _4.css.left=_4.css.top=0+dd.px; dd.getPageXY(_4.div); _4.cssx=_4.x-dd.x; _4.cssy=_4.y-dd.y; _4.css.left=_4.cssx+dd.px; _4.css.top=_4.cssy+dd.px; } } }else{ _4.cssx=0; _4.cssy=0; } }; dd.getImgW=function(_5){ return _5?dd.Int(_5.width):0; }; dd.getImgH=function(_6){ return _6?dd.Int(_6.height):0; }; dd.getDivW=function(_7){ return dd.Int(dd.n4?(_7.div?_7.div.clip.width:0):_7.div?(_7.div.offsetWidth||_7.css.pixelWidth||_7.css.width||0):0); }; dd.getDivH=function(_8){ return dd.Int(dd.n4?(_8.div?_8.div.clip.height:0):_8.div?(_8.div.offsetHeight||_8.css.pixelHeight||_8.css.height||0):0); }; dd.getWH=function(_9){ _9.w=dd.getDivW(_9); _9.h=dd.getDivH(_9); if(_9.css){ _9.css.width=_9.w+dd.px; _9.css.height=_9.h+dd.px; _9.dw=dd.getDivW(_9)-_9.w; _9.dh=dd.getDivH(_9)-_9.h; _9.css.width=(_9.w-_9.dw)+dd.px; _9.css.height=(_9.h-_9.dh)+dd.px; }else{ _9.dw=_9.dh=0; } }; dd.getCssProp=function(_a,_b,_c,_d){ if(_a&&dd.n6){ return ""+window.getComputedStyle(_a,null).getPropertyValue(_b); } if(_a&&_a.currentStyle){ return ""+eval("_a.currentStyle."+_c); } if(_a&&_a.style){ return ""+eval("_a.style."+_c); } if(_a&&dd.n4){ return ""+eval("_a."+_d); } return ""; }; dd.getDiv=function(_e,_f){ _f=_f||document; if(dd.n4){ if(_f.layers[_e]){ return _f.layers[_e]; } for(var d_i=_f.layers.length;d_i;){ var d_y=dd.getDiv(_e,_f.layers[--d_i].document); if(d_y){ return d_y; } } } if(dd.ie){ return _f.all[_e]||null; } if(_f.getElementById){ return _f.getElementById(_e)||null; } return null; }; dd.getImg=function(d_o,_13,_14,d_w){ d_w=d_w||window; var _16; if(document.images&&(_16=d_w.document.images[_13])){ if(_14){ if(dd.n4){ dd.getPageXY(d_w); d_o.defx=_16.x+dd.x; d_o.defy=_16.y+dd.y; }else{ dd.getPageXY(_16); d_o.defx=dd.x; d_o.defy=dd.y; } } return _16; } if(dd.n4){ for(var d_i=d_w.document.layers.length;d_i;){ var d_y=dd.getImg(d_o,_13,_14,d_w.document.layers[--d_i]); if(d_y){ return d_y; } } } return null; }; dd.getParent=function(d_o,d_p){ if(dd.n4){ for(var d_i=dd.elements.length;d_i;){ if(!((d_p=dd.elements[--d_i]).is_image)&&d_p.div&&(d_p.div.document.layers[d_o.name]||d_o.oimg&&d_p.div.document.images[d_o.oimg.name])){ d_p.addChild(d_o,d_p.detach,1); } } }else{ d_p=d_o.is_image?dd.getImg(d_o,d_o.oimg.name):(d_o.div||null); while(d_p&&!!(d_p=d_p.offsetParent||d_p.parentNode||null)){ if(d_p.ddObj){ d_p.ddObj.addChild(d_o,d_p.ddObj.detach,1); break; } } } }; dd.getCmd=function(d_o,_1d,_1e){ var d_i=d_o.id.indexOf(_1d),d_j,d_y=(d_i>=0)*1; if(d_y){ d_j=d_i+_1d.length; if(_1e){ d_o.cmd+=d_o.id.substring(d_i,d_j); } d_o.id=d_o.id.substring(0,d_i)+d_o.id.substring(d_j); } return d_y; }; dd.getCmdVal=function(d_o,_23,_24,_25){ var d_i=d_o.id.indexOf(_23),d_j,d_y=(d_o.id.indexOf(_23)>=0)?dd.Int(d_o.id.substring(d_o.id.indexOf(_23)+_23.length)):_25?-1:0; if(!_25&&d_y||_25&&d_y>=0){ d_j=d_i+_23.length+(""+d_y).length; if(_24){ d_o.cmd+=d_o.id.substring(d_i,d_j); } d_o.id=d_o.id.substring(0,d_i)+d_o.id.substring(d_j); } return d_y; }; dd.addElt=function(d_o,d_p){ dd.elements[d_o.name]=dd.elements[d_o.index=dd.elements.length]=d_o; if(d_p){ d_p.copies[d_o.name]=d_p.copies[d_p.copies.length]=d_o; } }; dd.mkWzDom=function(){ var d_o,d_l=dd.elements.length,d_i; for(d_i=d_l;d_i;){ dd.getParent(dd.elements[--d_i]); } for(d_i=d_l;d_i;){ if((d_o=dd.elements[--d_i]).children&&!d_o.parent){ for(var d_j=d_o.children.length;d_j;){ --d_j; d_o.children[d_j].setZ(d_o.z+d_o.children[d_j].z,1); } } } }; dd.addProps=function(d_o){ if(d_o.is_image){ d_o.div=dd.getDiv(d_o.id); d_o.css=(d_o.div&&typeof d_o.div.style!=dd_u)?d_o.div.style:null; d_o.nimg=(dd.n4&&d_o.div)?d_o.div.document.images[0]:(document.images[d_o.id+"NI1m6G"]||null); if(!d_o.noalt&&!dd.noalt&&d_o.nimg&&d_o.oimg){ d_o.nimg.alt=d_o.oimg.alt||""; d_o.nimg.title=d_o.oimg.title; d_o.nimg.onmouseover=d_o.oimg.onmouseover; d_o.nimg.onmouseout=d_o.oimg.onmouseout; } d_o.bgColor=""; }else{ d_o.bgColor=dd.getCssProp(d_o.div,"background-color","backgroundColor","bgColor").toLowerCase(); if(dd.n6&&d_o.div){ var d_c=d_o.bgColor.toLowerCase(); if(d_c.indexOf("rgb")>=0){ d_c=d_c.substring(4,d_c.length-1).split(","); d_o.bgColor="#"; for(var d_l=d_c.length,d_i=0;d_i"; this.t_htm="
"+this.htm+"
"; }else{ if(!!(this.div=dd.getDiv(this.id))&&typeof this.div.style!=dd_u){ this.css=this.div.style; } dd.getWH(this); if(this.div){ this.div.ddObj=this; this.div.pos_rel=(""+(this.div.parentNode?this.div.parentNode.tagName:this.div.parentElement?this.div.parentElement.tagName:"").toLowerCase().indexOf("body")<0); } dd.getPageXY(this.div); this.defx=this.x=dd.x; this.defy=this.y=dd.y; dd.getCssXY(this); this.defz=dd.Int(dd.getCssProp(this.div,"z-index","zIndex","zIndex")); } this.defw=this.w||0; this.defh=this.h||0; }; DDObj.prototype.setPickFunc=function(d_x){ this.pickFunc=d_x; }; DDObj.prototype.setDragFunc=function(d_x){ this.dragFunc=d_x; }; DDObj.prototype.setResizeFunc=function(d_x){ this.resizeFunc=d_x; }; DDObj.prototype.setDropFunc=function(d_x){ this.dropFunc=d_x; }; DDObj.prototype.moveBy=function(d_x,d_y,_52,d_o){ if(!this.div){ return; } this.x+=(d_x=dd.Int(d_x)); this.y+=(d_y=dd.Int(d_y)); if(!_52||this.is_image||this.parent!=this.defparent){ (d_o=this.css||this.div).left=(this.cssx+=d_x)+dd.px; d_o.top=(this.cssy+=d_y)+dd.px; } for(var d_i=this.children.length;d_i;){ if(!(d_o=this.children[--d_i]).detached){ d_o.moveBy(d_x,d_y,1); } d_o.defx+=d_x; d_o.defy+=d_y; } }; DDObj.prototype.moveTo=function(d_x,d_y){ this.moveBy(dd.Int(d_x)-this.x,dd.Int(d_y)-this.y); }; DDObj.prototype.hide=function(d_m,d_o,d_p){ if(this.div&&this.visible){ d_p=this.css||this.div; if(d_m&&!dd.n4){ this.display=dd.getCssProp(this.div,"display","display","display"); if(this.oimg){ this.oimg.display=dd.getCssProp(this.oimg,"display","display","display"); this.oimg.style.display="none"; } d_p.display="none"; dd.recalc(); }else{ d_p.visibility="hidden"; } } this.visible=false; for(var d_i=this.children.length;d_i;){ if(!(d_o=this.children[--d_i]).detached){ d_o.hide(d_m); } } }; DDObj.prototype.show=function(d_o,d_p){ if(this.div){ d_p=this.css||this.div; if(d_p.display&&d_p.display=="none"){ d_p.display=this.display||"block"; if(this.oimg){ this.oimg.style.display=this.oimg.display||"inline"; } dd.recalc(); }else{ d_p.visibility="visible"; } } this.visible=true; for(var d_i=this.children.length;d_i;){ if(!(d_o=this.children[--d_i]).detached){ d_o.show(); } } }; DDObj.prototype.resizeTo=function(d_w,d_h,d_o){ if(!this.div){ return; } d_w=(this.w=dd.Int(d_w))-this.dw; d_h=(this.h=dd.Int(d_h))-this.dh; if(dd.n4){ this.div.resizeTo(d_w,d_h); if(this.is_image){ this.write(""); (this.nimg=this.div.document.images[0]).src=this.src; } }else{ if(typeof this.css.pixelWidth!=dd_u){ this.css.pixelWidth=d_w; this.css.pixelHeight=d_h; if(this.is_image){ (d_o=this.nimg.style).pixelWidth=d_w; d_o.pixelHeight=d_h; } }else{ this.css.width=d_w+dd.px; this.css.height=d_h+dd.px; if(this.is_image){ (d_o=this.nimg).width=d_w; d_o.height=d_h; if(!d_o.complete){ d_o.src=this.src; } } } } }; DDObj.prototype.resizeBy=function(_61,_62){ this.resizeTo(this.w+dd.Int(_61),this.h+dd.Int(_62)); }; DDObj.prototype.swapImage=function(d_x,_64){ if(!this.nimg){ return; } this.nimg.src=d_x; this.src=this.nimg.src; if(_64){ for(var d_i=this.copies.length;d_i;){ --d_i; this.copies[d_i].src=this.copies[d_i].nimg.src=this.nimg.src; } } }; DDObj.prototype.setBgColor=function(d_x){ if(dd.n4&&this.div){ this.div.bgColor=d_x; }else{ if(this.css){ this.css.background=d_x; } } this.bgColor=d_x; }; DDObj.prototype.write=function(d_x,d_o){ this.text=d_x; if(!this.div){ return; } if(dd.n4){ (d_o=this.div.document).open(); d_o.write(d_x); d_o.close(); dd.getWH(this); }else{ this.css.height="auto"; this.div.innerHTML=d_x; if(!dd.ie4){ dd.recalc(); } if(dd.ie4||dd.n6){ setTimeout("dd.recalc();",0); } } }; DDObj.prototype.copy=function(d_n,d_p,d_b){ if(!this.oimg){ return; } d_b=(dd.ie&&document.all.tags("body"))?document.all.tags("body")[0]:document.getElementsByTagName?(document.getElementsByTagName("body")[0]||dd.db):dd.db; for(d_n=d_n||1;d_n>0;--d_n){ var d_l=this.copies.length,d_o=new DDObj(this.name+this.cmd,d_l+1); if(dd.n4){ d_o.id=(d_p=new Layer(d_o.w)).name; d_p.clip.height=d_o.h; d_p.visibility="show"; (d_p=d_p.document).open(); d_p.write(d_o.htm); d_p.close(); }else{ if(d_b&&d_b.insertAdjacentHTML){ d_b.insertAdjacentHTML("AfterBegin",d_o.t_htm); }else{ if(document.createElement&&d_b&&d_b.appendChild){ d_b.appendChild(d_p=document.createElement("dIi15v")); d_p.innerHTML=d_o.htm; d_p.id=d_o.id; d_p.style.position="absolute"; d_p.style.width=d_o.w+"px"; d_p.style.height=d_o.h+"px"; }else{ if(d_b&&d_b.innerHTML){ d_b.innerHTML+=d_o.t_htm; } } } } d_o.defz=this.defz+1+d_l; dd.addProps(d_o); d_o.original=this; dd.addElt(d_o,this); if(this.parent){ this.parent.addChild(d_o,this.detached); d_o.defparent=this.defparent; } d_o.moveTo(d_o.defx=this.defx,d_o.defy=this.defy); if(dd.n4){ d_o.defsrc=d_o.src=this.defsrc; } d_o.swapImage(this.src); } }; DDObj.prototype.addChild=function(_6e,_6f,_70){ if(typeof _6e!="object"){ _6e=dd.elements[_6e]; } if(_6e.parent&&_6e.parent==this||_6e==this||!_6e.is_image&&_6e.defparent&&!_70){ return; } this.children[this.children.length]=this.children[_6e.name]=_6e; _6e.detached=_6f||0; if(_70){ _6e.defparent=this; }else{ if(this==_6e.defparent&&_6e.is_image){ dd.getImg(this,_6e.oimg.name,1); } } if(!_6e.defparent||this!=_6e.defparent){ _6e.defx=_6e.x; _6e.defy=_6e.y; } if(!_6f){ _6e.defz=_6e.defz+this.defz-(_6e.parent?_6e.parent.defz:0)+(!_6e.is_image*1); _6e.setZ(_6e.z+this.z-(_6e.parent?_6e.parent.z:0)+(!_6e.is_image*1),1); } if(_6e.parent){ _6e.parent.removeChild(_6e,1); } _6e.parent=this; }; DDObj.prototype.removeChild=function(_71,_72){ if(typeof _71!="object"){ _71=this.children[_71]; } var _73=this.children,_74=new Array(); for(var d_i=0;d_i<_73.length;d_i++){ if(_73[d_i]!=_71){ _74[_74.length]=_73[d_i]; } } this.children=_74; _71.parent=null; if(!_72){ _71.detached=_71.defp=0; if(_71.is_image){ dd.getImg(_71,_71.oimg.name,1); } } }; DDObj.prototype.attachChild=function(_76){ (_76=(typeof _76!="object")?this.children[_76]:_76).detached=0; _76.setZ(_76.defz+this.z-this.defz,1); }; DDObj.prototype.detachChild=function(_77){ (_77=(typeof _77!="object")?this.children[_77]:_77).detached=1; }; DDObj.prototype.setZ=function(d_x,_79,d_o){ if(_79){ for(var _7b=d_x-this.z,d_i=this.children.length;d_i;){ if(!(d_o=this.children[--d_i]).detached){ d_o.setZ(d_o.z+_7b,1); } } } dd.z=Math.max(dd.z,this.z=this.div?((this.css||this.div).zIndex=d_x):0); }; DDObj.prototype.maximizeZ=function(){ this.setZ(dd.z+1,1); }; DDObj.prototype._resetZ=function(d_o){ if(this.re_z||dd.re_z){ this.setZ(this.defz); for(var d_i=this.children.length;d_i;){ if(!(d_o=this.children[--d_i]).detached){ d_o.setZ(d_o.defz); } } } }; DDObj.prototype.setOpacity=function(d_x){ this.opacity=d_x; this._setOpaRel(1,1); }; DDObj.prototype._setOpaRel=function(d_x,_81,d_y,d_o){ if(this.css&&(this.diaphan||_81)){ d_y=this.opacity*d_x; if(typeof this.css.MozOpacity!=dd_u){ this.css.MozOpacity=d_y; }else{ if(typeof this.css.filter!=dd_u){ this.css.filter="Alpha(opacity="+parseInt(100*d_y)+")"; }else{ this.css.opacity=d_y; } } for(var d_i=this.children.length;d_i;){ if(!(d_o=this.children[--d_i]).detached){ d_o._setOpaRel(d_x,1); } } } }; DDObj.prototype.setCursor=function(d_x){ this._setCrs(this.cursor=(d_x.indexOf("c:")+1)?d_x.substring(2):d_x); }; DDObj.prototype._setCrs=function(d_x){ if(this.css){ this.css.cursor=((!dd.ie||dd.iemac)&&d_x=="hand")?"pointer":d_x; } }; DDObj.prototype.setDraggable=function(d_x){ this.nodrag=!d_x*1; this._setCrs(d_x?this.cursor:"auto"); }; DDObj.prototype.setResizable=function(d_x){ this.resizable=d_x*1; if(d_x){ this.scalable=0; } }; DDObj.prototype.setScalable=function(d_x){ this.scalable=d_x*1; if(d_x){ this.resizable=0; } }; DDObj.prototype.setHorizontal=function(d_x){ this.horizontal=d_x*1; }; DDObj.prototype.setVertical=function(d_x){ this.vertical=d_x*1; }; DDObj.prototype.getEltBelow=function(_8c,d_x,d_y){ var d_o,_90=-1,d_i=dd.elements.length; while(d_i--){ d_o=dd.elements[d_i]; d_x=d_o.x-this.w/2; d_y=d_o.y-this.h/2; if(d_o.visible&&d_o.z=d_x&&this.x<=d_x+d_o.w&&this.y>=d_y&&this.y<=d_y+d_o.h){ if(d_o.z>_90){ _90=d_o.z; _8c=d_o; } } } return _8c; }; DDObj.prototype.del=function(_92,d_o){ var d_i,d_l; if(this.parent&&this.parent.removeChild){ this.parent.removeChild(this); } if(this.original){ this.hide(); if(this.original.copies){ _92=new Array(); for(d_l=this.original.copies.length,d_i=0;d_i0||dd.obj.maxoffr+1&&(d_y=dd.obj.defx+dd.obj.maxoffr)-d_x<0)?d_y:d_x); }; dd.maxOffY=function(d_x,d_y){ return ((dd.obj.maxofft+1&&(d_y=dd.obj.defy-dd.obj.maxofft)-d_x>0||dd.obj.maxoffb+1&&(d_y=dd.obj.defy+dd.obj.maxoffb)-d_x<0)?d_y:d_x); }; dd.inWndW=function(d_x,d_y){ var _af=dd.getScrollX(),_b0=dd.getWndW(); return (((d_y=_af+2)-d_x>0)||((d_y=_af+_b0+dd.obj.w-2)-d_x<0)?d_y:d_x); }; dd.inWndH=function(d_x,d_y){ var _b3=dd.getScrollY(),_b4=dd.getWndH(); return (((d_y=_b3+2)-d_x>0)||((d_y=_b3+_b4+dd.obj.h-2)-d_x<0)?d_y:d_x); }; dd.limW=function(d_w){ return ((dd.obj.minw-d_w>0)?dd.obj.minw:(dd.obj.maxw>0&&dd.obj.maxw-d_w<0)?dd.obj.maxw:d_w); }; dd.limH=function(d_h){ return ((dd.obj.minh-d_h>0)?dd.obj.minh:(dd.obj.maxh>0&&dd.obj.maxh-d_h<0)?dd.obj.maxh:d_h); }; function DDScroll(){ if(!dd.obj||!dd.obj.scroll&&!dd.scroll||dd.ie4||dd.whratio){ dd.scrx=dd.scry=0; return; } var _b7=28,_b8=dd.getScrollX(),_b9=dd.getScrollY(); if(dd.msmoved){ var _ba=dd.getWndW(),_bb=dd.getWndH(),d_y; dd.scrx=((d_y=dd.e.x-_ba-_b8+_b7)>0)?(d_y>>=2)*d_y:((d_y=_b8+_b7-dd.e.x)>0)?-(d_y>>=2)*d_y:0; dd.scry=((d_y=dd.e.y-_bb-_b9+_b7)>0)?(d_y>>=2)*d_y:((d_y=_b9+_b7-dd.e.y)>0)?-(d_y>>=2)*d_y:0; } if(dd.scrx||dd.scry){ window.scrollTo(_b8+(dd.scrx=dd.obj.is_resized?dd.limW(dd.obj.w+dd.scrx)-dd.obj.w:dd.obj.vertical?0:(dd.maxOffX(dd.obj.x+dd.scrx)-dd.obj.x)),_b9+(dd.scry=dd.obj.is_resized?dd.limH(dd.obj.h+dd.scry)-dd.obj.h:dd.obj.horizontal?0:(dd.maxOffY(dd.obj.y+dd.scry)-dd.obj.y))); dd.obj.is_dragged?dd.obj.moveTo(dd.obj.x+dd.getScrollX()-_b8,dd.obj.y+dd.getScrollY()-_b9):dd.reszTo(dd.obj.w+dd.getScrollX()-_b8,dd.obj.h+dd.getScrollY()-_b9); } dd.msmoved=0; window.setTimeout("DDScroll()",51); }; DDObj.prototype.startResizing=function(){ dd.obj.isResizing=true; }; DDObj.prototype.stopResizing=function(){ dd.obj.isResizing=false; }; function PICK(_bd){ dd.e=new dd.evt(_bd); if(dd.e.x>=dd.getWndW()+dd.getScrollX()||dd.e.y>=dd.getWndH()+dd.getScrollY()){ return true; } for(var d_o,d_t,_c0=-1,d_i=dd.elements.length;d_i;){ d_o=dd.elements[--d_i]; if(dd.n4&&dd.e.but>1&&dd.e.src==d_o.oimg&&!d_o.clone){ return false; } if(d_o.visible&&dd.e.but<=1&&dd.e.x>=d_o.x&&dd.e.x<=d_o.x+d_o.w&&dd.e.y>=d_o.y&&dd.e.y<=d_o.y+d_o.h){ if(d_o.z>_c0&&(d_t=dd.e.src.tag).indexOf("inpu")<0&&d_t.indexOf("texta")<0&&d_t.indexOf("sele")<0&&d_t.indexOf("opti")<0&&d_t.indexOf("scrol")<0){ _c0=d_o.z; dd.obj=d_o; } } } if(dd.obj){ if(dd.obj.nodrag){ dd.obj=null; }else{ if(window.my_PickFunc){ my_PickFunc(); } if(dd.obj.pickFunc){ dd.obj.pickFunc(); } dd.e.e.cancelBubble=true; var _c2=dd.obj.isResizing&&(dd.obj.resizable||dd.obj.scalable); if(dd.op){ (d_o=document.getElementById("OpBlUr")).style.pixelLeft=dd.e.x; d_o.style.pixelTop=dd.e.y; (d_o=d_o.children[0].children[0]).focus(); d_o.blur(); }else{ if(dd.ie&&!dd.ie4){ if(document.selection&&document.selection.empty){ document.selection.empty(); } dd.db.onselectstart=function(){ event.returnValue=false; }; } } if(_c2){ dd.obj._setCrs("se-resize"); dd.obj.is_resized=1; dd.whratio=dd.obj.scalable?dd.obj.w/dd.obj.h:0; if(dd.ie){ if(dd.ie4){ window.dd_x=dd.getScrollX(); window.dd_y=dd.getScrollY(); } setTimeout("if(dd.obj && document.selection && document.selection.empty)"+"{"+"document.selection.empty();"+"if(dd.ie4) window.scrollTo(window.dd_x, window.dd_y);"+"}",0); } dd.setMovHdl(RESIZE); dd.reszTo(dd.obj.w,dd.obj.h); }else{ dd.obj.is_dragged=1; dd.setMovHdl(DRAG); } dd.setUpHdl(DROP); dd.embedVis("hidden"); dd.obj._setOpaRel(0.7); dd.obj.maximizeZ(); dd.ofx=dd.obj.x+dd.obj.w-dd.e.x; dd.ofy=dd.obj.y+dd.obj.h-dd.e.y; DDScroll(); return !(dd.obj.is_resized||dd.n4&&dd.obj.is_image||dd.n6||dd.w3c); } } if(dd.downFunc){ return dd.downFunc(_bd); } return true; }; function DRAG(_c3){ if(!dd.obj||!dd.obj.visible){ return true; } if(dd.ie4||dd.w3c||dd.n6||dd.obj.children.length>15){ if(dd.wait){ return false; } dd.wait=1; setTimeout("dd.wait = 0;",dd.tWait); } dd.e=new dd.evt(_c3); if(dd.ie&&!dd.e.but){ DROP(_c3); return true; } dd.msmoved=1; dd.obj.moveTo(dd.obj.vertical?dd.obj.x:dd.maxOffX(dd.inWndW(dd.ofx+dd.e.x)-dd.obj.w),dd.obj.horizontal?dd.obj.y:dd.maxOffY(dd.inWndH(dd.ofy+dd.e.y)-dd.obj.h)); if(window.my_DragFunc){ my_DragFunc(); } if(dd.obj.dragFunc){ dd.obj.dragFunc(); } if(dd.moveFunc){ return dd.moveFunc(_c3); } return false; }; function RESIZE(_c4){ if(!dd.obj||!dd.obj.visible){ return true; } if(dd.wait){ return false; } dd.wait=1; setTimeout("dd.wait = 0;",dd.tWait); dd.e=new dd.evt(_c4); if(dd.ie&&!dd.e.but){ DROP(_c4); return true; } dd.msmoved=1; var d_w=dd.limW(dd.inWndW(dd.ofx+dd.e.x)-dd.obj.x),d_h; if(!dd.whratio){ d_h=dd.limH(dd.inWndH(dd.ofy+dd.e.y)-dd.obj.y); }else{ d_h=dd.limH(dd.inWndH(Math.round(d_w/dd.whratio)+dd.obj.y)-dd.obj.y); d_w=Math.round(d_h*dd.whratio); } dd.reszTo(d_w,d_h); if(window.my_ResizeFunc){ my_ResizeFunc(); } if(dd.obj.resizeFunc){ dd.obj.resizeFunc(); } if(dd.moveFunc){ return dd.moveFunc(_c4); } return false; }; function DROP(_c7){ if(dd.obj){ if(dd.obj.is_dragged){ if(!dd.obj.is_image){ dd.getWH(dd.obj); } }else{ if(dd.n4){ if(dd.obj.is_image){ dd.n4RectVis(0); dd.obj.resizeTo(dd.obj.w,dd.obj.h); } } } if(!dd.n4||!dd.obj.is_image){ dd.recalc(); } dd.setMovHdl(dd.moveFunc); dd.setUpHdl(dd.upFunc); if(dd.db){ dd.db.onselectstart=null; } dd.obj._setOpaRel(1); dd.obj._setCrs(dd.obj.cursor); dd.embedVis("visible"); dd.obj._resetZ(); dd.e=new dd.evt(_c7); if(window.my_DropFunc){ my_DropFunc(); } if(dd.obj.dropFunc){ dd.obj.dropFunc(); } dd.msmoved=dd.obj.is_dragged=dd.obj.is_resized=dd.whratio=0; dd.obj=null; } dd.setDwnHdl(PICK); }; function SET_DHTML(){ var d_a=arguments,_c9,_ca="",d_o,d_i=d_a.length; while(d_i){ if(!(_c9=d_a[--d_i]).indexOf("c:")){ dd.cursor=_c9.substring(2); }else{ if(_c9==NO_ALT){ dd.noalt=1; }else{ if(_c9==SCROLL){ dd.scroll=1; }else{ if(_c9==RESET_Z){ dd.re_z=1; }else{ if(_c9==RESIZABLE){ dd.resizable=1; }else{ if(_c9==SCALABLE){ dd.scalable=1; }else{ if(_c9==TRANSPARENT){ dd.diaphan=1; }else{ d_o=new DDObj(_c9); dd.addElt(d_o); _ca+=d_o.t_htm||""; if(d_o.oimg&&d_o.cpy_n){ for(var d_l=d_o.cpy_n,d_j=0;d_j\n":(dd.op&&!dd.op6)?"":"")+_ca; document.write(str); } dd.z=51; for(d_i=dd.elements.length;d_i;){ dd.addProps(d_o=dd.elements[--d_i]); if(d_o.is_image&&!d_o.original&&!d_o.clone){ dd.n4?d_o.oimg.src=spacer:d_o.oimg.style.visibility="hidden"; } } dd.mkWzDom(); if(window.onload){ dd.loadFunc=window.onload; } if(window.onunload){ dd.uloadFunc=window.onunload; } window.onload=dd.initz; window.onunload=dd.finlz; dd.setDwnHdl(PICK); }; function ADD_DHTML(){ var d_a=arguments,d_o,d_i=d_a.length; while(d_i){ d_o=new DDObj(d_a[--d_i]); dd.addElt(d_o); dd.addProps(d_o); } dd.mkWzDom(); }; dd.d=document; var RESET_ZINDEX=RESET_Z; var KEYDOWN_RESIZE=RESIZABLE; var CURSOR_POINTER=CURSOR_HAND; var NO_SCROLL=""; function my_PickFunc(){ }; function my_DragFunc(){ }; function my_ResizeFunc(){ }; function my_DropFunc(){ };