var isSelected = 0; if($.cookie("whichtabselected")) { isSelected = $.cookie("whichtabselected"); } function psMenu () { $(".marketplacebox a").click(function(){ var cookieset = $(this).attr("rel"); if (cookieset == "public") { $.cookie("whichtabselected", "0", {expires: 365, path: '/'}); } else if (cookieset == "private") { $.cookie("whichtabselected", "1", {expires: 365, path: '/'}); } else if (cookieset == "npo") { $.cookie("whichtabselected", "2", {expires: 365, path: '/'}); } }); } function poTab () { $("a.poTab").click(function(){ var cookieset = $(this).attr("rel"); if (cookieset == "public") { $.cookie("whichtabselected", "0", {expires: 365, path: '/'}); } else if (cookieset == "private") { $.cookie("whichtabselected", "1", {expires: 365, path: '/'}); } else if (cookieset == "npo") { $.cookie("whichtabselected", "2", {expires: 365, path: '/'}); } }); $("a.poTabsitemap").click(function(){ var cookieset = $(this).attr("rel"); if (cookieset == "public") { $.cookie("whichtabselected", "0", {expires: 365, path: '/'}); } else if (cookieset == "private") { $.cookie("whichtabselected", "1", {expires: 365, path: '/'}); } else if (cookieset == "npo") { $.cookie("whichtabselected", "2", {expires: 365, path: '/'}); } }); } function sendToFlash (whatToSend) { if (flashMovie) { var txt = whatToSend; flashMovie.sendText(txt); } } var flashMovie; function getFlash() { if (document.getElementById) { flashMovie = document.getElementById("mymovie"); } } function pauseFLV() { $("a.ei_comm").click(function(){ sendToFlash("5"); }); } function playFLV() { sendToFlash("6"); } function colorIt(newColor, newBgColor,newMenuBg) { //console.log(newColor); try { if ($("#topAll").css("background-color").length > 0 && $("#accountarrowdown").css("background-color").length > 0 && $("#contentAll").css("background-color").length > 0) { $("#topAll, #accountarrowdown").animate({ backgroundColor: "rgb(" + newColor + ")" }, 500); $("#contentAll").animate({ backgroundColor: "rgb(" + newBgColor + ")"}, 500); //$(".menu ul li:hover ul li a:hover").css("background-color","rgb(" + newMenuBg + ")"); //alert (newMenuBg); if (newMenuBg == 0) { // $(".menu ul").removeClass("allPurpleLinks allGreenLinks").addClass("allBlueLinks"); sendToFlash ("0"); } else if (newMenuBg == 1) { // $(".menu ul").removeClass("allBlueLinks allGreenLinks").addClass("allPurpleLinks"); sendToFlash ("1"); } else if (newMenuBg == 2) { //$(".menu ul").removeClass("allBlueLinks PurpleLinks").addClass("allGreenLinks"); sendToFlash ("2"); } } } catch (err) { return false; } //$("#accountarrowdown").animate({ backgroundColor: "rgb(" + newColor + ")" }, 500); //console.log(newColor + " done"); } function tooltipIt() { $('.ttip a[rel]').each(function() { $(this).qtip( { content: { // Set the text to an image HTML string with the correct src URL to the loading image you want to use url: $(this).attr('rel'), // Use the rel attribute of each element for the url to load title: { text: $(this).text() // Give the tooltip a title using each elements text } }, position: { corner: { target: 'bottomMiddle', // Position the tooltip above the link tooltip: 'topMiddle' }, adjust: { screen: true // Keep the tooltip on-screen at all times } }, show: { when: 'mouseover', solo: true // Only show one tooltip at a time }, hide: { when: 'mouseout', fixed: true }, style: { tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner border: { width: 0, radius: 4 }, name: 'light', // Use the default light style width: {min:0,max:570} // Set the tooltip width } }) }); } function tooltipItPS() { $('.servicelist a[title]').each(function() { $(this).qtip( { content: { // Set the text to an image HTML string with the correct src URL to the loading image you want to use title: { text: $(this).text() // Give the tooltip a title using each elements text } }, position: { corner: { target: 'bottomRight', tooltip: 'leftBottom' }, adjust: { screen: true // Keep the tooltip on-screen at all times } }, show: { when: 'mouseover', solo: true // Only show one tooltip at a time }, hide: { when: 'mouseout', fixed: true }, style: { tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner border: { width: 0, radius: 4 }, name: 'light', // Use the default light style width: {min:0,max:570} // Set the tooltip width } }) }); } function tooltipItIndex() { $('.ttip a[rel]').each(function() { $(this).qtip( { content: { // Set the text to an image HTML string with the correct src URL to the loading image you want to use url: $(this).attr('rel'), // Use the rel attribute of each element for the url to load title: { text: $(this).text() // Give the tooltip a title using each elements text } }, position: { corner: { target: 'bottomMiddle', // Position the tooltip above the link tooltip: 'topMiddle' }, adjust: { screen: true // Keep the tooltip on-screen at all times } }, show: { when: 'mouseover', solo: true // Only show one tooltip at a time }, hide: { when: 'mouseout', fixed: true }, style: { tip: true, // Apply a speech bubble tip to the tooltip at the designated tooltip corner border: { width: 0, radius: 4 }, name: 'light', // Use the default light style width: {min:250,max:570} // Set the tooltip width } }) }); } function accordionmoreinfo() { $("a.more-info").click(function(){ var target = $(this).attr("rel"); var prevText = $(this).attr("title"); if ($(target).hasClass("expanded")) { // $(target).fadeOut("fast").removeClass("expanded");; $(target).slideUp("fast").removeClass("expanded"); $(this).text(prevText); //$(target+"dots").css({display:'inline'}); // $(target).css({display:'none'}); // $("a.more-info").$(target2).html("READ MORE"); //alert (target2); } else { //console.log(target+"dots"); //$(target).fadeIn("fast").addClass("expanded"); $(target).slideDown("fast").addClass("expanded"); $(this).text("CLOSE"); // $(target+"dots").css({display:'none'}); //$(target).css({display:'inline'}); // $("a.more-info").$(target2).html("CLOSE"); // alert (target2); } return false; }); } function scrollMeWhere (locationid) { $.scrollTo(locationid, 800); } function initScroll () { $("a.scrollMe").click(function(){ var targetScroll = $(this).attr("rel"); scrollMeWhere(targetScroll); })} var whichMenuToTab = 0; $(document).ready(function(){ $('.menuToTab').click(function() { // bind click event to link whichMenuToTab = $(this).attr('rel'); if (whichMenuToTab == 0) { $('#tabs').tabs('load', 0); $('#tabs').tabs('select', 0); } else if (whichMenuToTab == 1) { $('#tabs').tabs('load', 1); $('#tabs').tabs('select', 1); } else if (whichMenuToTab == 2) { $('#tabs').tabs('load', 2); $('#tabs').tabs('select', 2); } $.cookie("whichtabselected", whichMenuToTab, {expires: 365, path: '/'}); }); $('#tabs').tabs({ selected: isSelected, select: function(event, ui) { if ($(":animated").length == 0) { //console.log("animated" + ui.index); // alert (ui.index); if(ui.index == 0) { // colorIt('61,154,220', '57,152,219','0'); $.cookie("whichtabselected", 0, {expires: 365, path: '/'}); sendToFlash ("0"); } else if(ui.index == 1) { // colorIt('127,91,141', '140,99,156','1'); $.cookie("whichtabselected", 1, {expires: 365, path: '/'}); sendToFlash ("1"); } else if(ui.index == 2) { // colorIt('114,148,49', '137,175,65','2'); $.cookie("whichtabselected", 2, {expires: 365, path: '/'}); sendToFlash ("2"); } //console.log("animated done"); } else { //console.log("can't do it"); return false; } //console.log("selected done"); } }); if(isSelected == 0) { // colorIt('61,154,220', '57,152,219','0'); sendToFlash ("0"); } else if(isSelected == 1) { // colorIt('127,91,141', '140,99,156','1'); sendToFlash ("1"); } else if(isSelected == 2) { // colorIt('114,148,49', '137,175,65','2'); sendToFlash ("2"); } getFlash(); psMenu(); poTab(); pauseFLV(); });