jQuery.noConflict();

jQuery(document).ready(function() {
	jQuery('#accordion').msAccordion({
		defaultid : 1,
		autodelay : 4
	});
	if(jQuery.browser.msie) {//IE
		jQuery('.accordionWrapper div.title span').css({
			'writing-mode' : 'tb-rl',
			'filter' : 'flipv flipv',
			'line-height' : '39px',
			'height' : '290px',
			'font-size' : '19px',
			'width' : '39px'
		});
	}
});
/* Drop Down Menu */
jQuery('ul.superfish').superfish({
	delay : 200, // one second delay on mouseout
	animation : {
		'marginLeft' : '0px',
		opacity : 'show',
		height : 'show'
	}, // fade-in and slide-down animation
	speed : 'fast', // faster animation speed
	autoArrows : true, // disable generation of arrow mark-up
	onBeforeShow : function() {
		this.css('marginLeft', '20px');
	},
	dropShadows : false                            // disable drop shadows
});

jQuery('ul.nav > li > a.sf-with-ul').parent('li').addClass('sf-ul');

/* slide chạy logo */
jQuery(function() {
	//	Fuild layout example 2
	jQuery(window).resize(function() {
		var newWidth = jQuery('.list_carousel').width() - 85;
		jQuery('#fooF1').carouFredSel({
			auto : true,
			prev : "#prev",
			next : "#next",
			//items : 6,
			width : newWidth,
			//direction: "up",
			scroll : {
				items : 1,
				effect : "easeOutBounce",
				duration : 500,
				pauseOnHover : true
			}
		});
	});

	jQuery(window).resize();
});
//Slide ad 2 bên
jQuery(function() {
	var minHeight = jQuery(window).height();
	//alert(minHeight);

	var newpos1 = (minHeight - 100) / 4;
	var newpos2 = (minHeight - 100) / 4;
	jQuery('#slideads1').css({
		"margin-top" : newpos1
	});
	jQuery('#slideads2').css({
		"margin-top" : newpos2
	});	
});
/* IPAD */
jQuery(function() {
	//	Basic carousel + timer
	jQuery('#comments').carouFredSel({
		items : 1,
		direction : "up",
		scroll : {
			items : 1,
			effect : "easeOutBounce",
			duration : 1500,
			pauseOnHover : true
		},
		prev : "#prev1",
		next : "#next1",
		auto : {

			pauseOnHover : 'resume',
			onPauseStart : function(percentage, duration) {
				jQuery(this).trigger('configuration', ['width',
				function(value) {
					jQuery('#timer1').stop().animate({
						//width : value //độ dài của thanh chạy time
						width : 300
					}, {
						duration : duration,
						easing : 'linear'
					});

				}]);

			},
			onPauseEnd : function(percentage, duration) {
				jQuery('#timer1').stop().width(0);
			},
			onPausePause : function(percentage, duration) {
				jQuery('#timer1').stop();
			}
		}
	});

});
jQuery(function() {
	jQuery('.list_comment').hover(function() {
		//alert('hover');
		jQuery('#play').addClass('pause');
	}, function() {
		jQuery('#play').removeClass('pause');
		//alert('unhover');
	});
});
jQuery(function() {
	jQuery(".lienhe").fancybox({
		'width' : 690,
		'height' : 1110,
		'autoScale' : false,
		'scrolling' : 'no',
		'transitionIn' : 'none',
		'transitionOut' : 'none',
		'overlayShow' : false,
		'type' : 'iframe'
	});

	jQuery("#bando1").fancybox({
		'padding' : 0,
		'width' : 690,
		'height' : 400,
		'autoScale' : false,
		'transitionIn' : 'elastic',
		'transitionOut' : 'elastic'
	});

	jQuery(".dangxaydung").fancybox({
		'padding' : 0,
		'autoScale' : false,
		'transitionIn' : 'none',
		'transitionOut' : 'none'
	});
	jQuery(".giacuoc").fancybox({
		'titlePosition' : 'inside',
		'transitionIn' : 'none',
		'transitionOut' : 'none'
	});

	jQuery(".xem-anh").fancybox({
		'overlayShow' : true,
		'transitionIn' : 'elastic',
		'transitionOut' : 'elastic'
	});
});

