	function uncache( url ){
		var d = new Date();
		var time = d.getTime();
		return url + "&uncache=" + time;
	} 
	
	function create_http_request(){
		var http = false;
		//Use IE's ActiveX items to load the file.
		if(typeof ActiveXObject != 'undefined') {
			try {http = new ActiveXObject("Msxml2.XMLHTTP");}
			catch (e) {
				try {http = new ActiveXObject("Microsoft.XMLHTTP");}
				catch (E) {http = false;}
			}
		//If ActiveX is not available, use the XMLHttpRequest of Firefox/Mozilla etc. to load the document.
		} else if (XMLHttpRequest) {
			try {http = new XMLHttpRequest();}
			catch (e) {http = false;}
		}
		return http;
	}
	
	//selecting favorites
	var girl_id_http_request = create_http_request();
	var global_girl_id;
	
	function set_favorite( girl_id ){
		var ajax_url_base = "/ajax_set_favorite.php";
		var ajax_url_value = "girl_id=" + girl_id;
		var url = ajax_url_base + "?" + ajax_url_value;
		global_girl_id = girl_id;
		
		ajax_set_favorite_GET( uncache( url ) );
	}
	
	function ajax_set_favorite_GET( url ){
		girl_id_http_request.open( 'GET', url, true );
		girl_id_http_request.onreadystatechange = ajax_set_favorite_GET_onreadystatechange;
		girl_id_http_request.send( null );
	}
	
	function ajax_set_favorite_GET_onreadystatechange(){
		if( girl_id_http_request.readyState == 4 ){
			document.getElementById( "favorite_" + global_girl_id ).innerHTML = girl_id_http_request.responseText;
		}
	}
	
	//forum topic votes
	var forum_vote_http_request = create_http_request();
	var global_topic_id;
	
	function forum_vote( action, topic_id ) {
		var ajax_url_base = "/ajax_forum_vote.php";
		var ajax_url_value = "topic_id=" + topic_id + "&action=" + action;
		var url = ajax_url_base + "?" + ajax_url_value;
		global_topic_id = topic_id;
		
		ajax_forum_vote_GET( uncache( url ) );
	}
	
	function ajax_forum_vote_GET( url ){
		forum_vote_http_request.open( 'GET', url, true );
		forum_vote_http_request.onreadystatechange = ajax_forum_vote_GET_onreadystatechange;
		forum_vote_http_request.send( null );
	}
	
	function ajax_forum_vote_GET_onreadystatechange(){
		if( forum_vote_http_request.readyState == 4 ){
			document.getElementById( "forum_vote_box_" + global_topic_id ).innerHTML = forum_vote_http_request.responseText;
		}
	}