function dl(form, id, size)
{
    // first check to make sure that user validated captcha
    if (!form.user_code.value)
    {
        alert('You must validate the security code if you want to download this image');
        return false;
    }

    // update the size value in the form
	var input4 = document.getElementById("size");
	input4.value = size;

	var input5 = document.getElementById("okret");
	input5.value = '1';

	if(confirm('Do you really want to download this image?'))
	{
	    form.submit();
	    return true;
	}
	return false;
}
/**
 *
 * @access public
 * @return void
 **/

function dl_video(form, id, size){
//    if (!form.user_code.value)
//   {
//        alert('You must validate the security code if you want to download this clip');
//        return false;
//    }

	var input4 = document.getElementById("size");
	input4.value = size;

	var input5 = document.getElementById("okret");
	input5.value = '1';

	if (confirm ('Do you really want to download this clip?'))
	{
	    form.submit();
	    return true;
	}
	return false;
}

/**
 *
 * @access public
 * @return void
 **/
function change_codec (val) {
	var input1 = document.getElementById("codec");
	input1.value = val;

	return;
}

function opendetails()
{
	var d1_0 = document.getElementById('d1_0');
	if (d1_0) { d1_0.className='off'; }
	var d4_0 = document.getElementById('d4_0');
	if (d4_0) { d4_0.className='off'; }
	var d5_0 = document.getElementById('d5_0');
	if (d5_0) { d5_0.className='off'; }
	var d1_1 = document.getElementById('d1_1');
	if (d1_1) { d1_1.className='on'; }
	var d2_1 = document.getElementById('d2_1');
	if (d2_1) { d2_1.className='on'; }
	var d3_1 = document.getElementById('d3_1');
	if (d3_1) { d3_1.className='on'; }
	var d4_1 = document.getElementById('d4_1');
	if (d4_1) { d4_1.className='on'; }
	var d5_1 = document.getElementById('d5_1');
	if (d5_1) { d5_1.className='on'; }
}

function opencomments()
{
	var d1_0 = document.getElementById('d1_0');
	if (d1_0) { d1_0.className='on'; }
	var d4_0 = document.getElementById('d4_0');
	if (d4_0) { d4_0.className='on'; }
	var d5_0 = document.getElementById('d5_0');
	if (d5_0) { d5_0.className='on'; }
	var d1_1 = document.getElementById('d1_1');
	if (d1_1) { d1_1.className='off'; }
	var d2_1 = document.getElementById('d2_1');
	if (d2_1) { d2_1.className='off'; }
	var d3_1 = document.getElementById('d3_1');
	if (d3_1) { d3_1.className='off'; }
	var d4_1 = document.getElementById('d4_1');
	if (d4_1) { d4_1.className='off'; }
	var d5_1 = document.getElementById('d5_1');
	if (d5_1) { d5_1.className='off'; }
}


function opensizes()
{
	document.getElementById('ldiv').className='off';
	document.getElementById('sdiv').className='on';
}


function openlicenses()
{
	document.getElementById('sdiv').className='off';
	document.getElementById('ldiv').className='on';
}

function lic(id,type)
{
	if(confirm('Do you really want to buy this license for this image?')) location.href=base_url + 'browse_image/download_license/' + id + '/' + type;
}

function confirm_disable_rebilling()
{
    return confirm("Are you sure you want to disable automatic renewal of your subscription?");
}

function confirm_enable_rebilling()
{
    return confirm("Are you sure you want to enable automatic renewal of your subscription?");
}
