$(document).ready(function(){
	if(typeof Array.prototype.indexOf == 'undefined')
		Array.prototype.indexOf = function(e){for(var i=0; i<this.length; i++)if(this[i]==e) return i; return -1;}
	
	$("a.order img").hover(function() {
		$(this).attr("src","img/order-hover.png");
			}, function() {
		$(this).attr("src","img/order.png");
	});
		
	$(".tabs li").click(function () {
		if($.browser.msie || $.browser.version=="8.0"){
			$(".footer").hide();
			$(".copy").hide();
		};
		objthis = $(this);
		obj = objthis.attr("id");
		$(".tabcontent>div").hide();
		$("." + obj).show();
		$(".tabs li").removeClass("current");
		objthis.addClass("current");
		if($.browser.msie || $.browser.version=="8.0"){
			$(".footer").show();
			$(".copy").show();
		};
	});
	
	$(".features .panel li").mouseover(function () {
		rotate._suspend()
		$(".features .image>div").hide();
		$(".features .image>." + $(this).attr('id')).show();
	}).mouseout(function(){ rotate._continue(['vps', 'servers', 'virtual', 'access', 'support'].indexOf($(this).attr('id'))) });
	
	if($.browser.msie){
		$(".plans .price_item:last-child").css("margin-right","0");
		if($.browser.version=="7.0" || $.browser.version=="6.0"){
			$(".sidebar .testimonial").append('<div class="triangle"></div>');
			$(".sidebar .testimonial p").prepend('<img src="/img/q_left.png" />');
			$(".sidebar .testimonial p").append('<img src="/img/q_right.png" style="margin-bottom: -12px;" alt="q_right" />');
		}
		$(".button_blue").mouseenter(function () { 
			objthis = $(this);
			obj = objthis.find("div");
			$(obj).addClass("hover")
		}).mouseleave(function () { 
			$(obj).removeClass("hover");
		});
		$(".button_red").mouseenter(function () { 
			objthis = $(this);
			obj = objthis.find("div");
			$(obj).addClass("hover")
		}).mouseleave(function () { 
			$(obj).removeClass("hover");
		});
	}
	
	rotate(5000);
	
	function rotate(timeout) {
		if(typeof rotate.index == 'undefined') rotate.index = 0;
		if(!$(".features .panel li:nth("+rotate.index+")").length) rotate.index = 0;
		if(!rotate.suspended) {
			$(".features .image>div").hide();
			$(".features .image>div:nth("+rotate.index+")").show();
		}
		rotate.index++;
		setTimeout(function(){ rotate(timeout) }, timeout)
		
		rotate._suspend = function(){	rotate.suspended = true	}
		rotate._continue = function(index){	rotate.index = index; rotate.suspended = false	}
	}

// drop down	
    try {
    	oHandler = $(".mydds").msDropDown().data("dd");
		oHandler.visible(true);
	} catch(e) { }

});
