$(window).load(function(){
 	if ($.browser.msie && $.browser.version < 7){
		$.fn.colorbox({width:"50%", height:"50%", iframe:true, href:"browser.php", open:true}); 
	}
	$("a#recommend").colorbox({iframe:true, innerWidth:600, innerHeight:400});
	$("a[rel='3lightBox']").colorbox({innerWidth:300, innerHeight:300, slideshow:true, slideshowAuto:false});
	$("a[rel='5lightBox']").colorbox({innerWidth:500, innerHeight:500, slideshow:true, slideshowAuto:false});
	$("a[rel='photoalbum']").colorbox({innerWidth:700, innerHeight:650, slideshow:true, slideshowAuto:false});
	$("a[rel='photo']").colorbox({innerWidth:700, innerHeight:650, slideshow:true, slideshowAuto:false});
	$("a[rel='video']").colorbox({iframe:true, innerWidth:700, innerHeight:400});
	$("a[rel='audio']").colorbox({iframe:true, innerWidth:700, innerHeight:125});
	$("a[rel='friends']").colorbox({iframe:true, innerWidth:700, innerHeight:700});
	$("a[rel='members']").colorbox({iframe:true,innerWidth:700, innerHeight:700});
	$("a[rel='profile']").colorbox({iframe:true, innerWidth:700, innerHeight:700});
	$("a#photo").colorbox({iframe:true, innerWidth:700, innerHeight:700});
	$("a#video").colorbox({iframe:true, innerWidth:700, innerHeight:700});
	$("a#audio").colorbox({iframe:true, innerWidth:700, innerHeight:700});
	$("a#friends").colorbox({iframe:true, innerWidth:700, innerHeight:700});
	$("a#members").colorbox({iframe:true, innerWidth:700, innerHeight:700});
	$("a#profile").colorbox({iframe:true, innerWidth:700, innerHeight:700});
	$("a#groups").colorbox({iframe:true, innerWidth:"60%", innerHeight:"90%"});
	$("a#groups_photos").colorbox({iframe:true, innerWidth:"60%", innerHeight:"90%"});
	$("a#creategroups").colorbox({iframe:true, innerWidth:600, innerHeight:400});
	$("a#editgroups").colorbox({iframe:true, innerWidth:600, innerHeight:400});
	$("a[rel='group_members']").colorbox({iframe:true, innerWidth:"60%", innerHeight:"90%"});
	$("a[rel='group_post']").colorbox({iframe:true, innerWidth:"60%", innerHeight:"90%"});
	$("a[rel='group_map']").colorbox({iframe:true, innerWidth:800, innerHeight:700});
	$("a#misc").colorbox({iframe:true, innerWidth:600, innerHeight:400});
	$("a[rel='misc']").colorbox({iframe:true, innerWidth:600, innerHeight:400});
	$("a#pop").colorbox({iframe:true, innerWidth:"60%", innerHeight:"90%"});
	$("a#tos").colorbox({iframe:true, innerWidth:"60%", innerHeight:"90%"});
	$("a#mail").colorbox({iframe:true, innerWidth:600, innerHeight:400});
	$("a#conv").colorbox({iframe:true, innerWidth:"60%", innerHeight:"90%"});
	$("a#chat").colorbox({iframe:true, innerWidth:600, innerHeight:600});
	$("a#user_map").colorbox({iframe:true, innerWidth:800, innerHeight:650});
	$("a#bus_misc").colorbox({iframe:true, innerWidth:"40%", innerHeight:"95%"});
	$("a#bus_map").colorbox({iframe:true, innerWidth:800, innerHeight:700});
	$("a#app").colorbox({iframe:true, innerWidth:400, innerHeight:200});
	$("a#app_store").colorbox({iframe:true, innerWidth:"80%", innerHeight:"80%"});
	$("a#imagelg").colorbox({iframe:true, innerWidth:325, innerHeight:325});
	$("a#coupon").colorbox({iframe:true, innerWidth:600, innerHeight:600});
	$("a#superdeal").colorbox({iframe:true, innerWidth:700, innerHeight:400});
	$("a#feedback").colorbox({iframe:true, innerWidth:"60%", innerHeight:600});
	$("a#how_works").colorbox({iframe:true, innerWidth:800, innerHeight:650});
	$("a#keepme").tooltip({
		position: [0, 0],
		offset: [-25, -225],
		opacity: 0.9
	});
	
	setTimeout(function(){
	$("#error_message").slideUp();
	$("#KT_tngsuccess").slideUp();
	$("#KT_tngwarning").slideUp();
	$("#KT_tngerror").slideUp();
	}, 10000);

	$(function() {
		$('#nav ul').css({display: 'none'});
		$('#nav li').hover(function(){
				$(this).find('ul:first:hidden').css({visibility: 'visible',display: 'none'}).slideDown('slow');
			},function(){
				$(this).find('ul:first').slideUp('slow');	
		});
	});
	
	var cache = [];
	$.fn.preLoadImages = function() {
	var args_len = arguments.length;
		for (var i = args_len; i--;) {
		  var cacheImage = document.createElement('img');
		  cacheImage.src = arguments[i];
		  cache.push(cacheImage);
		}
	};
	
	$.fn.preLoadImages('images/menu_button5.png', 'images/menu_button_hover5.png', 'images/menu_left5.jpg', 'images/menu_background.png', 'images/header_logo.png', 'images/header_image.jpg', 'images/member_admin_panel_background.jpg', 'images/search_blank5.jpg', 'images/search_button.png', 'images/input_shadow.png');
	
	/*
	$(function(){
		$('.slide-out-div').tabSlideOut({
			tabHandle: '.handle',                     //class of the element that will become your tab
			pathToTabImage: 'images/feedback.jpg',	  //path to the image for the tab //Optionally can be set using css
			imageHeight: '75px',                     //height of tab image           //Optionally can be set using css
			imageWidth: '30px',                       //width of tab image            //Optionally can be set using css
			tabLocation: 'left',                      //side of screen where tab lives, top, right, bottom, or left
			speed: 300,                               //speed of animation
			action: 'click',                          //options: 'click' or 'hover', action to trigger animation
			topPos: '155px',                          //position from the top/ use if tabLocation is left or right
			leftPos: '20px',                          //position from left/ use if tabLocation is bottom or top
			fixedPosition: false                      //options: true makes it stick(fixed position) on scroll
		});
	});
	*/
	
});

