if(document.images){
	spinner = new Image(32,32);
	spinner.src = "r/c/loading.gif";
}
$(document).ready(function() {

$("img").lazyload({ placeholder : "r/i/grey.gif" });

$('.on_off :checkbox').iphoneStyle();
$('.yes_no :checkbox').iphoneStyle({ checkedLabel: 'Yes', uncheckedLabel: 'No' });
$('.disabled :checkbox').iphoneStyle();
$('.css_sized_container :checkbox').iphoneStyle({ resizeContainer: false, resizeHandle: false });
$('.long_tiny :checkbox').iphoneStyle({ checkedLabel: 'Very Long Text', uncheckedLabel: 'Tiny' });
   
      var onchange_checkbox = $('.onchange :checkbox').iphoneStyle();
      setInterval(function toggleCheckbox() {
        onchange_checkbox.attr('checked', !onchange_checkbox.is(':checked')).change();
        $('span#status').html(onchange_checkbox.is(':checked').toString());
      }, 2500);


$("#tdetails").hide();
$("#pdetails").hide();
$("#other").hide();


if(location.href.indexOf('grid=y') != -1) {
	$('<div/>').css({
		width: '100%',
		height: '2000px',
		position: 'absolute',
		top: 0,
		left: 0,
		'z-index': 100,
		background: 'url(r/i/site/960_grid_16_col.png) center 0 repeat-y'
	}).appendTo('body');
}

function mgmt(){
	aid = $("#aid").val();
	g = $("#f_gender").val();
	e = $("#f_ethnicity").val();
	a = $("#f_age").val();
	//alert("/mgmt.php?m="+aid+"&g="+g+"&e="+e+"&a="+a);
	window.location = "/mgmt.php?m="+aid+"&g="+g+"&e="+e+"&a="+a;
}

$("#f_gender").change(function(){
	mgmt();
});
$("#f_ethnicity").change(function(){
	mgmt();
});
$("#f_age").change(function(){
	mgmt();
});

rep_sels = $("select[rel='rep_sels']");
prev_rep_val = $("#rep_dropdown").val();
$("#rep_options").change(function(){
	v = $(this).val();
	if(v == "ro1"){
		$("#rep_dropdown").show();
		rep_sels.show();
		$("#rep_dropdown").val(prev_rep_val);
	}
	if(v == "ro2")
	{
		$("#rep_dropdown").hide();
		rep_sels.hide();
		prev_rep_val = $("#rep_dropdown").val();
		rep_sels.val("");
		$("#rep_dropdown").val("631");
	}
});

$("a[href='#locationinfo']").toggle(function(){
	$("#locationinfo").show();
},function(){
	$("#locationinfo").hide();
});
$("a[href='#bdayinfo']").toggle(function(){
	$("#bdayinfo").show();
},function(){
	$("#bdayinfo").hide();
});


$("li.talent_type input").click(function(){
	ul = $(this).next().next();
	if($(this).attr("checked"))
		ul.show();
	else
		ul.hide();
});


$("div.editplinks a").click(function(){
	current = $("div.editplinks a.active").attr("href").slice(1);
	$("#"+current).hide();
	$("div.editplinks a").removeClass("active");
	$(this).addClass("active");
	pg = $(this).attr("href").slice(1);
	//alert(pg);
	$("#"+pg).show();
	return false;
});


$("a.create-new-group").toggle(function(){
	$(this).html("Save");
	li = $(this).closest("li").next().show();
	li.children("input").focus();
	return false;
},
function(){
	val = li.children("input").val();
	//alert(val);
	str = "t=creategrp&id="+val+"&pid="+$(this).attr("rel");
	if(val.replace(/ /gi, "") != ""){
		$.ajax({
			type: "POST",
			url: "fav.php",
			data: str,
			dataType: "json",
			success: function(data){
				if(data.msg == "OK"){
					t = "&cid=";
					if(window.location.search == "")
						t = "?cid=";
					loc = window.location.href.replace("#","");
					loc += t + data.id;
					window.location = loc;
					//location.reload(true);
					//alert(data.id);
					//$("ul.quicklist_menu","ul.options").append("<li><a href='#' class='groupit' id='"+data.id+"' rel='"+data.gid+"'>"+val+"</a></li>");
				}
				else
				{
					alert(data.msg);
				}
			}
		});
	}
	
	$(this).html("Create New Group");
	li.hide();
	return false;
});


$("#saveResults").click(function(){
	//alert(window.location.search);
	var str = "f=save&url="+escape(window.location.search);
	$.ajax({
		type: "POST",
		url: "saveSearch.php",
		data: str,
		success: function(msg){
			if(msg != "OK"){
				alert("Unable to save this search at this time. Please try again later.  " + msg);
				return false;
			}
			
		}
	});
	$(this).replaceWith("SAVED");
	return false;
});

$("a.rename-search").toggle(function(){
	id = $(this).attr("id");
	$(this).html("Save");
	//alert(id);
	title = $("a."+id).hide();
	input = $("input."+id).show().val(title.html()).focus();
	return false;
},
function(){
	var str = "f=rename&id=" + $(this).attr("id") + "&n=" + input.val();
	$.ajax({
		type: "POST",
		url: "saveSearch.php",
		data: str,
		success: function(msg){
			if(msg != "OK"){
				alert(msg);
				return false;
			}
		}
	});
	title.show().html(input.val());
	input.hide();
	$(this).html("Rename");
});
$("a.del-search").click(function(){
	var str = "f=del&id=" + $(this).attr("id");
	$.ajax({
		type: "POST",
		url: "saveSearch.php",
		data: str,
		success: function(msg){
			if(msg != "OK"){
				alert(msg);
				return false;
			}
		}
	});
	$(this).closest("tr").remove();
	if($("table tr").length ==1)
	{
		$("table").hide();
		$("#no-ssearches").show();
	}
});


$("a.rename-group").toggle(function(){
	id = $(this).attr("id");
	$(this).html("Save");
	//alert(id);
	title = $("a."+id).hide();
	input = $("input."+id).show().val(title.html()).focus();
	return false;
},
function(){
	var str = "t=renamegrp&id=" + $(this).attr("id") + "&n=" + input.val();
	$.ajax({
		type: "POST",
		url: "fav.php",
		data: str,
		success: function(msg){
			if(msg != "OK"){
				alert(msg);
				return false;
			}
		}
	});
	title.show().html(input.val());
	input.hide();
	$(this).html("Rename");
});

$("a.del-group").click(function(){
	var str = "t=delgrp&id=" + $(this).attr("id");
	$.ajax({
		type: "POST",
		url: "fav.php",
		data: str,
		success: function(msg){
			if(msg != "OK"){
				alert("Unable to delete this group at this time. Please try again later.");
				return false;
			}
		}
	});
	$(this).closest("tr").remove();
	if ($("#grp-table tr").length == 1)
	{
		$("#grp-table").hide();
		$("#no-grps").show();
	}
});


$("a.del-sgroup").click(function(){
	var str = "t=delsgrp&id=" + $(this).attr("id");
	$.ajax({
		type: "POST",
		url: "fav.php",
		data: str,
		success: function(msg){
			if(msg != "OK"){
				alert(msg);
				return false;
			}
		}
	});
	$(this).closest("tr").remove();
	if ($("#sgrp-table tr").length == 1)
	{
		$("#sgrp-table").hide();
		$("#no-sgrps").show();
	}
});


$("#email_pg").toggle(function(){
	$(this).addClass("active");
	$("#email_to").show();
},
function(){
	$(this).removeClass("active");
	$("#email_to").hide();
});

$("#email_me").toggle(function(){
	$("#email_me").html('Hide Email Form');
	$("#email_me_to").show();
	return false;
},
function(){
	$("#email_me").html('Email My Profile');
	$("#email_me_to").hide();
	return false;
});

var sentEmail = $("li.sentEmail").hide().html("SENT");
$("#email_form").submit(function(){
	var str = $(this).serialize();
	//alert(str);
	$.ajax({
		type: "POST",
		url: "sendmail.php",
		data: str,
		success: function(msg){
			if(msg == "OK"){
				sentEmail.fadeIn();
				$("#saved").show();
				$("#email_to").hide();
				$("#email_pg").show();
				$("#email_pg").removeClass("active");
				
			}
			else
				alert(msg);
		}
	});
	setTimeout(function(){ sentEmail.fadeOut(); }, 2000);
	return false;
});

var sentProfile = $("p.sentProfile").hide().html("SENT");
$("#email_prof_form").submit(function(){
	var str = $(this).serialize();
	$.ajax({
		type: "POST",
		url: "sendmail.php",
		data: str,
		success: function(msg){
			if(msg == "OK"){
				sentProfile.fadeIn();
				$("#saved").show();
				$("#email_me").html('Email My Profile');
				$("#email_me_to").hide();
			}
			else
				alert(msg);
		}
	});
	setTimeout(function(){ sentProfile.fadeOut(); }, 2000);
	return false;
});

$("#email_cancel").click(function(){
	$("#email_to").hide();
	$("#email_pg").removeClass("active");
	return false;
});

$("#email_me_cancel").click(function(){
	$("#email_me_to").hide();
	$("#email_me").html('Email My Profile');
	return false;
});


var inp = $("input")
	.focus(function(){
		if($(this).attr("id") != "keywords")
			$(this).css('border','1px solid black');})
	.blur(function(){ 
		if($(this).attr("id") != "keywords")
			$(this).css('border','1px solid #EEE');});
			

$("#showPW").change(function(){
		//alert("test");
});


$("#pwResetForm").submit(function() {
	var p = $("p.response").html("");
	var b = $("#pwResetButton").attr("disabled","disabled");
	var str = $(this).serialize();
	alert(str);
	$.ajax({
		type: "POST",
		url: "reset.php",
		data: str,
		success: function(msg){
			if(msg == "OK"){
				$("#pwResetForm").hide();
				p.html("Your password has been reset, you may now log in with your new password.");
			}
			else{	
				p.html(msg);
				b.attr("disabled","");
			}
		}
	});
	return false;
});

var sButton = $("#submit_order");
var spinner = $("#spinner");

$("#billingForm").submit(function() {
	var orderButton = $("#order_button").hide();
	spinner.show();
	var str = $(this).serialize() + "&t=auth";
	//alert(str);
	$.ajax({
		type: "POST",
		url: "update.php",
		data: str,
		success: function(msg){
			spinner.hide();
			if(msg == "OK"){
				var buttonText = "Submit Payment";
				if($("#plan").val() == "")
					buttonText = "Save";
				sButton.html(buttonText).show();
			}
			else{
				orderButton.show();
				alert(msg);
			}
		}
	});
	return false;

});

sButton.click(function() {
	sButton.hide();
	spinner.show();
	var type = "submit";
	if(sButton.html() == "Save")
		type = "save";
	var str = "&pg=billing&plan=" + $("#plan").val() + "&t=" + type;
	//alert(str);
	$.ajax({
		type: "POST",
		url: "update.php",
		data: str,
		success: function(msg){
			spinner.hide();
			if(msg == "OK"){
				var url = "account.php";
				//if($("#signup").val()=="true")
				//	url = "signup.php?pg=profile";
				window.location = url;
			}
			else{
				sButton.show();
				alert(msg);
			}
		}
	});
	return false;
});

//SAVE PROFILE INFORMATION IF LOGGED IN, edit.php
//var saveResponse = $("li.saved").hide().html("SAVED");
var save = $("button.save")
	.click(function() { $("#editProfile").submit();});
$("#editProfile").submit(function() {
	//saveResponse.hide()
	//save.attr("disabled","disabled");
	save.addClass("active");
	save.html("SAVING...");
	var str = $(this).serialize();
	//var h2 = $("h2.fn").html();
	//alert(str);
	//setTimeout(function() {
	$.ajax({
		type: "POST",
		url: "update.php",
		data: str,
		dataType: "json",
		success: function(data){
			save.removeClass("active");			
			if(data.msg == "OK"){
				//saveResponse.fadeIn();
				//$("div.title,div.content_footer").addClass("saved");
				//alert($("#dispName").val());
				//alert($("#dispName").attr("value"));
				//$(".dispName").html($("#dispName").val());
				$("#main_city").html(data.city);
				$("#main_state").html('<abbr class="region" title="'+data.state+'">'+data.state+'</abbr>');
				if($("div.editplinks a.active").hasClass("basic"))
	   				 window.location = $("a.media").attr("href");
				else
	    			$("div.editplinks a.active").parent().next().children().click();
	    			
				//save.addClass("inactive");
				//$("h2.fn").html("Saved");

			}
			else{
				alert(data.msg);
				save.removeAttr("disabled");	
			}
			save.html("Save and Continue");
			
		}
	});
	//}, 250);
	//setTimeout(function(){ 
		//saveResponse.fadeOut();
	 	//$("div.title,div.content_footer").removeClass("saved"); 
	 	//$("h2.fn").html(h2);
	 	$(".dispName").html($("#dispName").val());
	//}, 3000);
	return false;

});

/*
$("button.savecontinue").click(function(){
	//save.click();
	//alert($("div.editplinks a.active").parent().next());
	if($("div.editplinks a.active").hasClass("other")){
	    window.location = $("a.media").attr("href");
	}
	else
	    $("div.editplinks a.active").parent().next().children().click();


});*/

//$("input").change(function(){ save.removeAttr("disabled"); save.removeClass("inactive"); });
//$("textarea").change(function(){ save.removeAttr("disabled"); save.removeClass("inactive"); });
//$("select").change(function(){ save.removeAttr("disabled"); save.removeClass("inactive"); });
//END PROFILE SAVE


/*SAVE PROFILE INFORMATION FOR REGISTRATION, signup.php?pg=profile
$("button.save_prof").click(function() { $("#regSubmitProfile").submit();});
$("#regSubmitProfile").submit(function() {
	var str = $(this).serialize();
	//alert(str);
	setTimeout(function() {
	$.ajax({
		type: "POST",
		url: "update.php",
		data: str,
		dataType: "json",
		success: function(data){
			if(data.msg == "OK"){
				window.location = "signup.php?pg=portfolio";
			}
			else{			
				alert(data.msg);
			}
		}
	});
	}, 250);
	return false;
});
//END registration profile save */

$('#masthead .button').toggle(
	function() {
		$('#masthead #login').css('display', 'block');
		$(this).addClass("active");
		$('#l-email').focus();
	},
	function() {
		$('#masthead #login').css('display', 'none');
		$(this).removeClass("active");
	}
);

$('a.login_action').click(function(){
	$('#masthead .button').click();
});

$("#acct-edit").toggle(
	function(){
		$("#contactinfo .contents .acct-info").css('display', 'none');		
		$("#contactinfo .contents .acct-form").css('display', 'block');
		$(this).addClass("active");
		$(this).html("Cancel");
		
	},
	function() {
		$("#contactinfo .contents .acct-form").css('display', 'none');
		$("#contactinfo .contents .acct-info").css('display', 'block');
		$(this).removeClass("active");
		$(this).html("Edit");
	}
);

// UPDATED by Paultwo July 26, 2010 
$("a.quicklist, a.add-to-group, a[href='#newgrp']").click(function(){
	if($(this).hasClass("current")){
		$(this).removeClass("current").next("ul.quicklist_menu").hide();
    }
    else{   
        $(this).addClass("current").next("ul.quicklist_menu").show();
        $("#newGroupNameInput").focus(); 
    }
        
});


$("#createGrp").submit(function(){
	var str = $("#newGroupNameInput").val();
	if(str.replace(/ /gi, "") == "")
	{	
		$("#newGroupNameInput").focus();
		return false;
	}
	str = $(this).serialize();
	str = str.replace("groupname","id");
	//alert(str);
	$.ajax({
		type: "POST",
		url: "fav.php",
		data: str,
		dataType: "json",
		success: function(data){
			if(data.msg == "OK"){
				//window.location = 'groups.php';
				setTimeout(function() {location.reload(true);}, 200);
			}
			else{			
				alert(msg);
			}
		}
	});
	return false;
});


$("#edit-account").submit(function(){
	var str = $(this).serialize() + "&pg=acct";
	//alert(str);
	$.ajax({
		type: "POST",
		url: "update.php",
		data: str,
		success: function(msg){
			if(msg == "OK"){
				window.location = 'account.php';
			}
			else{
				$("#acct-response").html(msg);
			}
		}
	});
	return false;

});

$("a[href=#delgrp]").click(function(){
	var str = "id=" + $(this).attr("id") + "&t=delgrp";
	//alert(str);
	if(confirm("Are you sure you want to delete this group?"))
	{
		//setTimeout(function() {		
			$.ajax({
			type: "POST",
			url: "fav.php",
			data: str,
			success: function(msg){
				//alert(msg);
				if(msg == "err"){
					alert("There was an error removing this group, please try again later.");
					return false;
				}
			}
			});
			setTimeout(function(){location.reload(true);}, 1250);
			//window.location = "groups.php"; 
		//}, 2000);
	}

});

$("#downgradeFree").click(function(){
	if(confirm("Are you sure you want to switch to a Free account? Any images or videos you have uploaded greater than the Free account limit will no longer be visible but will remain on the server in case you decide to switch back to a premium account at a later time. Once you click on OK your account will automatically be downgraded and you will be returned to the account page."))
	{
		window.location = "https://locationtalent.com/billing.php?plan=free";
	}
	return false;

});

$("a[href=#del-fav]").click(function(){
	var id = "id=" + $(this).attr("id") + "&t=del-fav";
	//alert(id);
	$.ajax({
		type: "POST",
		url: "fav.php",
		data: id,
		success: function(msg){
			if(msg == "err"){
				alert("Sorry! We are unable to remove from favorites at this time.");
				return false;
			}

		}
	});
	var t = "#" + $(this).attr("id");
	$(t).fadeOut();
	return false;
});

$("a[href=#grp-remove]").click(function(){
	var id = "id=" + $(this).attr("id") + "&t=del-from-grp&gid=" + $(this).attr("rel");
	//alert(id);
	modifyGroup(id);
	var t = "#" + $(this).attr("id");
	$(t).fadeOut();
	return false;

});

$("a[href=#toggle-group]").click(function(){
	if($(this).hasClass("active")){
		var id = "id=" + $(this).attr("id") + "&t=del-from-grp&gid=" + $(this).attr("rel");
		modifyGroup(id);
		$(this).removeClass("active");	
	}
	else{
		var id = "id=" + $(this).attr("id") + "&t=addgrp&gid=" + $(this).attr("rel");
		modifyGroup(id);
		$(this).addClass("active");
	}
	return false;
});

function modifyGroup(id)
{
	$.ajax({
		type: "POST",
		url: "fav.php",
		data: id,
		dataType: "json",
		success: function(data){
			if(data.msg == "err"){
				alert(data.err);
				return false;
			}
		}
	});
}

$("a.add-favorite").click(function(){
	var id = "id=" + $(this).attr("id") + "&t=add";
	$.ajax({
		type: "POST",
		url: "fav.php",
		data: id,
		success: function(msg){
			if(msg == "err"){
				alert("Sorry! We are unable to add to favorites at this time.");
				return false;
			}
			
		}
	});
	$(this).addClass("active")
	return false;			 
});

$("a[href=#arfav]").click(function(){
	var t = $(this);
	if(t.hasClass("active")){
		var id = "id=" + $(this).attr("id") + "&t=del-fav";
		//alert(id);
		$.ajax({
			type: "POST",
			url: "fav.php",
			data: id,
			success: function(msg){
				if(msg == "err"){
					alert("Sorry! We are unable to remove from favorites at this time.");
					return false;
				}
				t.removeClass("active");
				t.html("Add Favorite");
			}
		});
	}
	else{
		var id = "id=" + $(this).attr("id") + "&t=add";
		//alert(id);
		$.ajax({
			type: "POST",
			url: "fav.php",
			data: id,
			success: function(msg){
				if(msg == "err"){
					alert("Sorry! We are unable to add to favorites at this time.");
					return false;
				}
				t.addClass("active");
				t.html("Remove Favorite");
			}
		});
		
	}
});


//BEGIN SEARCH SECTION
$('a[href=#search]').click(function(){
	$('#keywords').click();
});

$('#keywords').toggle(
	function() {
		$('#advanced-search').slideDown(500);
		$('<div />').addClass('search-overlay').css({
			width: '100%',
			height: '100%',
			position: 'absolute',
			'z-index': 98,
			opacity: 0,
			background: '#000'
		}).prependTo('body');
	},
	function() {
		$('#advanced-search').slideUp(500);
		$('.search-overlay').remove();
});

$('#close_adv_search').click(function() {
		$('#advanced-search').slideUp(500);
		$('.search-overlay').remove();
});

var s_changed = false;
$("#f-adv-search").change(function() { s_changed = true;});

$("#searchbutton").click(function(){
	doSearch();
	return false;
});

$("#submit_adv_search").click(function(){
	doSearch();
	return false;
});

function doSearch()
{
	var str = $("#quick-search").serialize();
	var str1 = $("#f-adv-search").serialize();	
	//alert(str); alert(str1);
	if($("#keywords").val() == "")
	{
		if(s_changed)
			window.location = "results.php?" + str + "&" + str1;
		$("#keywords").focus();	
	}
	else
		window.location = "results.php?" + str + "&" + str1;
	return false; 
}
//END SEARCH SECTION


//LOGIN FORM
$("#login").submit(function(){  
	$('#logbutton').hide();
	$('#login_response').html("<img src='r/i/login-loader.gif'>");
	var str = $(this).serialize();
	setTimeout(function() {
	$.ajax({  
    		type: "POST",
    		url: "login.php",
			dataType: "json",
    		data: str,  
    		success: function(data){  
				if(data.msg == "OK"){
					setTimeout(function() {window.location = data.pg;},200);
				} 
				else{
					$('#logbutton').show();
					$('#login_response').html(data.msg);
				}
   
		}	  
   
  	}); 
  	}, 250); 
	return false;
});
//END LOGIN


//REGISTRATION FORM
$("#r-form").submit(function(){
	var fname = $('#r-first-name');
	var lname = $('#r-last-name');
	var email = $('#r-email');
	var region = $('#r-region');
	var pw1 = $('#r-password-a');
	var pw2 = $('#r-password-b');
	var terms = $('#r-terms');
	var response = $('#r-response');
	response.html("");
	var err = false;
	if(fname.val() == ""){
		response.html("<div id='r-response-box'>Firstname is required.</div>"); err=true;}
	if(lname.val() == ""){
		response.html("<div id='r-response-box'>Lastname is required.</div>"); err=true;}
if ($('#r-terms:checked').val() == null) {
		response.html("<div id='r-response-box'>You must agree to the terms and policies.</div>"); err=true;}
	if(region.val() != "")
	{
		if(region.val().length != 5){
			response.html("<div id='r-response-box'>Region must be a valid 5 digit zip code.</div>"); err=true;}
	}
	else{ response.html("<div id='r-response-box'>All fields are required.</div>"); err=true; }
	if(pw1.val() != pw2.val()){
		response.html("<div id='r-response-box'>Passwords do not match.</div>"); err=true;}	
			
	if(err) return false;

		$('#r-ul').hide();
		$('#r-pol').hide();
		$('#r-button').hide();
		$('#terms_check').hide();
		response.html("<div id='r-response-thanks'><img src='r/c/loading.gif'></div>")
		var str = $(this).serialize();
		//alert(str);
		setTimeout(function() {
			$.ajax({  
    			type: "POST",
    			url: "register.php",
				dataType: "html",
    			data: str,  
    			success: function(msg){
						if(msg == "OK"){
							setTimeout(function() {window.location = "edit.php?ref=reg";},200);
							} 
						else{
							$('#r-ul').show();
							$('#r-pol').show();
							$('#r-button').show();
							$('#terms_check').show();
							response.html(msg);
						}
				}	  
   
  			});
  		},300);
		return false;
});
//END REGISTRATION


//BEGIN COLORBOXES
$("a[rel='tour']").colorbox({
	//inline: true,
	opacity: 0.2
});

$('a[href=#screencast]').colorbox({
	inline: true,
	href: '#screencast',
	opacity: 0.2
});

$('a.lbox').colorbox({
	opacity: .2,
	iframe: true,
	innerWidth: 300,
	innerHeight:160
});

$("a[href='login-to-view.php']").colorbox({
	opacity: .2,
	innerWidth: 200,
	innerHeight:100
});

$("a[rel='profile-pics']").colorbox({opacity: .2, current: ""});
$("a[rel='audio']").colorbox({opacity: .2, iframe: true, width: 470, height: 280, current: ""});
//$("a[rel='video']").colorbox({opacity: .2, iframe: true, width: 690, height: 550, current: ""});

$('a.legal').colorbox({
	opacity: .2,
	iframe: true,
	innerWidth: 700,
	innerHeight: 600
});
//END COLORBOXES

//BEGIN MISC
$('.close').click(function() {
	$(this).parents('div:eq(0)').fadeOut(500);
	return false;
});

$('.closeme').click(function() {
	$(this).parents('ul:eq(0)').fadeOut(500);
	$('a.add-to-group.current').removeClass("current");	
	return false;
});


if ($('body').attr('class').indexOf('has-map') != -1) {
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("onlocation-map"));
		var loc = new GLatLng(37.71859,-92.525391);
		map.setCenter(loc, 3);
		if ($('body').attr('class').indexOf('home') != -1) {
			map.addControl(new GSmallZoomControl3D());
		} else {
			map.addControl(new GLargeMapControl3D());
		}	
	}
}
//END MISC

});

