function getInternetExplorerVersion()
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}

function checkIeBrowser()
{
  var ver = getInternetExplorerVersion();

  if ( ver > -1 )
  {
    if ( ver >= 7 ) 
      return true;
    else
      return false;
  }
  return true;
}


$(document).ready(function(){
		$('#page_simple_middle').tabs({
			remote: true
		});
		$('#page_simple2_middle').tabs({
			remote: true
		});
		$('#page_simple5_middle').tabs({
			remote: true
		});
		$('#page_simple6_middle').tabs({
			remote: true
		});
		$('#page_fun_middle').tabs({
			remote: true
		});
		
		$('.lastnews-content').tabs({
			remote: true
		});

		if (checkIeBrowser())
		{
			$('#page_simple_middle').tabs('option', 'fx', { height: 'toggle', opacity: 'toggle', duration:'slow' });
			$('#page_simple2_middle').tabs('option', 'fx', { height: 'toggle', opacity: 'toggle', duration:'slow' });
			$('#page_simple5_middle').tabs('option', 'fx', { height: 'toggle', opacity: 'toggle', duration:'slow' });
			$('#page_simple6_middle').tabs('option', 'fx', { height: 'toggle', opacity: 'toggle', duration:'slow' });
			$('#page_fun_middle').tabs('option', 'fx', { height: 'toggle', opacity: 'toggle', duration:'slow' });
			$('.lastnews-content').tabs('option', 'fx', { height: 'toggle', opacity: 'toggle', duration:'slow' });
			
			$('.rotorama').innerfade({ 
				animationtype: 'fade',
				speed: 1000,
				timeout: 7000,
				type: 'sequence',
				containerheight: 'auto',
				runningclass: 'innerfade'
			}); 
			$('#marquesina').marquee('pointer').mouseover(function () {
				$(this).trigger('stop');
			}).mouseout(function () {
				$(this).trigger('start');
			}).mousemove(function (event) {
				if ($(this).data('drag') == true) {
					this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
				}
			}).mousedown(function (event) {
				$(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
			}).mouseup(function () {
				$(this).data('drag', false);
		});
		} else {
			$('.rotorama').innerfade({ 
				animationtype: 'slide',
				speed: 2000,
				timeout: 8000,
				type: 'sequence',
				containerheight: 'auto',
				runningclass: 'innerfade'
			}); 
			
		}
		$('.blink').blink();
});
