/*popup*/
jQuery.fn.popupwindow=function(p){var profiles=p||{};return this.each(function(index){var settings,parameters,mysettings,b,a;mysettings=(jQuery(this).attr("rel")||"").split(",");settings={height:600,width:600,toolbar:0,scrollbars:0,status:0,resizable:1,left:0,top:0,center:0,createnew:1,location:0,menubar:0};if(mysettings.length==1&&mysettings[0].split(":").length==1){a=mysettings[0];if(typeof profiles[a]!="undefined"){settings=jQuery.extend(settings,profiles[a])}}else{for(var i=0;i<mysettings.length;i++){b=mysettings[i].split(":");if(typeof settings[b[0]]!="undefined"&&b.length==2){settings[b[0]]=b[1]}}}if(settings.center==1){settings.top=(screen.height-(settings.height+110))/2;settings.left=(screen.width-settings.width)/2}parameters="location="+settings.location+",menubar="+settings.menubar+",height="+settings.height+",width="+settings.width+",toolbar="+settings.toolbar+",scrollbars="+settings.scrollbars+",status="+settings.status+",resizable="+settings.resizable+",left="+settings.left+",screenX="+settings.left+",top="+settings.top+",screenY="+settings.top;jQuery(this).bind("click",function(){var name=settings.createnew?"PopUpWindow"+index:"PopUpWindow";window.open(this.href,name,parameters).focus();return false})})};

var profiles = { ytmakeoverwide: { height: 425, width: 680, center: 1, createnew: 0, status: 1 }, ytmakeover: { height: 430, width: 525, center: 1, createnew: 0, status: 1 }, youtubewide: { height: 380, width: 593, center: 1, createnew: 0, status: 1 },welcome: { height: 380, width: 443, center: 1, createnew: 0, status: 1 },invitation: { height: 310, width: 495, center: 1, createnew: 0, status: 1 },audio: { height: 50, width: 250, center: 1, createnew: 0, status: 1 }, webinar: { height: 670, width: 820, center: 1, createnew: 0, status: 1 }, windowday: { height: 430, width: 780, center: 1, createnew: 0, status: 1 }, windowcallcenter: { height: 640, width: 980, center: 1, createnew: 0, status: 1 }, windowdemo: { height: 418, width: 624, center: 1, createnew: 0, status: 1 },windowtoolbar: { height: 560, width: 740, center: 1, createnew: 0, status: 1 },window800: { height: 800, width: 800, status: 1 }, window200: { height: 200, width: 200, status: 1, resizable: 0 }, windowCenter: { height: 300, width: 400, center: 1 }, windowNotNew: { height: 300, width: 400, center: 1, createnew: 0 }, windowemailcol: { height: 510, width: 400, center: 1, createnew: 0 }, windowprint: { height: 400, width: 600, center: 1, createnew: 0, scrollbars: 1}, newsletter: { height: 670, width: 405, center: 1, createnew: 0 }, windowprint: { height: 400, width: 600, center: 1, createnew: 0, scrollbars: 1} };

$().ready(function() {
    $('a[rel="external"]').click(function() {
        window.open($(this).attr('href'));
        return false
    })
});



document.write('<style type="text/css">#main-accordion{display:none}</style>');
$(function($) {
$('#main-accordion').css('display','block');
$(".popupwindow").popupwindow(profiles);
});
$(document).ready(function() {
$('#main-accordion').accordion();
$("#main-accordion .ui-accordion-header ").removeClass('ui-corner-all');
$("#main-accordion .ui-accordion-header ").removeClass('ui-corner-top');
$('.ui-accordion-header').attr('tabindex',''); 


$(".news-large ul li:odd").addClass("alternate");
$(".event-large ul.events-list li:odd").addClass("altevent");
$(".webcast-large ul.events-list li:odd").addClass("altevent");

$(".careers-main tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});
$(".careers-main tr:even").addClass("alt");


$('.crumbs ul li:first').addClass('first');
$('div.press-inthenews ul li:last-child').addClass('bgnone');
$('div.bio-links ul li:last-child').addClass('bgnone');
$('div.bio-name ul li:last-child').addClass('brdrnone');
$('div.toolbox-orange ul li:last-child, div.toolbox-gray ul li:last-child, div.toolbox-gold ul li:last-child').addClass('bgnone');
$('div.directions ul li:even').addClass('alt');
$('div.copy-links ul li:last-child').addClass('final');
 

$("#searchbtnWrap").hover( function() { 
$("#searchbtn",this).css("margin-top","-31px"); },
 function() { $("#searchbtn",this).css("margin-top","0"); });
var seek = "Search";
$(".search-field").val(seek); 
$(".search-field").css({color: "#aaaaaa"});
$(".search-field").focus(function(){
if($(this).val() == seek){
$(this).val("");
}
$(".search-field").css({color: "#000000"});
});
$(".search-field").blur(function(){
if($(this).val() == ("")){
$(this).val(seek);
}
$(".search-field").css({color: "#aaaaaa"});
});





$('div#broadworks-callout').cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 9000, 
	pause: true
});
$('div#packetsmart-callout').cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 9000, 
	pause: true
});

