/*
 * Another In Place Editor - a jQuery edit in place plugin
 *
 * Copyright (c) 2009 Dave Hauenstein
 *
 * License:
 * This source file is subject to the BSD license bundled with this package.
 * Available online: {@link http://www.opensource.org/licenses/bsd-license.php}
 * If you did not receive a copy of the license, and are unable to obtain it,
 * email davehauenstein@gmail.com,
 * and I will send you a copy.
 *
 * Project home:
 * http://code.google.com/p/jquery-in-place-editor/
 *
 */
$(document).ready(function(){
						   
	var id = document.getElementById('usr_id').innerHTML;
	var id1 = document.getElementById('usr_id1').innerHTML;
	var country = document.getElementById('edit_country').innerHTML;
	if(country=='UK')
		{
			var country_line = 'click here to set your post code';	
		}
		else
		{
			var country_line = 'click here to set your zip code';	
		}
    // This example only specifies a URL to handle the POST request to
    // the server, and tells the script to show the save / cancel buttons

	$(".edit_friend").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Fan (no wall/private pics access),Angel, Baby, Spanker, Riding Master, Pony, Chauffeur, Cum dump, Close Friend, Fuck Buddy, Partner, Lover, Mate, Drinking Buddy, Whore, Pet, Mistress, Nanny, Daddy, Master, Slave, Sissy, Slut, Baby, Pleasure Toy, Pimp, Daddy, Mommy, Casual Friend, Seen on the Scene",
		params:"page=add_friend&id="+id+"&id1="+id1
    });
	 
     $(".edit_screenname").editInPlace({
        url: "./server.php",
        show_buttons: true,
		default_text1:"(click here to add screen name)",
		params: "page=screenname&id="+id
    });
	
	    $(".edit_title").editInPlace({
        url: "./server.php",
        show_buttons: true,
		default_text1:"(click here to add your slogan!)",
		params:"page=title&id="+id
    });

    // This example shows how to call the function and display a textarea
    // instead of a regular text box. A few other options are set as well,
    // including an image saving icon, rows and columns for the textarea,
    // and a different rollover color.
    $(".edit_looking_fors").editInPlace({
        url: "./server.php",
        bg_over: "#FFFF99",
        field_type: "textarea",
        textarea_rows: "15",
        textarea_cols: "35",
		default_text1:"(click here to add looking for content)",
        saving_image: "./images/ajax-loader.gif",
		params:"page=looking&id="+id
    });
	
	    $(".edit_interests").editInPlace({
        url: "./server.php",
        bg_over: "#FFFF99",
        field_type: "textarea",
        textarea_rows: "5",
        textarea_cols: "35",
		default_text1:"(click here to add your interests)",
        saving_image: "./images/ajax-loader.gif",
		params:"page=interests&id="+id
    });
		
		$(".edit_bio").editInPlace({
        url: "./server.php",
        bg_over: "#FFFF99",
        field_type: "textarea",
        textarea_rows: "5",
        textarea_cols: "35",
		default_text1:"(click here to add your information)",
        saving_image: "./images/ajax-loader.gif",
		params:"page=note&id="+id
    });

	
	$(".edit_likings").editInPlace({
        url: "./server.php",
        bg_over: "#FFFF99",
        field_type: "textarea",
        textarea_rows: "5",
        textarea_cols: "35",
		default_text1:"(click here to add your likes)",
        saving_image: "./images/ajax-loader.gif",
		params:"page=likes&id="+id
    });

$(".edit_dislikes").editInPlace({
        url: "./server.php",
        bg_over: "#FFFF99",
        field_type: "textarea",
        textarea_rows: "5",
        textarea_cols: "35",
		default_text1:"(click here to add your dislikes)",
        saving_image: "./images/ajax-loader.gif",
		params:"page=dislikes&id="+id
    });

