function initStats(){var a=_gat._getTracker("UA-19418028-1");a._initData()}function runStats(a){_gaq.push(["_setAccount","UA-19418028-1"],["_setReferrerOverride",realreferrer],["_trackPageview",a],["_trackPageLoadTime"]);realreferrer=0}function redirectHash(){var b=false;if(window.location.hash){var a=window.location.hash.replace(/^#/,"")}else{var a=false}if(!a){if(window.location.pathname!="/"){var c=window.location.pathname.replace(/^\//,"");window.gotoHash=c;var b=true;triggerRedirect()}else{window.location.hash="#home"}}}function readCookie(b){var e=b+"=";var a=document.cookie.split(";");for(var d=0;d<a.length;d++){var f=a[d];while(f.charAt(0)==" "){f=f.substring(1,f.length)}if(f.indexOf(e)==0){return f.substring(e.length,f.length)}}return""}function triggerRedirect(){document.cookie="realreferrer="+encodeURIComponent(document.referrer)+"; path=/";var a=window.gotoHash;window.location.href="http://www.perigeeglobal.com/#"+unescape(a)}function standardContentHeights(){if($(".frontCont").length>0){var a=$(".frontCont").outerHeight()}else{if($(".plainContent").height()<$(".plainContent").find(".left").outerHeight()){var a=$(".plainContent").find(".left").outerHeight()+$(".fadeContainer").children(".plainContent").height()+25}else{var a=$(".fadeContainer").children(".plainContent").height()+25}}if(!currentTabs==tabsDisplay){var b=1000}else{var b=100}$("#components-lower").delay(b).css("min-height","").animate({height:a+"px"},800)}function navContentHeights(){var a=220;$(".mspContent").each(function(){var c=$(this).outerHeight();if(c>a){a=c}});$(".mspListContainer").each(function(){var c=$(this).outerHeight();if(c>a){a=c}});a=a+25;if(currentTabs!=tabsDisplay){var b=1000}else{var b=200}$("#components-lower").delay(b).css({"min-height":""});$("#components-lower").delay(b).animate({height:a+"px"},800)}function refreshContentHeights(c,b){var a=220;var d=$(c).children(".mspContent").outerHeight();if(d>a){a=d}var d=$(c).parent().outerHeight();if(d>a){a=d}a=a+25+b;$("#components-lower").animate({height:a+"px"},250,function(){$("#blaf").css({height:$(document).height()+"px"});$("#blif").css({height:$(document).height()+"px"})});$("#components-lower").css({"min-height":"200px"})}function fixedContentHeights(c){var a=200;$(c).find(".mspContent").each(function(){var d=$(this).outerHeight();if(d>a){a=d}});var b=$(c).children(".mspList").outerHeight();if(b>a){a=b}a=a+25;$("#components-lower").css({"min-height":"200px"});$("#components-lower").animate({height:a+"px"},800)}function serviceList(d,c){var a=$(d).children(".mspList").attr("id");$("#"+a).find(".mspContent").each(function(){$(this).siblings(".mspHead").removeClass("mspCurrent mspGrowing").css("width","205px").hide();$(this).hide()});if(!c){var b=$("#"+a+" li")[0]}else{b=$("#"+a+' li[name="'+c+'"]')}$("#"+a).find(".mspHead").fadeIn(300,function(){if(!_jump){$(b).children(".mspHead").addClass("mspHeadGrowing").animate({width:"270px"},100,function(){$(this).removeClass("mspHeadGrowing");$(this).addClass("mspCurrent").siblings(".mspContent").fadeIn(150);if(!_static){refreshContentHeights($(this).parent(),0)}})}_subItem=null;_item=null});if(!_static){refreshContentHeights(b,120)}$("#"+a+" li").mouseover(function(){if(window.bgState=="default"){var f="#000"}else{var f="#fff"}var e=$(this).children(".mspHead");$(e).css("color",f)});$("#"+a+" li").mouseout(function(){var e=$(this).children(".mspHead");$(e).css("color","")});$("#"+a+" h4.mspHead").mousedown(function(){if($(".pulldown_btn").hasClass(".open")){$(".pulldown_wrapper").css("height","");$(".pulldown_btn").removeClass(".open");var e=$(this).parent().parent().parent();fixedContentHeights("#"+$(e).attr("id"))}});$("#"+a+" li").mousedown(function(){var f=$(this);var e=$(f).attr("name");var h=$("#subNav li a.current").parent().attr("name");if(h!=null){var g=_area+"/"+h+"/"+e}else{var g=_area+"/"+e}window.location.hash=g;_recentHash=g;_gaq.push(["_setAccount","UA-19418028-1"],["_trackPageview","/"+g]);if(!$(this).children(".mspHead").hasClass("mspCurrent")){$(".mspHeadGrowing").stop().removeClass("mspHeadGrowing").animate({width:"205px"},20);$(this).parent().find(".mspCurrent").stop().removeClass("mspCurrent").siblings(".mspContent").fadeOut(250,function(){$(this).siblings(".mspHead").animate({width:"205px"},20)});$(f).children(".mspHead").addClass("mspHeadGrowing").delay(50).animate({width:"270px"},200,function(){_jump=false;$(this).removeClass("mspHeadGrowing").addClass("mspCurrent");$(this).siblings(".mspContent").fadeIn(700,function(){});if(!_static){refreshContentHeights($(this).parent(),0)}});_subItem=null;_item=null}});$(".pulldown_btn").mousedown(function(){if(!$(this).hasClass(".open")){$(this).addClass(".open");$slide=$(this).siblings(".pulldown_wrapper");var e=$($slide).children(".pulldown_content").height();$("#components-lower").animate({height:($("#components-lower").height()+e)+"px"},500);$($slide).animate({height:e+"px"},500)}})}function serviceListJump(){if(_ajaxLoadComplete==true){_jump=false;$('#subNav li[name="'+_item+'"]').children("a").delay(200).click();clearInterval(_pageTimer)}}function portfolioListJump(){if(_ajaxLoadComplete==true){clearInterval(_pageTimer)}}function internalLinks(){$("a.internal").click(function(){var a=$(this).attr("href");var b=a.replace(/^\//,"");window.location.hash=b;detectState();return false});$("a.internal").each(function(){if($(this).parent().parent().parent().attr("id")=="homecontent"){$(this).mouseover(function(){$(this).parent().css("border-left-color","#903030")});$(this).mouseout(function(){$(this).parent().css("border-left-color","")})}})}function detectState(){var b=window.location.hash;var c=b.split("#")[1];if(c!=_recentHash){if(!b){window.location.hash="home";exit}var a=c.split("/");if(a[0]){_item=a[1];_subItem=a[2];_ajaxLoadComplete=false;$("#navigationMenu a[href$="+a[0]+"]").click();switch(a[0]){case"services":if(a[1]){if(!_showingServices){_pageTimer=setInterval("serviceListJump()",200)}else{if(a[2]==null){$('#subNav li[name="'+a[1]+'"] a').click()}else{$('div.visible-tab li[name="'+a[2]+'"]').mousedown()}}}break;case"portfolio":if(!_showingPortfolio){_pageTimer=setInterval("portfolioListJump()",200)}else{if(!a[1]){$('li[name="overview"]').mousedown()}else{$('li[name="'+a[1]+'"]').mousedown()}}break}}_recentHash=c}}function style(c){$("#blaf").css("height","");$("#blif").css("height","");if(window.bgState!=c){switch(c){case"portfolio":var b="#131313";var a="#0c0c0c";var d="borderPortfolio";$("#components-subbody").fadeOut(500);$("#footer .footerSub").fadeOut(500);$("#footer").addClass("portfolio");$("#navigationMenu").addClass("portfolio");$("#blogandchat").addClass("darkstyle");break;case"default":var b="#ffffff";var a="#ffffff";$("#components-subbody").delay(200).fadeIn(1000);$("#footer .footerSub").delay(400).fadeIn(1200);$("#footer").removeClass("portfolio");$("#navigationMenu").removeClass("portfolio");$("#blogandchat").removeClass("darkstyle");var d="borderDefault"}$("#components-lower").removeClass("borderPortfolio borderDefault");$("#components-lower").delay(100).css("background-color",a).addClass(d);window.bgState=c;$("#blif").css({height:$(document).height()+"px"});$("#blaf").css({height:$(document).height()+"px",opacity:0,background:b}).animate({opacity:1},800,function(){$("#blaf").css({height:$(document).height()+"px"});$("#blif").css({height:$(document).height()+"px"});$("#blif").css({opacity:"1.0",background:b})})}}function triggerSlider(){$("#galleria").galleria({transition_speed:1400,autoplay:7000,show_imagenav:false,extend:function(a){window._Slider=this;this.bind(Galleria.IMAGE,function(b){$(".galleria-stage").click(function(){var c=$(".galleria-info-description").text();window.location.hash=c;detectState()})})}})}$(function(){var d="Please Wait ...";var b="/pages/";var a="/data/";$("#navigationMenu li a.ajax").click(function(){if(!$(this).hasClass("current")){_showingServices=false;_showingPortfolio=false;var f=$(this).attr("href");var e=f.split("/");if((!_subItem&&!_item)&&(e[0]!="services"&&e[0]!="portfolio")){window.location.hash=e[0];_recentHash=e[0]}$("#navigationMenu li a").removeClass("current");$("#navigationMenu li").removeClass("selectedLava");$("#navigationMenu li.backLava").remove();$("#loading").remove();$(this).addClass("current");$(this).parent().addClass("selectedLava");indexSelected=$("#navigationMenu li").index($(this));$("#navigationMenu").lavaLamp({fx:"swing",speed:800,startItem:indexSelected});$("#components-lower").css("min-height",$("#components-lower").height()+"px");$('<div id="loading">'+d+"</div>").appendTo("body").fadeIn(50,function(){$.ajax({type:"POST",url:b+e[0]+".html.php",data:"ajax=1",dataType:"html",timeout:5000,success:function(h,g){$("#loading").fadeOut(50,function(){tabsServices='<li name="web-design" class="first"><a class="navinternal" href="#services-1">Custom Design</a></li><li name="managed-hosting"><a class="navinternal" href="#services-2">Managed Hosting</a></li><li name="hosted-pbx"><a class="navinternal" href="#services-3">Managed Voice and PBX Solutions</a></li><li name="hosted-email"><a class="navinternal" href="#services-4">Corporate E-Mail Systems</a></li><li name="seo-consultancy"><a class="navinternal" href="#services-5">SEO Consultancy</a></li><li><a href="https://client.perigeeglobal.com/order.php">Order Now</a></li>';try{_Slider.pause()}catch(i){}$(".fadeContainer").fadeOut("medium",function(){$("#galleria").remove();$(this).html("");currentTabs=tabsDisplay;_showingServices=false;_section=null;switch(e[0]){case"services":_area="services";_showingServices=true;_urlPath="/"+_area;tabsHtml=tabsServices;tabsHeight=30;tabsDisplay="visible";document.title="Custom Web Design and Managed Hosting Services Details | Design and Hosted Solutions from Perigee Global";break;case"portfolio":_area="portfolio";_showingPortfolio=true;_urlPath="/"+_area;tabsHtml="";tabsHeight=0;tabsDisplay="hidden";document.title="Client and Design Portfolio| Design and Hosted Solutions from Perigee Global";break;case"home":document.title="Perigee Global Corporation | Design and Hosted Solutions Provider";case"about":document.title="Company Info | Design and Hosted Solutions from Perigee Global";case"contact":document.title="Contact Details | Design and Hosted Solutions from Perigee Global";default:_area="";tabsHtml="";tabsHeight=0;tabsDisplay="hidden";break}if(!_item){runStats("/"+f)}$("#subNav").fadeOut("fast",function(){$("#components-lower").addClass("clearfix ui-widget ui-widget-content ui-corner-all");$("#components").delay(50).animate({height:tabsHeight+"px"},500,function(){if(tabsDisplay=="visible"){$("#subNav").html(tabsHtml).fadeIn("fast",function(){_ajaxLoadComplete=true})}$("#subNav li a.navinternal").click(function(){var l=$(this).attr("href").split("#")[1];if(_subItem!=null){var k=_subItem;_subItem=null}else{k=0}_section=$(this).parent().attr("name");if(!k){_urlPath="/"+_area+"/"+_section;_recentHash=_area+"/"+_section;window.location.hash=_area+"/"+_section}else{_urlPath="/"+_area+"/"+_section+"/"+k;_recentHash=_area+"/"+_section+"/"+k;window.location.hash=_area+"/"+_section+"/"+k}runStats(_urlPath);$(".fadeContainer").children(".visible-tab").fadeOut(200,function(){$(this).removeClass("visible-tab")});$("#subNav li a").delay(100).removeClass("current");$("#"+l).delay(200).fadeIn(300,function(){$(this).addClass("visible-tab")});$('#subNav li a[href$="'+l+'"]').delay(200).addClass("current");serviceList("#"+l,k);return false})})});$(this).html(h).fadeIn(1200);switch(e[0]){case"home":triggerSlider();standardContentHeights();style("default");break;case"portfolio":_static=false;if(_static){navContentHeights()}if(_item!=null){var j=_item;_item=null}else{j=0}serviceList("#portfolio-1",j);style("portfolio");_ajaxLoadComplete=true;break;case"about":standardContentHeights();style("default");break;case"services":_static=true;if(_jump){$(".subNavIntro").hide()}if(_static){navContentHeights()}$(".mspListContainer").hide();style("default");break;case"contact":standardContentHeights();style("default");$("#contactForm").validate({submitHandler:function(k){$(k).ajaxSubmit({url:a+"form.php?validated=1",type:"POST",success:function(){$("<div />").attr({"class":"form-ok"}).html("Your request has been submitted successfully. Thank You").appendTo($("div#formResultBox")).fadeIn("slow");runStats("/page/success")},error:function(){$("<div />").attr({"class":"form-error"}).html("An error occured while submitting your request").appendTo($("div#formResultBox")).fadeIn("slow")}});return false}});break}internalLinks()})})},error:function(i,g,h){$("#loading").html("Ajax Request Failed: "+g)}})})}return false});redirectHash();if(window.location.hash){if(window.location.hash.split("#")[0]=="portfolio"){var c="dark"}else{var c="light"}$("#content").animate({opacity:0.2},500,function(){$('<div id="loadIcon" class="'+c+'"></div>').appendTo("body").fadeIn(50,function(){$("#loadIcon").delay(1600).fadeOut(200,function(){$("#content").animate({opacity:1},800,function(){$("#loadIcon").remove()})})})})}_ajaxLoadComplete=false;_pageTimer=0;_jump=false;_jumpItem=null;_subItem=null;_static=false;_recentHash=null;_item=null;_showingServices=false;_showingPortfolio=false;window.bgState="default";tabsDisplay="hidden";currentTabs="hidden";setTimeout("detectState()",50);setInterval("detectState()",300);$("#navigationMenu").lavaLamp({fx:"swing",speed:800,startItem:0});Galleria.loadTheme("js/galleria/themes/dots/galleria.dots.js");internalLinks()});
