function base(){	
	//
	$("body").append("<script type='text/javascript' src='/js/thickbox.js'></script>");
	// if ie6
	if ($.browser.msie && $.browser.version.substr(0,1)>6) {
	  $("div.middle-left").css('behavior','url(/style/PIE.htc)');
	  $("ul.nav li a").css('behavior','url(/style/PIE.htc)');
	  $("div.int-main-left").css('behavior','url(/style/PIE.htc)');
	}
 
	// add lytebox stylesheet and js file to head and foot
	$("head").append("<link rel='stylesheet' href='/style/lytebox.css' />");
	$("body").append("<script type='text/javascript' src='/js/lytebox.js'></script>");

	// email form
	$("form.email-signup input.text").val("E-mail Address");
	$("form.email-signup input.text").focus(function(){
		if ( $(this).val() == "E-mail Address" ){
			$(this).val("");
		}
	});
	$("form.email-signup input.text").blur(function(){
		if ( $(this).val() == "" ){
			$(this).val("E-mail Address");
		}
	});
	
	// accordian	
	$("div.int-main-right ul li:last").css({height:"289px"}, 300);
	$("div.int-main-right ul li a").click(function(){
		if ($(this).parent().hasClass("active") != true ) {
			whichActive = $(this).parent("li").attr("id");
			$("div.int-main-right ul li").removeClass("active");
			$("div.int-main-right ul li#"+whichActive).addClass("active");
			$("div.int-main-right ul li#"+whichActive).animate({height:"289px"}, 300);
			$("div.int-main-right ul li#"+whichActive).siblings("li").animate({height:"36px"}, 300);
		}
	});
	
	$("a.soon").hover(function(){
		$(this).children().text("Coming Soon");
	});
			
} // end base

var rotateCounter = "5";
var keepRunning = true;
var rotatePosition = "0";

function switchContent(){
	if (keepRunning){
		if ( rotatePosition < rotateCounter ){
			//alert("yesy");
			$("div.flash ul.images").animate({top:rotatePosition*-275},700);
			rotatePosition++;
			$("ul.selector li").removeClass("active");
			$("ul.selector li."+rotatePosition).addClass("active");
		}
		else{
			rotatePosition = "1";
			$("div.flash ul.images").animate({top:"0px"},275);
			$("ul.selector li").removeClass("active");
			$("ul.selector li."+rotatePosition).addClass("active");
		}
		setTimeout('switchContent()', 7500);
	}
	$("ul.selector li").hover(function(){
		keepRunning = false;
		rotatePosition = $(this).attr("class");
		if( $(this).hasClass("active") == false ){
			$("ul.selector li."+rotatePosition).addClass("active");
			$("ul.selector li."+rotatePosition).siblings("li").removeClass("active");
			$("div.flash ul.images").animate({top:(rotatePosition-1)*-275},500);
		}
	});
} // end switchContent

var whichTab = "01";
function tabs(){
	$("div.tabsBody").hide();
	$("ul.tabsSelect a#"+whichTab).addClass("active");
	$("div#"+whichTab+"Body").show();
	$("ul.tabsSelect a").click(function(){
		if (whichTab != this.id) {
			$("ul.tabsSelect a").removeClass("active");
			$(this).addClass("active");
			$("div.tabsBody").hide();
			$("div#"+this.id+"Body").fadeIn();
			whichTab = this.id;
		}
	});
} // end tabs



function slider(){
	// scroll
  $(function(){
    var container = $('div.sliderGallery');
    var ul = $('ul', container);
    
    var itemsWidth = ul.innerWidth() - container.outerWidth();
    
    $('.slider', container).slider({
      minValue: 0,
      maxValue: itemsWidth,
      handle: '.handle',
      stop: function (event, ui) {
        ul.animate({'left' : ui.value * -1}, 300);
      },
      slide: function (event, ui) {
        ul.css('left', ui.value * -1);
      }
    });
  });
}

function innerfade(){
	$("div.middle-left ul").innerfade({ 
		animationtype: 'fade', 
		speed: 750, 
		timeout: 3000,	
		containerheight: '275px'
	 }); 
	$(".top-flash").innerfade({ 
		animationtype: 'fade', 
		speed: 750, 
		timeout: 5000,	
		containerheight: '64px'
	 }); 
}
function colorbox(){
		$(".entertowin").colorbox({ transition:"elastic", iframe:true, scrolling:true, innerWidth:840, innerHeight:532, opacity:0.61, overlayClose:false });
  $(".hurricane").colorbox({ transition:"elastic", iframe:true, scrolling:true, innerWidth:310, innerHeight:720, opacity:0.61, overlayClose:true });
}


