//$Revision: 1.8 $
function update_own_want(type, entityid, platform) {
	AjaxRequest.post(
		{
			'url':url+'Games/ownwant_ajax.php'
			,'parameters':{'type':type, 'entityid':entityid, 'platform':platform}
			,'onSuccess':function(req){ change_opposite_status(type);}
			}
	);
}

function change_opposite_status(type) {
	var type_div = document.getElementById(type);
	if (type == 'own') {
		var type_opposite = 'want';
	} else {
		var type_opposite = 'own';
	}
	var type_opposite_img = document.getElementById(type_opposite + '_img');
	var type_img = document.getElementById(type + '_img');

	if (type_img.src == 'http://i.neoseeker.com/f/neo/subscribed_star.gif') {
		type_img.src = 'http://i.neoseeker.com/f/neo/unsubscribed_star.gif';
	} else if (type_img.src == 'http://i.neoseeker.com/f/neo/unsubscribed_star.gif') {
		type_img.src = 'http://i.neoseeker.com/f/neo/subscribed_star.gif'
		type_opposite_img.src = 'http://i.neoseeker.com/f/neo/unsubscribed_star.gif';
	} else {
		type_img.src = type_opposite_img.src;
		type_opposite_img.src = 'http://i.neoseeker.com/f/neo/unsubscribed_star.gif';
	}
}

function set_favourite_entity(entityid) {
	var heart_is_blank = new RegExp("heart_add");
	var heart_image = document.getElementById('favourite_heart_'+entityid);

	AjaxRequest.post(
		{
			'url':url+'members/ownwant_ajaxhandler.php'
			,'parameters':{'entityid':entityid,'act':'favourite'}
			,'onSuccess':function(req){
				if (heart_is_blank.test(heart_image.src)) {
					heart_image.src = heart_on.src;
				} else {
					heart_image.src = heart_off.src;
				}
			} //end onSuccess
		}
	);
}

function set_is_playing_entity(entityid) {
	var playing_is_blank = new RegExp("controller_add");
	var playing_image = document.getElementById('playing_icon_'+entityid);

	AjaxRequest.post(
		{
			'url':url+'members/ownwant_ajaxhandler.php'
			,'parameters':{'entityid':entityid,'act':'playing'}
			,'onSuccess':function(req){
				if (playing_is_blank.test(playing_image.src)) {
					playing_image.src = playing_on.src;
				} else {
					playing_image.src = playing_off.src;
				}
			} //end onSuccess
		}
	);
}

function remove_completely(entityid) {
	AjaxRequest.post(
		{
			'url':url+'members/ownwant_ajaxhandler.php'
			,'parameters':{'entityid':entityid,'act':'remove'}
		}
	);
}

function flip_ownwant_status(entityid) {
	AjaxRequest.post(
		{
			'url':url+'members/ownwant_ajaxhandler.php'
			,'parameters':{'entityid':entityid,'act':'flipstatus'}
		}
	);
}
function update_own_want(type,entityid,platform){AjaxRequest.post({'url':url+'Games/ownwant_ajax.php','parameters':{'type':type,'entityid':entityid,'platform':platform},'onSuccess':function(req){change_opposite_status(type);}});}
function change_opposite_status(type){var type_div=document.getElementById(type);if(type=='own'){var type_opposite='want';}else{var type_opposite='own';}
var type_opposite_img=document.getElementById(type_opposite+'_img');var type_img=document.getElementById(type+'_img');if(type_img.src=='http://i.neoseeker.com/f/neo/subscribed_star.gif'){type_img.src='http://i.neoseeker.com/f/neo/unsubscribed_star.gif';}else if(type_img.src=='http://i.neoseeker.com/f/neo/unsubscribed_star.gif'){type_img.src='http://i.neoseeker.com/f/neo/subscribed_star.gif'
type_opposite_img.src='http://i.neoseeker.com/f/neo/unsubscribed_star.gif';}else{type_img.src=type_opposite_img.src;type_opposite_img.src='http://i.neoseeker.com/f/neo/unsubscribed_star.gif';}}
function set_favourite_entity(entityid){var heart_is_blank=new RegExp("heart_add");var heart_image=document.getElementById('favourite_heart_'+entityid);AjaxRequest.post({'url':url+'members/ownwant_ajaxhandler.php','parameters':{'entityid':entityid,'act':'favourite'},'onSuccess':function(req){if(heart_is_blank.test(heart_image.src)){heart_image.src=heart_on.src;}else{heart_image.src=heart_off.src;}}});}
function set_is_playing_entity(entityid){var playing_is_blank=new RegExp("controller_add");var playing_image=document.getElementById('playing_icon_'+entityid);AjaxRequest.post({'url':url+'members/ownwant_ajaxhandler.php','parameters':{'entityid':entityid,'act':'playing'},'onSuccess':function(req){if(playing_is_blank.test(playing_image.src)){playing_image.src=playing_on.src;}else{playing_image.src=playing_off.src;}}});}
function remove_completely(entityid){AjaxRequest.post({'url':url+'members/ownwant_ajaxhandler.php','parameters':{'entityid':entityid,'act':'remove'}});}
function flip_ownwant_status(entityid){AjaxRequest.post({'url':url+'members/ownwant_ajaxhandler.php','parameters':{'entityid':entityid,'act':'flipstatus'}});}