// $Id$
 
$(document).ready(function()
{
	var thelink = "<a class='yourshoplink' href='/improve/'>Is this your shop? Improve your listing &gt;&gt;</a>";
	$('.upgradeEntice h6.noLink').after(thelink);

    // submit toy review comments to correct URL
    if($('#toy-review-comment-submit').length > 0)
    {
        $('#toy-review-comment-submit').click(function(event)
        {
            $('#toy-review-comment').attr('action', '/x_submit_review_comment.php');
            $('#toy-review-comment').submit();
        });
    }

    // submit shop reviews to correct URL
    if($('#shop-review-comment-submit').length > 0)
    {
        $('#shop-review-comment-submit').click(function(event)
        {
            $('#shop-review-comment').attr('action', '/x_submit_shop_review.php');
            $('#shop-review-comment').submit();
        });
    }

    // submit content comments to correct URL
    if($('#content-comment-submit').length > 0)
    {
        $('#content-comment-submit').click(function(event)
        {
            $('#content-comment').attr('action', '/x_submit_comment.php');
            $('#content-comment').submit();
        });
    }

    // submit competition
    if($('#compformsubmit').length > 0)
    {
        $('#compformsubmit').click(function(event)
        {
            $('#compform').attr('action', '/competition-entry.php');
            $('#compform').submit();
        });
    }
});


function get_shops_social_networks(id)
{
    $.ajax({
        url: "/ajax.shop_networks.php?id=" + id,
        success: function(data)
        {
            if(data)
            {
                $('#shop-social-networks').html(data).show();
            }
        }
    });
}

function default_value (default_value, id)
{
	var existing_value = document.getElementById(id).value;
	
	if(existing_value == default_value)
	{
		document.getElementById(id).value = '';
		$('#'+id).removeClass('lightGreyText');
	}
	else if(existing_value == '')
	{
		document.getElementById(id).value = default_value;
		$('#'+id).addClass('lightGreyText');
	}
}

