// JavaScript Document
$(function () {
	
	//Round corners
	if(!isRunningIE) {
		DD_roundies.addRule('.allRound_5px, .package, .promoPopup, .promoPopupDetalii', '5px', true);
		DD_roundies.addRule('.topRound_5px', '5px 5px 0px 0px', true);
		DD_roundies.addRule('.bottomRound_5px', '0px 0px 5px 5px', true);
		DD_roundies.addRule('.leftRound_5px', '5px 0px 0px 5px', true);
		DD_roundies.addRule('.rightRound_5px', '0px 5px 5px 0px', true);
		DD_roundies.addRule('.ltRound_5px', '5px 0px 0px 0px', true);
		DD_roundies.addRule('.rtRound_5px', '0px 5px 0px 0px', true);
		DD_roundies.addRule('.rbRound_5px', '0px 0px 5px 0px', true);
		DD_roundies.addRule('.lbRound_5px', '0px 0px 0px 5px', true);
		DD_roundies.addRule('#domainOrderForm', '5px 0px 5px 5px', true);
		DD_roundies.addRule('#domainsList li a, #topNav .bg, .allRound_3px', '3px', true);
	}
	//Contact info hover 
	$('#contactInfo li').hover(
		function () {
			$(this).css('color','#375c5b');
		},
		function () {
			$(this).css('color','#87a9a9');
		}
	);
	
	//newsFlash scrollable
	 $('#flashNews .scrollable').scrollable({size: 1, keyboard: false}).circular().autoscroll(4000);
	
	//tabs for services on home page
	$("ul.tabs").tabs("div.panes > div", {effect: 'fade'});
	$('#servicePackages .scrollable').scrollable({size: 3, keyboard: false}).navigator();
	
	/*footer position bottom by dynamicaly adding height to MainContent 
	  in case the height is not pushing the footer enough*/
	if ($('#MainContent').height() < ($(window).height() -539)) {$('#MainContent').height($(window).height() -539)}
	
	//domain search, domain checkboxes
	$('#domainsList li a input').change(
		function () {
			$(this).parent().toggleClass('active');
		}
	);
	
	
	//topNav button opacity
	$('#topNav .bg').css('opacity', '0.5');
	
	
	
	
	$('#topNav .bg').css('opacity', '0.5');
	
	//Promo Popup scripts on "domain order" module
	$('.promo2').hover(
		function () {
			$(this).parent().css({'z-index' : '15'});
			$('~ .promoPopupDetalii2', this).fadeIn('fast');
		},
		function () {}
	);
	$('.promo2').bind('mouseleave', function () {$('~ .promoPopupDetalii2', this).fadeOut('fast'); $(this).parent().css({'z-index' : '1'});})
	
	
	
	
	//Promo Popup scripts on "domain order" module
	$('.promo').hover(
		function () {
			$(this).parent().css({'z-index' : '15'});
			$('~ .promoPopupDetalii', this).fadeIn('fast');
		},
		function () {}
	);
	$('.promoPopupDetalii').bind('mouseleave', function () {$(this).fadeOut('fast'); $(this).parent().css({'z-index' : '1'});})
	
})
