﻿jQuery(document).ready(function(){jQuery("body #page #body div.promoter").length>0&&jQuery("body #page #body div.promoter").css("height",jQuery("body #page #body div.promoter div.text").height()>jQuery("body #page #body div.promoter div.background").height()?jQuery("body #page #body div.promoter div.text").height():jQuery("body #page #body div.promoter div.background").height());jQuery("#flashDiv object").ready(function(){jQuery("#flashDiv").css({height:"340px",background:"transparent url("+jQuery("#flashFallBack img").attr("src")+") -2px 0 no-repeat"})});if(jQuery("body .video-player").length==0){var g=jQuery('<div class="video-backdrop" style="height: '+jQuery("#aspnetForm").height()+'px;"></div>').click(function(){hideVideo()}).hide(),h=jQuery('<div class="video-outline"></div>').hide(),f=jQuery('<div class="video-player" style="display: none;"><div class="close"><img src="/crmonline/styles/images/close.png" /></div><div class="top"><div></div></div><div class="player"><div></div></div><div class="bottom"><div></div></div></div>');f.find(".close").click(function(){hideVideo()});jQuery("body").append(g,f,h)}jQuery("body a.video").click(function(){showVideo(this);return false});jQuery("#menu-global label").hide();jQuery("body #eventbubble").hide();jQuery("#menu-main li.selected").className;var c=0;jQuery("body #page #bottom-nav div").each(function(){if(c<jQuery(this).height())c=jQuery(this).height()});jQuery("body #page #bottom-nav div").css("height",c);var b=100;jQuery("body #page #bottom-box-container div .content").each(function(){if(b<jQuery(this).height())b=jQuery(this).height()});jQuery("body #page #bottom-box-container div .content").css("height",b+(jQuery("body #page #bottom-box-container div .content a.more").length>0?20:0));jQuery("body #page #bottom-box-container").css("height","100%");if(jQuery("body #page #body div.separated-floaters div").length>0){var a=0;jQuery("body #page #body div.separated-floaters div").each(function(){if(a<jQuery(this).height())a=jQuery(this).height()});if(jQuery("body #page #body div.separated-floaters div").parents().filter("div.customer-cases").length>0)a=a+25;jQuery("body #page #body div.separated-floaters div").css("height",a)}jQuery("body #page #body div.gradient-floaters div").length>0&&jQuery("body #page #body div.gradient-floaters div div h2").each(function(){jQuery(this).click(function(){window.location.href=jQuery(this).find("a").attr("href")})});if(jQuery("body #page #body div.frontpage div.menu ul").length>0){jQuery("body #page #body div.frontpage div.menu ul li").mouseover(function(){jQuery(this).addClass("hover")});jQuery("body #page #body div.frontpage div.menu ul li").mouseout(function(){jQuery(this).removeClass("hover")})}if(jQuery("body #page #body div.xForm").length>0){jQuery("body #page #body div.xForm table tr").addClass("top");jQuery('body #page #body div.xForm table tr td input[type="text"], body #page #body div.xForm table tr td textarea, body #page #body div.xForm table tr td select').each(function(){jQuery(this).addClass("text");jQuery(jQuery(this).parent().parent().children()[0]).addClass("label").html('<label for="'+this.id+'">'+jQuery(jQuery(this).parent().parent().children()[0]).html()+"</label>")});jQuery('body #page #body div.xForm table tr td input[type="submit"], body #page #body div.xForm table tr td input[type="button"]').not('#campaign input[type="button"]').each(function(){jQuery(this).parent().html('<div class="action">'+jQuery(this).parent().html()+"</div>")});jQuery("body #page #body div.xForm table tr td fieldset").each(function(){jQuery(jQuery(this).parent().parent().children()[0]).html()!=""&&jQuery(jQuery(this).parent().parent().children()[0]).addClass("label").html('<label for="">'+jQuery(jQuery(this).parent().parent().children()[0]).html()+"</label>")});jQuery("body #page #body div.xForm table tr td input.required, body #page #body div.xForm table tr td textarea.required, body #page #body div.xForm table tr td select.required").each(function(){jQuery(this).removeClass("required");jQuery(this).parent().html('<div class="form-required">'+jQuery(this).parent().html()+"</div>")});jQuery('body #page #body #campaign div.xForm table tr td input[type="submit"], body #page #body #campaign div.xForm table tr td input[type="button"]').each(function(){jQuery(this).parent().html('<div class="button">'+jQuery(this).parent().html()+"</div>")});jQuery("body #page #body #campaign div.xForm table tr td div.button, body #page #body #campaign div.xForm table tr td p").each(function(){jQuery(this).parents("tr").addClass("noborder")})}if(jQuery("body #page #body div.process-large").length>0){var a=0,d=179;jQuery("body #page #body div.process-large div div").each(function(){if(a<jQuery(this).height())a=jQuery(this).height()});a+80<d&&jQuery("body #page #body div.process-large").css("height",d)}if(jQuery("body #page #body div.tab-container").length>0){var e=0;if(window.location.hash!="#tab-none"&&window.location.hash!=""){jQuery("body #page #body div.tab-container div.tab-content div.tab").hide();jQuery("body #page #body div.tab-container div.tab-content div"+window.location.hash+".tab").show();jQuery("body #page #body div.tab-container table.tabs").addClass("active");jQuery("body #page #body div.tab-container table.tabs td.tab").removeClass("selected");jQuery("body #page #body div.tab-container table.tabs td.tab a[href="+window.location.hash+"]").parent().addClass("selected")}else{jQuery("body #page #body div.tab-container table.tabs").removeClass("active");jQuery("body #page #body div.tab-container table.tabs td.tab").removeClass("selected");jQuery("body #page #body div.tab-container div.tab-content div.tab").hide()}jQuery("body #page #body div.tab-container table.tabs tr").mouseover(function(){jQuery(this).addClass("hover")});jQuery("body #page #body div.tab-container table.tabs tr").mouseout(function(){jQuery(this).removeClass("hover")});jQuery("body #page #body div.tab-container table.tabs td.tab a").each(function(){jQuery(this).parent().parent().children().filter("td").click(function(){e=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;var a=jQuery(this).parent().children().filter("td.tab").children().filter("a").attr("hash");if(a!=window.location.hash)window.location.hash=a;else window.location.hash="#tab-none";window.scrollTo(0,e);if(window.location.hash!="#tab-none"&&window.location.hash!=""){jQuery("body #page #body div.tab-container div.tab-content div.tab").hide();jQuery("body #page #body div.tab-container div.tab-content div"+window.location.hash+".tab").show();jQuery("body #page #body div.tab-container table.tabs").addClass("active");jQuery("body #page #body div.tab-container table.tabs td.tab").removeClass("selected");jQuery("body #page #body div.tab-container table.tabs td.tab a[href="+window.location.hash+"]").parent().addClass("selected")}else{jQuery("body #page #body div.tab-container table.tabs").removeClass("active");jQuery("body #page #body div.tab-container table.tabs td.tab").removeClass("selected");jQuery("body #page #body div.tab-container div.tab-content div.tab").hide()}return false})});jQuery("body #page #body div.tab-container div.tab a.close-tab").click(function(){jQuery("body #page #body div.tab-container table.tabs").removeClass("active");jQuery("body #page #body div.tab-container table.tabs td.tab").removeClass("selected");jQuery("body #page #body div.tab-container div.tab-content div.tab").hide();window.location.hash="#tab-none";window.scrollTo(0,0);return false});setTimeout("window.scrollTo(0,0);",100)}jQuery("body #page #header #country-selector").hide();jQuery("body #page #header #menu-global li.country > a").click(function(){jQuery("body #eventbubble").length==0&&jQuery("body").append('<div id="eventbubble"></div>');jQuery("body #eventbubble").show();jQuery("#flashDiv object").hide();var b=0,a=0,c=jQuery(this).html();jQuery("body #page #header #country-selector li a span").each(function(){if(jQuery(this).html()==c){jQuery(this).parent().parent().addClass("selected");a=b}b++});jQuery("body #page #header #country-selector").css("left","-32px");if(a!=0){jQuery("body #page #header #country-selector").css("top","-"+(a*34-1)+"px");jQuery("body #page #header #country-selector").fadeIn("fast",function(){jQuery("body #page #header #country-selector").animate({top:"-12px"},500)})}else{jQuery("body #page #header #country-selector").css("top","-12px");jQuery("body #page #header #country-selector").fadeIn("fast")}});jQuery("body #page #header #menu-global li.country ul li a").click(function(){if(jQuery(this).parent().hasClass("selected")){jQuery("body #page #header #country-selector").animate({top:"-"+(jQuery("body #page #header #country-selector").height()+12)+"px"},500,"",function(){jQuery("body #page #header #country-selector").hide()});return false}else{jQuery(this).css("background-color","#2b85bf");jQuery(this).css("color","#fff")}});jQuery("body #eventbubble").add("body #logo").mouseover(function(){jQuery("body #eventbubble").hide();jQuery("body #page #header #country-selector").animate({top:"-"+(jQuery("body #page #header #country-selector").height()+12)+"px"},500,"",function(){jQuery("body #page #header #country-selector").hide();jQuery("#flashDiv object").show()});return false})});var videoWidth,videoHeight,afterURL;function showVideo(b){jQuery(".video-backdrop").css("opacity",0).show().fadeTo("fast",.65);var d=new Number(jQuery(jQuery(b).find("span")[0]).html()),c=new Number(jQuery(jQuery(b).find("span")[1]).html());afterURL=jQuery(jQuery(b).find("span")[2]).html();var f=jQuery(b).attr("href"),g=jQuery(b).offset(),e="/CrmOnline/Styles/mediaplayer/player.swf";if(f.match(/youtube.com/)){e=f.split("v=")[1].replace("&","?");e="http://youtube.com/v/"+e+"&autoplay=1"}var a=new SWFObject(e,"playerobject",d,c,"9","#");a.addParam("allowfullscreen","true");a.addParam("allowscriptaccess","always");a.addParam("wmode","opaque");a.addVariable("image","/CrmOnline/Styles/images/body-background.png");a.addVariable("file",f);a.addVariable("skin","/CrmOnline/Styles/mediaplayer/modieus.zip");a.addVariable("frontcolor","ffffff");a.addVariable("lightcolor","cc9900");a.addVariable("screencolor","ffffff");a.addVariable("stretching","fill");a.addVariable("autostart","true");jQuery(".video-outline").show().css({opacity:.75,width:jQuery(b).find("img").width()-2,height:jQuery(b).find("img").height()-2,left:g.left,top:g.top}).animate({width:d,height:c,left:jQuery(window).width()/2-d/2,top:jQuery(window).height()/2-c/2},"normal","swing",function(){jQuery(".video-outline").hide();jQuery(".video-player").hide().css({width:Number(d)+10+"px",height:Number(c)+"px",left:jQuery(window).width()/2-d/2-5,top:jQuery(window).height()/2-c/2-5}).fadeIn("fast");a.write(jQuery(".video-player").find(".player div")[0]);afterURL!=""&&setTimeout(attachVideoListener,1e3)})}function attachVideoListener(){if(jQuery("#playerobject").length==0)setTimeout(attachVideoListener,1e3);else jQuery("#playerobject").get(0).addModelListener("STATE","videoStateMonitor");return false}function videoStateMonitor(a){if(a.newstate=="COMPLETED"){this.window.focus();window.location.href=afterURL}}function hideVideo(){jQuery(".video-player").find(".player div").empty();jQuery(".video-player").animate({width:"20px",height:"10px",left:jQuery(window).width()/2-10,top:jQuery(window).height()/2-5},"fast");jQuery(".video-backdrop").add(".video-outline").add(".video-player").fadeOut("fast")}(function(a){var f=904,b=false,c=false,d=a('<img src="/publicweb/styles/images/loading-big.gif" alt="" />');a("a.lightbox").click(function(){var h=a(this).offset(),j=a(this).attr("href");if(!b){c=a('<div id="overlay"></div>');b=a('<div id="lightbox"></div>');c.hide();c.css({opacity:0,width:a(document).width(),height:a(document).height()});c.click(e);a("body").prepend(c);a("body").prepend(b)}c.append(d);d.css({top:a(window).height()/2+a(document).scrollTop()-33+"px"});d.show();c.show();c.animate({opacity:.75},400);b.css({left:"-1000px",width:f});a.get(j,{},i);function i(i){var c=a(i).find("#lightbox-content");c.find(".content").addClass("article-body");c.find(".screenshot h1").html()==""&&c.find(".screenshot h1").html("&nbsp;");a.trim(c.find(".screenshot p").html())==""&&c.find(".screenshot p").remove();d.hide();b.empty();b.append(c);if(b.find(".screenshot img").length>0)b.find(".screenshot img").width()>900&&a(b).find(".screenshot img").css("width",900);var e=b.height();b.css({top:h.top,left:h.left,width:"1px",height:"1px"});b.animate({width:f+"px",height:e+"px",left:a(document).width()/2-f/2+"px",top:40+a(document).scrollTop()+"px"},300,function(){b.css({height:"auto"})});g()}function g(c){if(c){var f=a(c).find("#lightbox-content");b.empty();b.append(f)}b.find("input.cancel, a.cancel").click(function(){e();return false});var d=a('<a id="lightbox-close" title="'+lightBoxCloseText+'">'+lightBoxCloseText+' <img src="/publicweb/styles/images/body-lightbox-close.png" alt="'+lightBoxCloseText+'" /></a>');b.find("h1").append(d).click(function(){e()});b.find(".closewindow a").text(lightBoxCloseText);b.find("form").submit(function(){var b={};a(this).find("input, textarea").each(function(){eval("formData."+a(this).attr("name")+' = "'+a(this).attr("value")+'"')});a.post(a(this).attr("action"),b,g);return false})}return false});function e(){c.css({opacity:0});c.hide();b.css({left:"-1000px"})}})(jQuery)
