function clearUsername() {
	var thefield = $('#username').val();
	if(thefield == 'Username') {
		$('#username').val("");
	}
}

function clearPassword() {
	var thefield = $('#password').val();
	if(thefield == 'Password') {
		$('#password').val("");
	}
}

function highlight(field) {
	 $("#joinContent").each(function(){  
	 	$("#joinContent input[type=text]").removeClass("join_form_field_focus").addClass("join_form_field"); 
	 	$("#joinContent input[type=password]").removeClass("join_form_field_focus").addClass("join_form_field");  
     });  
     
     field.removeClass("join_form_field").addClass("join_form_field_focus");
}

function swapShoe() {

	show_shoe = show_shoe + 1;
	if(show_shoe > 5) {
		show_shoe = 1;
	}
	
	$('#mood_shoe').attr("src","images/signup_shoe_" + show_shoe + ".png");
	
}

function changeColor(color) {
	$('#profile_user_profile').css('background-color',color);
	$.post("/actions/ajax_update_mood_color.php", { mood_color: color } );
}

function allocateSidebarHeight3() {
	
	var winHeight = $(document).height();
	$('#profile_user_profile').height(winHeight);
	
}

function allocateSidebarHeight2() {
	
	var contentDom = document.getElementById("quiz_box");
	var sidebarDom = document.getElementById("profile_user_profile");
	
	if(contentDom) {
		if((contentDom.offsetHeight) > sidebarDom.offsetHeight) {
			sidebarDom.style.height = (contentDom.offsetHeight)+"px"; 
		}
	} 
		
}

function allocateSidebarHeight() {
	
	var contentDom = document.getElementById("right_content");
	var sidebarDom = document.getElementById("profile_user_profile");
	
	if((contentDom.offsetHeight) > sidebarDom.offsetHeight) {
		sidebarDom.style.height = (contentDom.offsetHeight)+"px"; }
		
}

function saveStyle(styleid) {
	$.post("/actions/ajax_save_style.php", { styleid: styleid }, function(data){
	
		});
	window.location.href = '/room/index.html';
	
//    var selected = $("#user_style option:selected"); 
	//$("#current_style").html(selected.text());
	//$('#style_dropdown').hide(); 
	//$('#change_style').fadeIn();
	
}

function alert_whistle(){
	alert("Message sent - Thanks for your help!");
	
}

function alert_contact(){
	alert("Thank you - Message sent successfully!");
	
}

	$(document).ready(function() {
		
		
		$('.lrTip').qtip({
	   style: { width: 200,padding: 5,background: '#91e3ef',color: 'black',textAlign: 'center',
	   border: {width: 2,radius: 5,color: '#91e3ef'},
      	tip: 'topLeft',
      	name: 'dark' // Inherit the rest of the attributes from the preset dark style
   		},			
   content: {text:false},
   position: {
      corner: {target: 'bottomRight',tooltip: 'topLeft'}
   },
   show: 'mouseover',
   hide: 'mouseout'
	})
		
		$('.urTip').qtip({
	   style: { width: 200,padding: 5,background: '#91e3ef',color: 'black',textAlign: 'center',
	   border: {width: 2,radius: 5,color: '#91e3ef'},
      	tip: 'bottomLeft',
      	name: 'dark' // Inherit the rest of the attributes from the preset dark style
   		},			
   content: {text:false},
   position: {
      corner: {target: 'topRight',tooltip: 'bottomLeft'}
   },
   show: 'mouseover',
   hide: 'mouseout'
	})
		
});

	function hideProfilePic(){
		document.getElementById('profile_swf').style.display = 'none';
	}
	
	function showProfilePic(){
		document.getElementById('profile_swf').style.display = 'block';
	}
	
	function showCloset(){
		$('#room_div').hide();
			$('#bodypad').hide();
			// $('#closet_div').slideDown('slow', showProfilePic);	
			$('#closet_div').show();	
			active_closet = 1;
			
	}
		
	function loadCloset() {
		$('#right_content').load('/room/closet.html?roomid=1');
	}
	
