﻿
function isLegacyBrowser()
{if(typeof legacyBrowser!="undefined"&&legacyBrowser==true)return true;else return false;}
var JExceptionType={Alert:0,OK:1}
function Contact()
{this.FirstName=null;this.LastName=null;this.EmailAddress=null;this.Affiliation={};this.FieldCenter=null;}
function NASAContact()
{this.FieldCenter={};}
NASAContact.prototype=new Contact();function OtherContact()
{this.CountryName={};}
OtherContact.prototype=new Contact();function AssessmentRequest()
{this.Contact=null;this.AssessmentCategory=null;this.InformationSection=null;this.isNewRegistration=false;}
var Affiliation={NASA:{Id:1,Name:"NASA",Description:"I am a NASA employee"},US:{Id:2,Name:"US",Description:"I reside and work in the United States"},FED:{Id:3,Name:"FED",Description:"I am a non-NASA federal employee"},WILEY:{Id:4,Name:"WILEY",Description:"Wiley Training Sales"},KOREA:{Id:5,Name:"KOREA",Description:"I reside and work in South Korea"},EU:{Id:6,Name:"EU",Description:"I reside and work in Europe"},AUS:{Id:7,Name:"AUS",Description:"I reside and work in Australia"},SAFR:{Id:8,Name:"SAFR",Description:"I reside and work in South Africa"},CAN:{Id:9,Name:"CAN",Description:"I reside and work in Canada"},TAIWAN:{Id:11,Name:"TAIWAN",Description:"I reside and work in Taiwan"},OTHER:{Id:10,Name:"OTHER",Description:"I reside and work in another country"}}
var AssessmentCategory={TestDrive:1,FullService:2}
var InformationSection={FullServiceTeamAssessment:1,FullServiceIndividualAssessment:2,FullServiceBatchAssessment:3,GeneralTelephoneCoaching:4,AssessmentDebriefCoaching:5,ContextShiftCoaching:6,ThreeDayWorkshop:7,BriefWorkshop:8,FreeTeamAssessment:9,FreeIndividualAssessment:10,DiagnoseInnatePersonalityFoundation:11,DiagnoseCulture:12,DiagnoseProjectColor:13,DownloadWorkshopSlides:14,CSW:15,PERSONDIAG:16,CULTDIAG:17,PROJPARADIAG:18,APPRECMOD:19}
var InfoSectionDownload={"1":{DownloadFile:"TeamDevelopmentAssessment.zip",DownloadName:"Full Team Assessment Preparation Briefing",ResourceText:"Click below to receive a briefing you can use to familiarize your teammates with the 4-D Team Development Assessment Process."},"2":{DownloadFile:"5FullIDAAssessmentPreparationBriefing.zip",DownloadName:"Full Individual Assessment Preparation Briefing",ResourceText:"Click below to receive a briefing you can use to familiarize your teammates with the 4-D Individual Development Assessment Process."},"3":null,"4":null,"5":null,"6":{DownloadFile:"10CSW.zip",DownloadName:"Download the CSW",ResourceText:"Click below to receive our most effective ad-hoc context management tool, the 4-D Context Setting Worksheet."},"7":null,"8":null,"9":{DownloadFile:"TeamDevelopmentAssessment.zip",DownloadName:"Free Team Assessment Preparation Briefing",ResourceText:"Click below to receive a briefing you can use to familiarize your teammates with the 4-D Team Development Assessment Process."},"10":{DownloadFile:"19IDAAssessmentPreparationBriefing.zip",DownloadName:"Free Individual Assessment Preparation Briefing",ResourceText:"Click below to receive a briefing you can use to familiarize your teammates with the 4-D Individual Development Assessment Process."},"11":{DownloadFile:"21PersonalityDiagnostic.zip",DownloadName:"Personality Diagnostic Slides",ResourceText:"Click below to receive 4-D workshop slides that you can use to identify and chart you and your team's innate personalities."},"12":{DownloadFile:"22CultureDiagnostic.zip",DownloadName:"Culture Diagnostic Slides",ResourceText:"Click below to receive 4-D workshop slides that you can use to chart your team's culture."},"13":{DownloadFile:"23ProjectParadigmDiagnostic.zip",DownloadName:"Project Mindset Diagnostic Slides",ResourceText:"Click below to receive 4-D workshop slides that you can use to identify your project's driving mindset."},"14":{DownloadFile:"24AppreciationModule.zip",DownloadName:"Appreciation Module",ResourceText:"Click below to receive 4-D workshop slides that you can use to teach your teammates how to authentically appreciate each other."}}
var FieldCenter={NASA:1,Ames:2,Marshall:3,Glen:4,GoddardFlightCenter:5,GoddardInstitute:6,JPL:7,Dryden:8,IVandV:9,Johnson:10,Kennedy:11,Langley:12,Stennis:13,Wallops:14,WhiteSands:15}
var FieldCenterContact={"1":{"Name":"Harold Reitsema","Email":"hreitsema@aol.com","Company":"Sponsored by APPEL"},"2":{"Name":"Larry Caroff","Email":"lcaroff@comcast.net","Company":"Sponsored by APPEL"},"3":{"Name":"Jim Odom","Email":"odmjim@aol.com","Company":"Sponsored by APPEL"},"4":{"Name":"Ron Thomas","Email":"ronlthomas@aol.com","Company":"Sponsored by APPEL"},"5":{"Name":"Harold Reitsema","Email":"hreitsema@aol.com","Company":"Sponsored by APPEL"},"6":{"Name":"Harold Reitsema","Email":"hreitsema@aol.com","Company":"Sponsored by APPEL"},"7":{"Name":"Larry Caroff","Email":"lcaroff@comcast.net","Company":"Sponsored by APPEL"},"8":{"Name":"Harold Reitsema","Email":"hreitsema@aol.com","Company":"Sponsored by APPEL"},"9":{"Name":"Denny Holt","Email":"jdholtwork@aol.com","Company":"Sponsored by APPEL"},"10":{"Name":"Chris Fairey","Email":"cgfairey@cfl.rr.com","Company":"Sponsored by APPEL"},"11":{"Name":"Gus Gustaferro","Email":"gusg@cox.net","Company":"Sponsored by APPEL"},"12":{"Name":"Denny Holt","Email":"jdholtwork@aol.com","Company":"Sponsored by APPEL"},"13":{"Name":"Gus Gustaferro","Email":"gusg@cox.net","Company":"Sponsored by APPEL"}}
var activePayGroupTab;var activeFreeGroupTab;function tab_onactive(target)
{if(target.id=="tabAbout4DSystems")
{if(isMoreInfoActive)
{isMoreInfoActive=false;$('trAbout4DSystems').style.display="none";if(isLegacyBrowser())
{$('trMainRow').style.display="block";}
else
{$('trMainRow').style.display="table-row";}
KlarityInc.WebControls.Tab.setTabGroupActive("tabAbout4DSystems",false,true);var a=activePayGroupTab;var b=activeFreeGroupTab;if(a)
KlarityInc.WebControls.Tab.setActive(a,true);else
KlarityInc.WebControls.Tab.setActive("tabPayAssess",true,true);if(b)
KlarityInc.WebControls.Tab.setActive(b,true);else
KlarityInc.WebControls.Tab.setActive("tabFreeAssess",true,true);}
else
{isMoreInfoActive=true;LoadMoreInfoContent('content/text/AboutTheAuthorFAQs.txt');}}
else
{isMoreInfoActive=false;$('trAbout4DSystems').style.display="none";$('trMainRow').style.display="";$('FlashBookPanel').style.display="";KlarityInc.WebControls.Tab.setActive("tabAbout4DSystems",false);if(target.getAttribute("tabgroup")=="payGroup")
activePayGroupTab=target;if(target.getAttribute("tabgroup")=="freeGroup")
activeFreeGroupTab=target;if(activePayGroupTab)
{if(target!=activePayGroupTab)
KlarityInc.WebControls.Tab.setActive(activePayGroupTab,true);}
else
KlarityInc.WebControls.Tab.setActive("tabPayAssess",true,true);if(activeFreeGroupTab)
{if(target!=activeFreeGroupTab)
KlarityInc.WebControls.Tab.setActive(activeFreeGroupTab,true);}
else
KlarityInc.WebControls.Tab.setActive("tabFreeAssess",true,true);}
target.style.fontWeight="bold";}
function tab_oninactive(target)
{target.style.fontWeight="";}
function tab_onmouseenter(target)
{target.style.fontWeight="bold";}
function tab_onmouseleave(target)
{target.style.fontWeight="";}
var assessmentRequest=null;var isMoreInfoActive=false;function $alert(message)
{$('AlertPlaceholder').update(message);$('InfoDialog').style.display="none";$('AlertDialog').style.display="block";}
function $info(message)
{$('InfoDialogPlaceholder').update(message);$('AlertDialog').style.display="none";$('InfoDialog').style.display="block";}
function HideDialogs()
{$('InfoDialog').style.display="none";$('AlertDialog').style.display="none";}
var runningServies=[];function GenericWebService_onfailure(err,passthru)
{if(passthru&&passthru.runningService)
runningServies.pop(passthru.runningService);var message=err.get_message();if(message.split('|')[0]=="OK")
{$info(message.split('|')[1]);return;}
if(message.indexOf("Principal must be of type BusinessPrincipal, not System.Security.Principal.WindowsPrincipal")!=-1)
{$alert("Your session has timed out. Please log in to resume.");return;}
$alert(message);}
function flashbook_onclick()
{new Ajax.Updater('BuyTheBookPlaceholder','content/text/BuyTheBook.txt',{method:'get'});$('BuyTheBookDialog').appear();}
function loadContentDialog(url,link)
{new Ajax.Updater('contentDialogPlaceholder',url,{method:'get'});var dialogHeader=$('contentDialog').select("H3")[0];if(link==window)
dialogHeader.update("&#160;");else
dialogHeader.update($(link).innerHTML);$('contentDialogPlaceholder').scrollTop=0;$('contentDialog').style.display="block";}
function LoadMoreInfoContent(contentUrl)
{new Ajax.Updater('divAboutAuthor',contentUrl,{method:'get'});if($('trAbout4DSystems').style.display=="")return;$('trAbout4DSystems').style.display="";$('trMainRow').style.display="none";var payGroupCollection=$$("TABLE[tabgroup=payGroup]");var freeGroupCollection=$$("TABLE[tabgroup=freeGroup]");payGroupCollection.each(function(el)
{if(el._active&&el._active==true)activePayGroupTab=el;});freeGroupCollection.each(function(el)
{if(el._active&&el._active==true)activeFreeGroupTab=el;});KlarityInc.WebControls.Tab.setTabGroupActive("tabPayAssess",false,true);KlarityInc.WebControls.Tab.setTabGroupActive("tabFreeAssess",false,true);KlarityInc.WebControls.Tab.setTabGroupActive("tabAbout4DSystems",true,true);}
var tweets=null;function ShowAllTweets()
{var tweetContent="";var maxlen=Math.min(tweets.length,8);for(var i=0;i<maxlen;i++)
{var tweet=tweets[i];tweetContent+=tweet.text+"<br/><span style='color: gray;'>Posted: "+tweet.created_at.split(' +')[0]+"</span><br/><br/>";}
$('lblLatestTweet').innerHTML=tweetContent;}
var isLoggedIn=false;var My4D_ActiveWindow=null;function DisplaySlidingPanel(targetWindow)
{if(isLegacyBrowser())
{LegacyBrowserDialog.setVisible(true);return;}
$('MB_overlay').style.display="block";if(My4D_ActiveWindow)
{Effect.SlideUp(My4D_ActiveWindow,{afterFinish:function()
{Effect.SlideDown(targetWindow);My4D_ActiveWindow=targetWindow;$('stuff').style.display="block";$('divPasswordRecovery').style.display='none';}});}
else
{Effect.SlideDown(targetWindow);My4D_ActiveWindow=targetWindow;}}
function RecoverPassword()
{Effect.SlideUp('My4D_LoginWindow',{afterFinish:function()
{$('stuff').style.display="none";$('divPasswordRecovery').style.display='block';Effect.SlideDown('My4D_LoginWindow');}});}
var My4D={Close:function(delegate)
{if(My4D_ActiveWindow)
{Effect.SlideUp(My4D_ActiveWindow,{afterFinish:function()
{My4D_ActiveWindow=null;$('MB_overlay').style.display="none";if(typeof delegate=="function")
delegate();}});}},Login:function()
{PortalServices.Login($('LoginEmail').value,$('LoginPassword').value,function(result,passthru)
{isLoggedIn=true;if(!assessmentRequest)
assessmentRequest=new AssessmentRequest();assessmentRequest.Contact={};assessmentRequest.Contact.portalUser=result;assessmentRequest.Contact.EmailAddress=result.Email;My4D.Close(function()
{$('LoginEmail').value="";$('LoginPassword').value="";});$info('Welcome back '+result.FirstName);LoginResult();},GenericWebService_onfailure);},ShowNetworkMemberWizardPage1:function()
{DisplaySlidingPanel('My4D_NetworkMemberWizardPage1');},ShowNetworkMemberWizardPage2:function()
{DisplaySlidingPanel('My4D_NetworkMemberWizardPage2');},ShowNetworkMemberWizardPage3:function()
{DisplaySlidingPanel('My4D_NetworkMemberWizardPage3');},ShowNetworkMemberWizardPage4:function()
{DisplaySlidingPanel('My4D_NetworkMemberWizardPage4');},ShowNetworkMemberWizardPage5:function()
{DisplaySlidingPanel('My4D_NetworkMemberWizardPage5');},ConfirmNetworkMemberRegistration:function()
{var companyName=$('txtCompanyName').value;if(companyName=="")
{$alert("Company Name is required for registration.");return;}
PortalServices.AddNetworkMember(companyName,function()
{alert("Done");});},ShowRegistration:function(infoSectionId)
{if(!assessmentRequest)
assessmentRequest=new AssessmentRequest();if(typeof infoSectionId!="undefined")
{assessmentRequest.InformationSection=infoSectionId;}
DisplaySlidingPanel('My4D_AffiliationWindow');},SetAffiliation:function(affiliation)
{$('divFieldCenter').style.display="none";$('divOtherCountry').style.display="none";if(affiliation==Affiliation.NASA)
{assessmentRequest.Contact=new NASAContact();$('ddlFieldCenter').selectedIndex=0;$('divFieldCenter').style.display="block";}
else if(affiliation==Affiliation.OTHER)
{assessmentRequest.Contact=new OtherContact();$('divOtherCountry').style.display="block";}
else
{assessmentRequest.Contact=new Contact();}
assessmentRequest.Contact.Affiliation=affiliation;DisplaySlidingPanel('My4D_RegisterWindow');},ResendLoginEmail:function()
{if(runningServies.indexOf(this.ResendLoginEmail)!=-1)return;runningServies.push(this.ResendLoginEmail);PortalServices.ResendLoginEmail(assessmentRequest.Contact.EmailAddress,function(result,passthru)
{runningServies.pop(passthru.runningService);$info("Login email sent successfully");},GenericWebService_onfailure,{runningService:this.ResendLoginEmail});},Register:function()
{if($('txtFirstName').value=="")
{$alert("First Name is required for registration.");return;}
if($('txtLastName').value=="")
{$alert("Last Name is required for registration.");return;}
if($('txtEmailAddress').value=="")
{$alert("Email Address is required for registration.");return;}
if($('txtPassword').value=="")
{$alert("Password is required for registration.");return;}
if($('txtPassword').value!=$('txtPasswordMatch').value)
{$alert("The password and its confirmation field do not match.");return;}
if(assessmentRequest.Contact instanceof NASAContact)
{if($('ddlFieldCenter').selectedIndex==0)
{$alert("NASA Location is required for those with a NASA affiliation.");return;}}
if(assessmentRequest.Contact instanceof OtherContact)
{if($('txtOtherCountryName').value=="")
{$alert("Country Name is required for registration");return;}}
if($('txtPhone').value!="")
{var pval=$('txtPhone').value;var raw=pval.replace(/-/g,'');if(isNaN(raw))
{$alert("Phone may only contain hyphens and numeric digits");return;}}
assessmentRequest.Contact.FirstName=$('txtFirstName').value;assessmentRequest.Contact.LastName=$('txtLastName').value;assessmentRequest.Contact.EmailAddress=$('txtEmailAddress').value;assessmentRequest.Contact.Phone=$('txtPhone').value;var Password=$('txtPassword').value;var FieldCenterText=null;if(assessmentRequest.Contact.FieldCenter!=null)
{assessmentRequest.Contact.FieldCenter=$('ddlFieldCenter').value;FieldCenterText=$('ddlFieldCenter')[$('ddlFieldCenter').selectedIndex].firstChild.nodeValue;}
if(assessmentRequest.Contact.CountryName!=null)
{assessmentRequest.Contact.CountryName=$('txtOtherCountryName').value;}
if(runningServies.indexOf(this.Register)!=-1)return;runningServies.push(this.Register);var infoSection=assessmentRequest.InformationSection;if(infoSection==14)infoSection=0;PortalServices.AddUser(assessmentRequest.Contact.FirstName,assessmentRequest.Contact.LastName,assessmentRequest.Contact.EmailAddress,FieldCenterText,Password,assessmentRequest.Contact.Affiliation.Name,infoSection,$('txtOtherCountryName').value,assessmentRequest.Contact.Phone,function(result,passthru)
{HideDialogs();runningServies.pop(passthru.runningService);assessmentRequest.Contact.portalUser=result;if(assessmentRequest.InformationSection)
{My4D.SelectView(assessmentRequest.InformationSection,true);}
else
{$info("Registration completed successfully.");}
$('txtFirstName').value="";$('txtLastName').value="";$('txtEmailAddress').value="";$('txtPassword').value="";$('txtPasswordMatch').value="";$('ddlFieldCenter').selectedIndex=0;My4D.Close();LoginResult();},function(err,passthru)
{if(passthru&&passthru.runningService)
runningServies.pop(passthru.runningService);var msg=err.get_message();if(msg.substring(0,1)=="{")
{var jerr=eval("("+msg+")");var imsg=jerr.Message;imsg=imsg.replace(/\\\"/g,"&quot;");if(jerr.Type==JExceptionType.OK)
{$info(imsg,jerr.DisplayDuration);My4D.Close();}
else if(jerr.Type==JExceptionType.Alert)
{$alert(imsg,jerr.DisplayDuration);}}
else
{GenericWebService_onfailure(err,passthru);}},{runningService:this.Register});},LogOut:function()
{PortalServices.LogOut(function()
{$('divLoginInfo1').style.display="block";$('divLoginInfo2').style.display="none";$$('.RegisterSection').each(function(el)
{el.style.display="block";});$$('.LoggedInSection').each(function(el)
{el.style.display="none";});assessmentRequest=null;$info("Successfully logged out");});},RecoverPassword:function()
{var email=$('txtRecoverPasswordEmail').value;if(email=="")
{$alert('E-mail Address field may not be blank');return;}
PortalServices.ResendPassword(email,function()
{My4D.Close(function()
{$('stuff').style.display="block";$('divPasswordRecovery').style.display='none';});$info('Account password sent to '+$('txtRecoverPasswordEmail').value);},GenericWebService_onfailure);},ContactNetworkMember:function()
{var email=assessmentRequest.Contact.EmailAddress;var infoSectionId=assessmentRequest.InformationSection;var contactReason=$('txtContactReason').value;PortalServices.RequestNetworkMember(email,infoSectionId,contactReason,function()
{My4D_ActiveWindow='My4D_ContactReasonPanel';My4D.Close(My4D.RegistrationComplete)},GenericWebService_onfailure);},RegistrationComplete:function()
{if(assessmentRequest.isNewRegistration==true)
{$info("Registration completed successfully. A 4-D Network Member will contact you by email shortly.");}
else
{$info("A 4-D Network Member will contact you by email shortly.");}},DownloadSlides:function(infoSectionId)
{var contactReason="";PortalServices.RequestNetworkMember(assessmentRequest.Contact.EmailAddress,infoSectionId,contactReason,null,GenericWebService_onfailure);},SelectView:function(infoSectionId,newRegistration)
{if(!assessmentRequest)
assessmentRequest=new AssessmentRequest();assessmentRequest.InformationSection=infoSectionId;assessmentRequest.isNewRegistration=newRegistration;$$('.RegistrationConfirmed').each(function(el)
{if(newRegistration==true)
el.style.display="block";else
el.style.display="none";});if(infoSectionId==InformationSection.FreeTeamAssessment||assessmentRequest.InformationSection==InformationSection.FreeIndividualAssessment)
{PortalServices.UserHasCurrentFreeAssessment(assessmentRequest.Contact.EmailAddress,UserHasCurrentFreeAssessment_Response,GenericWebService_onfailure,{infoSectionId:assessmentRequest.InformationSection});}
else if(infoSectionId==InformationSection.DownloadWorkshopSlides)
{$('divDownloadConfirmation').style.display="block";}
else
{$('txtContactReason').value="";DisplaySlidingPanel('My4D_ContactReasonPanel');}}}
function UserHasCurrentFreeAssessment_Response(response,passthru)
{if(response==true)
{$('divConfirmationA'+passthru.infoSectionId).style.display="none";$('divConfirmationB'+passthru.infoSectionId).style.display="block";}
else if(assessmentRequest.InformationSection==InformationSection.FreeTeamAssessment)
{$('spnEmailPlaceholder'+passthru.infoSectionId).update(assessmentRequest.Contact.EmailAddress);$('divConfirmationA'+passthru.infoSectionId).style.display="block";$('divConfirmationB'+passthru.infoSectionId).style.display="none";PortalServices.InitFreeAssessment(assessmentRequest.Contact.EmailAddress,"Tea",null,GenericWebService_onfailure);}
else if(assessmentRequest.InformationSection==InformationSection.FreeIndividualAssessment)
{$('spnEmailPlaceholder'+passthru.infoSectionId).update(assessmentRequest.Contact.EmailAddress);$('divConfirmationA'+passthru.infoSectionId).style.display="block";$('divConfirmationB'+passthru.infoSectionId).style.display="none";PortalServices.InitFreeAssessment(assessmentRequest.Contact.EmailAddress,"Ind",null,GenericWebService_onfailure);}}
function ViewAction(infoSectionId)
{}
var ytplayer;function LaunchYouTubeDialog()
{YouTubeDialog.setVisible(true);if(ytplayer)
{ytplayer.playVideo();}}
function YouTubeDialog_onclose()
{YouTubeDialog.setVisible(false);if(ytplayer)
{ytplayer.pauseVideo();}}
function onYouTubePlayerReady(playerId)
{ytplayer=document.getElementById("myytplayer");ytplayer.playVideo();}
function LoginResult()
{$('divLoginInfo1').style.display="none";$('spnUsername').update(assessmentRequest.Contact.portalUser.Email);$('divLoginInfo2').style.display="block";$$('.RegisterSection').each(function(el)
{el.style.display="none";});$$('.LoggedInSection').each(function(el)
{el.style.display="block";});PortalServices.GetAssessmentState(function(result,passthru)
{if(result.HasActiveAssessment==true)
{if(result.Type=="Tea")
{$('lnkRequestFreeTeam').style.display="none";$('lnkOpenFreeTeam').style.display="inline";$('lnkOpenFreeTeam').href=result.Url;}
else if(result.Type=="Ind")
{$('lnkRequestFreeInd').style.display="none";$('lnkOpenFreeInd').style.display="inline";$('lnkOpenFreeInd').href=result.Url;}}});}
function PortalServices_GetUser()
{PortalServices.GetUser(function(result)
{isLoggedIn=true;if(!assessmentRequest)
assessmentRequest=new AssessmentRequest();assessmentRequest.Contact={};assessmentRequest.Contact.portalUser=result;assessmentRequest.Contact.EmailAddress=result.Email;PortalServices.GetQueuedAction(function(InfoId)
{if(InfoId!=0)
{My4D.SelectView(InfoId,true);}
else
{PortalServices.GetQueuedMessage(function(result)
{if(result!="")
{var arr=result.split("|");if(arr[0]=="OK")$info(arr[1]);if(arr[0]=="ALERT")$alert(arr[1]);}
else
{$info('Welcome back '+assessmentRequest.Contact.portalUser.FirstName);}});}});LoginResult();},function()
{});}
document.observe('keydown',function(event)
{if(event.keyCode==123&&event.ctrlKey&&event.altKey)
{debugger;}});window.onscroll=function(event)
{var winscroll=window.document.documentElement.scrollTop;if(typeof window.pageYOffset=="number")
{winscroll=window.pageYOffset;}
var dialog=$('contentDialog');if(winscroll>parseInt(dialog.style.top))
{$('contentDialog').style.top=winscroll+"px";}
else
{}}
window.onresize=function(event)
{var winscroll=window.document.documentElement.scrollTop;var dialog=$('contentDialog');var bottomY=winscroll+parseInt(dialog.style.height)+parseInt(dialog.style.top);if(bottomY>window.document.documentElement.clientHeight)
{var offset=parseInt(dialog.style.top)-(bottomY-window.document.documentElement.clientHeight)-40;if(offset<0)offset=0;dialog.style.top=offset+"px";}}
function window_onload()
{if($qs('ca')=="true")
{$info("Activation successfully cancelled");}
if($qs('lo')=="true")
{$info("Log out successfull");}
var winscroll=window.document.documentElement.scrollTop;var dialog=$('contentDialog');var bottomY=winscroll+parseInt(dialog.style.height)+parseInt(dialog.style.top);if(bottomY>window.document.documentElement.clientHeight)
{var offset=parseInt(dialog.style.top)-(bottomY-window.document.documentElement.clientHeight)-40;if(offset<0)offset=0;dialog.style.top=offset+"px";}
$('bobo2').setOpacity(0.8);$('bobo3').setOpacity(0.8);$('bobo4').setOpacity(0.8);$('MB_overlay').setOpacity(0.65);PortalServices_GetUser();$('LoginPassword').observe('keydown',function(event)
{if(event.keyCode==13)
{My4D.Login();}});$('txtPasswordMatch').observe('keydown',function(event)
{if(event.keyCode==13)
{My4D.Register();}});$$('.KlarityTab').each(function(el)
{el.observe('mouseenter',function()
{tab_onmouseenter(el);});el.observe('mouseleave',function()
{tab_onmouseleave(el);});});$$('.SlidePanelCloseImage').each(function(el)
{el.observe('mouseover',function()
{el.src="images/close - hover.png";});el.observe('mouseout',function()
{el.src="images/close.png";});});var payGroupCollection=$$("TABLE[tabgroup=payGroup]");var freeGroupCollection=$$("TABLE[tabgroup=freeGroup]");if(window.location.hash!="")
{var anchors=$$('A[href='+window.location.hash+']');if(anchors.length>0)
{if(typeof anchors[0].click=="object")
anchors[0].click();else
eval(anchors[0].getAttribute("onclick"));}
else
{payGroupCollection[0]._active=true;freeGroupCollection[0]._active=true;}}
$('lblLatestTweet').update("Loading twitter feed ...");new Ajax.Request('twitterrequest.aspx',{method:'get',onSuccess:function(transport)
{tweets=eval(transport.responseText);var latestTweet=tweets[0];ShowAllTweets();}});if(Sys.Browser.agent==Sys.Browser.InternetExplorer&&Sys.Browser.version==7)
{$('tabAbout4DSystems').style.marginLeft="6px";}
else
{$('tabAbout4DSystems').style.marginLeft="36px";}
try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}
var params={wmode:"transparent"};swfobject.embedSWF("site_anim_08_sized.swf","FlashBookPanel","270","300","8","#336699",null,params);var params={allowScriptAccess:"always",wmode:"transparent"};var atts={id:"myytplayer"};swfobject.embedSWF("http://www.youtube.com/v/VpqT2Fz4ZQg?enablejsapi=1&playerapiid=ytplayer","ytapiplayer","480","385","8",null,null,params,atts);YouTubeDialog.Center();$$('.FieldCenterList').each(function(el)
{el.observe('change',function()
{if(this.selectedIndex==0)
DOM.getPreviousSibling(el).style.visibility="visible";else
DOM.getPreviousSibling(el).style.visibility="hidden";});el.selectedIndex=0;});}
document.observe("dom:loaded",window_onload);