function landing2()
{
	this.url = "/includes/landing/ajax/landing2.php";
	this.logging = true;
	this.cur_ele_id = "";
	
	this.log = function( msg )
	{
		if ( !this.logging )
			return;
		
		if ( typeof console == "undefined" )
			return;
		
		console.log( msg );
	}
	
	this.get_profiles = function( ajax_id, page_number, cat_id )
	{
		this.log( "get_profiles called: ajax_id = " + ajax_id + ", page_number = " + page_number + ", cat_id = " + cat_id );
		
		ele_name = "#" + ajax_id;
		
		document.getElementById( ajax_id ).innerHTML = "<div align='center' class='wait'><img src='/images/wait_throb.gif' border='0'></div>";
		
		params = {};
		params.ajax_id = ajax_id;
		params.page_number = page_number;
		params.cat_id = cat_id;
		
		$( ele_name ).load( this.url, params );
	}
	
	this.click_profile = function( profile_id, ele_id )
	{
		ele = document.getElementById( ele_id );
		if ( ele == null )
			return;
		
		old_ele = document.getElementById( this.cur_ele_id );
		if ( old_ele != null )
			old_ele.className = "profiles";
		
		this.cur_ele_id = ele_id;		
		ele.className = "profiles_hilite";
		
		iphone_ele = window.document.iphonecontainer;
		if ( iphone_ele == undefined )
			iphone_ele = window.iphonecontainer;
		
		if ( iphone_ele == undefined )
		{
			alert( "Can't find iphone! Ah!!!" );
			return;
		}
		
		iphone_ele.init_profile_id( profile_id );
	};
}

landing2 = new landing2;
