
$(document).ready(function(){
		
// {{{ compare page mobile tabs
	
	$("#blackberry").click(function() {
		$(".toggle").hide();
		$("#blackberry_table").show();
		$("#mobilenav a div").removeClass("active");
		$("#blackberry div").addClass("active");
	});
	$("#windowsmobile").click(function() {
		$(".toggle").hide();
		$("#windowsmobile_table").show();
		$("#mobilenav a div").removeClass("active");
		$("#windowsmobile div").addClass("active");
	});
	$("#iphone").click(function() {
		$(".toggle").hide();
		$("#iphone_table").show();
		$("#mobilenav a div").removeClass("active");
		$("#iphone div").addClass("active");
	});
	$("#other").click(function() {
		$(".toggle").hide();
		$("#other_table").show();
		$("#mobilenav a div").removeClass("active");
		$("#other div").addClass("active");
		$("#other .details").show();
	});

	var isMac = navigator.userAgent.indexOf("Mac") != -1 ;
	if (isMac) { 
		$("#leftFrameBottom").addClass("fixMac");
	} 
	
	/* }}} */
	
// {{{ convert entire li into link
		$list = $('.fullFeatureList li a').parents('li');
		$list.each(function(){
			if( $(this).find('a').length == 1) {
				$(this).css({'cursor':'pointer'}).click( function(){
					var link = $(this).find('a:first').attr('href');
					window.open(link, '_self');
				});
			}
		});

		/* has bug in IE7
		 * .hover(function(){
			$(this).addClass('highlight');
		}, function() {
			$(this).removeClass('highlight');
		})*/

// }}}

// {{{ highlight

	function highlighter() {	
		$('.hiHover').children().hover(function(){
			$(this).addClass('highlight');
		}, function() {
			$(this).removeClass('highlight');
		});	
	}

	highlighter();
	
// }}}

// {{{ faq toggle 

	function toggler() {
		// toggle open/close
		
		$('.expandableList li .listTitleH4')
		.addClass('plus')
		.css({'cursor':'pointer'})
		.toggle(function(){
			$(this).removeClass('plus').addClass('minus')
			.siblings('div').slideDown(200);
		}, function(){	
			$(this).removeClass('minus').addClass('plus')
			.siblings('div').slideUp(200);
		})
		.siblings('div').hide();
	}

	toggler();

// }}}

// {{{ search page iframe hacks

	$('#search iframe').attr('height','960').css({'font-face':'Verdana'});

// }}}

// {{{ cycle banners for home page
	if($().cycle) {
		$('#row1 .rotate').cycle({fx: 'fade', speed: 1000, timeout: 10000, pager: '#pager', pause: true});
	}
// }}}
	
// {{{ Hybrid page tabs and submission
	$('#exampleTabs li div').click(function(){
		$('#exampleTabs li div').removeClass('active');
		$(this).addClass('active');
		$('.exampleWrapper').hide();
		target = '#' + $(this).parent('li').attr('id').replace('Tab','');
		$(target).fadeIn(200);
	});
	$('#calcButton').click(function(){
		if( rackspace > 0 && exchange > 0 ) {
			window.location = CFG_SIGNUP_PATH+'combined/rax:'+rackspace+'/hex:'+exchange;
		}
		return false;
	});
// }}}

});