$('div#main-feature').cycle({ 
	
    fx:     'fade', 
    speed:  'fast', 
    timeout: 9000, 
	pause: true,
    pager:  '#main-feature-nav' 
});

 



$('div#award-logos').cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 4000, 
	pause: true
});

 
});
         

$(function() {
		$('#af-tabs').tabs();
		$("#af-tabs .ui-widget-header ").removeClass('ui-corner-all');
		$("#af-tabs .ui-tabs-nav li").removeClass('ui-corner-top').addClass('ui-corner-left');
			$("#af-tabs .ui-tabs-panel ").removeClass('ui-corner-bottom');


	});



function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

$(document).ready(function() {
    $('#customers-carousel').jcarousel({
        auto: 2,
		wrap: 'last',
        initCallback: mycarousel_initCallback
    });
});
$(document).ready(function() {
    $('#awards-carousel').jcarousel({
        auto: 4,
		wrap: 'last'
    });
});
$(document).ready(function() {
    $('#partners-carousel').jcarousel({
        auto: 4,
		wrap: 'last'
    });
});

$(function() {
$('#board-hide1, #board-hide2, #board-hide3, #board-hide4, #board-hide5, #board-hide6, #board-hide7').hide();
$('a.board-button1').click(function() {
$("#board-hide1").toggle("blind", { direction: "vertical" }, 300);
$(".board-button1").toggleClass('taco');
 return false;
});  

$('a.board-button2').click(function() {
$("#board-hide2").toggle("blind", { direction: "vertical" }, 300);
$(".board-button2").toggleClass('taco');
 return false;
});

$('a.board-button3').click(function() {
$("#board-hide3").toggle("blind", { direction: "vertical" }, 300);
$(".board-button3").toggleClass('taco');
 return false;
});

$('a.board-button4').click(function() {
$("#board-hide4").toggle("blind", { direction: "vertical" }, 300);
$(".board-button4").toggleClass('taco');
 return false;
});

$('a.board-button5').click(function() {
$("#board-hide5").toggle("blind", { direction: "vertical" }, 300);
$(".board-button5").toggleClass('taco');
 return false;
});

$('a.board-button6').click(function() {
$("#board-hide6").toggle("blind", { direction: "vertical" }, 300);
$(".board-button6").toggleClass('taco');
 return false;
});

$('a.board-button7').click(function() {
$("#board-hide7").toggle("blind", { direction: "vertical" }, 300);
$(".board-button7").toggleClass('taco');
 return false;
});
//  Home Small Video Background Hover
$(".makeover-thumb").hover(function() {
	$(this).find('.makeover-vid-image').fadeTo(120, 0.8);
  	$(this).find('span.makeover-play').animate({  opacity: 'show' }, 100);
	}, function() {
  		$(this).find('.makeover-vid-image').fadeTo(120, 1.0);
  		$(this).find('span.makeover-play').animate({  opacity: 'hide' }, 100);  
});
//  int Small Video Background Hover
$(".makeover-int-thumb").hover(function() {
	$(this).find('.makeover-int-vid-image').fadeTo(120, 0.8);
  	$(this).find('span.makeover-int-play').animate({  opacity: 'show' }, 100);
	}, function() {
  		$(this).find('.makeover-int-vid-image').fadeTo(120, 1.0);
  		$(this).find('span.makeover-int-play').animate({  opacity: 'hide' }, 100);  
});
});