$(".edit_newss").editInPlace({
        url: "./server.php",
        bg_over: "#FFFF99",
        field_type: "textarea",
        textarea_rows: "5",
        textarea_cols: "35",
		default_text1:"(click here to add your latest news)",
        saving_image: "./images/ajax-loader.gif",
		params:"page=news&id="+id
    });
    // A select input field so we can limit our options
    $(".edit_gender").editInPlace({
        url: "./server.php",
        field_type: "select",
		default_text1:"(click here to choose gender)",
        select_options: "Male, Female, Pre-Op TS, Post-Op TS",
		params:"page=gender&id="+id
    });
	
	    $(".edit_temper").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Easy Going, Cool, Balanced, Fiery, Crazy",
		params:"page=temper&id="+id
    });

	    $(".edit_orient").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Private, Many, Straight, Straight-ish, Bi, Gay, Lesbian, Sissy, Sub, Dom",
		params:"page=orient&id="+id
    });
		
		
		$(".edit_hair").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Private, None, Some, Hairy",
		params:"page=hair&id="+id
    });
		
		$(".edit_hair_color").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Private, Black, Blonde, Brown, Plat. blonde, Other, Grey, Redhead",
		params:"page=hair_color&id="+id
    });
	
	$(".edit_style").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Private, Tarty, Gothic, Slutty, Rubber, Messy, Crazy, Formal, Trampy, Sissy, Shy, Forceful",
		params:"page=style&id="+id
    });
	
	$(".edit_personality").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Introverted, Extroverted, Shy, Party doll, Flirt",
		params:"page=personality&id="+id
    });
	
	$(".edit_height").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Private, Short, Average, Tall",
		params:"page=height&id="+id
    });

	$(".edit_role").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Private, Sub, Dom, Switch, Sissy, Maid, Any",
		params:"page=role&id="+id
    });
	
	$(".edit_drinker").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Private, No, Yes",
		params:"page=drinker&id="+id
    });
	
	$(".edit_smoker").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "No, Yes",
		params:"page=smoker&id="+id
    });
	
	$(".edit_humour").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Dry, Zany, Sarcastic, Black, Slapstick, Ironic",
		params:"page=humour&id="+id
    });
	
	$(".edit_weight").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Private, Slim, Athletic, Average, Curved, Ample, Plus Size, Petite",
		params:"page=weight&id="+id
    });
	
	$(".edit_pubic_hair").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Private, Shaved, Trimmed, Natural",
		params:"page=pubic_hair&id="+id
    });
	
	$(".edit_eyes").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Grey, Violet, Black, Blue, Brown, Dark, Green, Hazel",
		params:"page=eyes&id="+id
    });
	
	$(".edit_genders").editInPlace({
        url: "./server.php",
        field_type: "select",
		default_text1:"(click here to choose gender)",
        select_options: "TV, TS, CD, Man, Woman, Mistress, Master, Maid, Sissy, Slave, Gay Man, Couple, Nanny, Daddy",
		params:"page=genders&id="+id
    });
	
	$(".edit_theme").editInPlace({
        url: "./server.php",
        field_type: "select",
        select_options: "Default, Bimbo Blonde, Hot and Spicy, Strict Bitch, Fit Stud, Eco Warrior, Desert Queen, Gimp Boy, Shock Dolly, Sexy Chap, Dusky Diva, Merry Christmas, Go Green, Go High, Dark Side, Cloudy, Sky, Solitude",
		default_text1:"(click here to set theme)",
		params:"page=theme&id="+id
    });
		
	 $(".edit_city").editInPlace({
        url: "./server.php",
        show_buttons: true,
		default_text1:"(click here to add your city)",
		params:"page=city&id="+id
    });
	 
	 	$(".edit_zip").editInPlace({
        url: "./server.php",
        show_buttons: true,
		default_text1: country_line,
		params:"page=zip&id="+id
    });
	 
	 $(".edit_age").editInPlace({
        url: "./server.php",
        show_buttons: true,
		field_type: "datepicker",
		params:"page=age&id="+id
		
    });
	 
	 $(".edit_country").editInPlace({
        url: "./server.php",
        field_type: "select",
		default_text1:"(click here to add your country)",
        select_options: "Albania, Andorra, Antigua, Argentina, Australia, Austria, Bahamas, Bahrain, Barbados, Belgium, Belize, Bosnia, Brazil, Bulgaria, Canada, Chile, China, Colombia, Costa Rica, Croatia, Cuba, Cyprus, Czech Republic, Denmark, Dominica, Dominican Republic, Ecuador, Egypt, Estonia, Fiji, Finland, France, Germany, Greece, Hong Kong, Hungary, Iceland, India, Indonesia, Ireland, Iran, Israel, Italy, Jamaica, Japan, Jordan, Korea, Lithuania, Luxembourg, Macedonia, Malaysia, Maldives, Malta,  Mexico, Micronesia, Moldova, Monaco, Montenegro, Morocco, Netherlands, New Zealand, Norway, Panama, Paraguay, Peru, Philippines, Poland, Portugal, Qatar, Romania, Russia, Saint Kitts, Saint Lucia, Saint Vincent, San Marino, Serbia, Seychelles, Singapore, Slovakia, Slovenia, South Africa, Spain, Sri Lanka, Sweden, Switzerland, Taiwan, Thailand, Trinidad and Tobago, Tunisia, Turkey, Ukraine, United Arab Emirates, United States of America, United Kingdom",
		params:"page=country&id="+id
    });

// Using a callback function to update 2 divs
    $(".editme4").editInPlace({
        url: "./server.php",
        callback: function(original_element, html, original){
            $("#updateDiv1").html("The original html was: " + original);
            $("#updateDiv2").html("The updated text is: " + html);
            return(html);
        }
    });
	
});