var secLogo=$('#sectionLogo');var content=$("#mainContent")
$(document).ready(function(){preload();function preload(){var secObj=new Array("profile","webSite","design","seo","host","customers","contact","subSec");var secCont=new Array("webSite","design","seo","host","customers","devProc","joomla","wp","hostBasic","hostPro");var pages;var headerFlash;var appPage;var appHead;for(var i=0;i<secCont.length;i++){pages=secCont[i]+"_content"
appPage='<span id='+"'"+pages+"'"+'></span>';content.append(appPage);$('#'+pages).load("sections/"+secCont[i]+".htm");}
for(var i=0;i<secObj.length;i++){var n=new Image();n.id=secObj[i]+"_img";n.src="images/sectionLogos/"+secObj[i]+".jpg";secLogo.append(n);if(secObj[i]!="subSec"){pages="pagesFlash_"+secObj[i];headerFlash="headerFlash_"+secObj[i];appPage='<span id='+pages+'></span>';appHead='<span id='+headerFlash+'></span>';$('#pagesFlashContainer').append(appPage);$('#headerFlashContainer').append(appHead);if(secObj[i]=="profile"){var noFlash;noFlash='<p><img src="images/noflash.png"><a href="http://www.adobe.com/go/getflashplayer"><img src="images/get_flash_player.gif"></a></p>'
$("#"+headerFlash).append(noFlash);}
var browser="";if(navigator.appName=="Microsoft Internet Explorer"){browser="ie/"}
$('#'+pages).flash({swf:"flash/pages/"+browser+"p_"+secObj[i]+".swf",height:654,width:912,params:{wmode:'transparent'},play:false,id:secObj[i]+'_page',name:secObj[i]+'_page'})
$('#'+headerFlash).flash({swliveconnect:true,swf:"flash/headers/"+secObj[i]+".swf",height:100,width:411,params:{wmode:'transparent'},id:secObj[i]+'_head',name:secObj[i]+'_head'})}}}
var sub=false;var self;var profile=$("#profile_content");var contact=$("#contact_content");var sections=$("#mainNav span");var myArray=new Array();myArray={"profile":false,"webSite":false,"design":false,"seo":false,"host":false,"customers":false,"contact":false};var lastTab="profile";var subSec=$("#mainNav li>ul li");sections.click(function(){self=this;if(myArray[this.id]==false){if(this.id!=lastTab){myArray[lastTab]=true;switchPage(lastTab);afterPageTurn(this,0)}else{rewind(this.id+"_head");play(this.id+"_head");slide(this);if(sub==true){switchContent(this);switchColors(this,true);}}}else{myArray[this.id]=false;switchPage(this.id);afterPageTurn(this,750)}
lastTab=this.id;});subSec.click(function(){switchContent(this);switchColors(this,false);sub=true;});function afterPageTurn(obj,timer){setTimeout(function(){switchHeader(obj);switchColors(obj,true);switchContent(obj);slide(obj);},timer)}
$('#form1').ajaxForm({target:'#error',success:function(){$('#error').fadeIn('slow');}});function play(movie){var flashMovie=getFlashMovieObject(movie);flashMovie.Play();}
function rewind(movie)
{var flashMovie=getFlashMovieObject(movie);flashMovie.Rewind();}
function getFlashMovieObject(movieName){if(window.document[movieName]){return window.document[movieName];}
if(navigator.appName.indexOf("Microsoft Internet")==-1){if(document.embeds&&document.embeds[movieName])return document.embeds[movieName];}else{return document.getElementById(movieName);}}
function switchHeader(obj){$('#headerFlashContainer span').css('visibility','hidden');$('#headerFlash_'+obj.id).css('visibility','visible');play(obj.id+"_head");};function switchPage(obj){$("#pagesFlash_"+obj).css('visibility','visible');play(obj+"_page");setTimeout(function(){$("#pagesFlash_"+obj).css('visibility','hidden');},840);};function switchColors(obj,replaceMenuColor){var secID;if($("#"+obj.id).parent().parent().is('li')){secID="subSec"}else{secID=obj.id;}
$("#sectionLogo img").hide();$("#"+secID+"_img").show();if(replaceMenuColor)
{$(sections).removeClass();$(obj).addClass(obj.id);}}
function switchContent(obj){$('#mainContent span').css('visibility','hidden')
$('#'+obj.id+"_content").css('visibility','visible')}
function slide(obj){$(obj).next("ul").slideToggle('normal');$(sections).next("ul").not($(obj).next("ul")).slideUp();}})