/*
// hover effect
$(document).ready(function() {
  $('div.demo-show h3').add('div.demo-show2 h3').hover(function() {
    $(this).addClass('hover');
  }, function() {
    $(this).removeClass('hover');
  });
});

// independently show and hide
$(document).ready(function() {
  $('div.demo-show:eq(0) > div').hide();  
  $('div.demo-show:eq(0) > h3').click(function() {
    $(this).next().slideToggle('fast');
  });
});

// one showing at a time

$(document).ready(function() {
  $('div.demo-show:eq(1) > div:gt(0)').hide();  
  $('div.demo-show:eq(1) > h3').click(function() {
    $(this).next('div:hidden').slideDown('fast')
    .siblings('div:visible').slideUp('fast');
  });
});


//simultaneous showing and hiding

$(document).ready(function() {
  $('div.demo-show2:eq(0) > div').hide();
  $('div.demo-show2:eq(0) > h3').click(function() {
    $(this).next('div').slideToggle('fast')
    .siblings('div:visible').slideUp('fast');
  });
});

//queued showing and hiding
$(document).ready(function() {
  $('div.demo-show2:eq(1) > div').hide();  
  $('div.demo-show2:eq(1) > h3').click(function() {
    var $nextDiv = $(this).next();
    var $visibleSiblings = $nextDiv.siblings('div:visible');

    if ($visibleSiblings.length ) {
      $visibleSiblings.slideUp('fast', function() {
        $nextDiv.slideToggle('fast');
      });
    } else {
       $nextDiv.slideToggle('fast');
    }
  });
});
*/


$(document).ready(function() {

  $('div.demo-show2> h3').click(function() {
    $('div.demo-show3> div').hide();  
    $('div.demo-show1> div').hide();  
    $('div.demo-show4> div').hide();  
    $('div.demo-show5> div').hide();    
    var $nextDiv = $(this).next();
    var $visibleSiblings = $nextDiv.siblings('div:visible');

    if ($visibleSiblings.length ) {
      $visibleSiblings.slideUp('fast', function() {
        $nextDiv.slideToggle('fast');
      });
    } else {
       $nextDiv.slideToggle('fast');
    }
  });
  $('div.demo-show1> h3').click(function() {
    $('div.demo-show2> div').hide();  
    $('div.demo-show3> div').hide();  
    $('div.demo-show4> div').hide();  
    $('div.demo-show5> div').hide();    
    var $nextDiv = $(this).next();
    var $visibleSiblings = $nextDiv.siblings('div:visible');

    if ($visibleSiblings.length ) {
      $visibleSiblings.slideUp('fast', function() {
        $nextDiv.slideToggle('fast');
      });
    } else {
       $nextDiv.slideToggle('fast');
    }
  });

  $('div.demo-show3> h3').click(function() {
    $('div.demo-show2> div').hide();  
    $('div.demo-show1> div').hide();  
    $('div.demo-show4> div').hide();  
    $('div.demo-show5> div').hide();    
    var $nextDiv = $(this).next();
    var $visibleSiblings = $nextDiv.siblings('div:visible');

    if ($visibleSiblings.length ) {
      $visibleSiblings.slideUp('fast', function() {
        $nextDiv.slideToggle('fast');
      });
    } else {
       $nextDiv.slideToggle('fast');
    }
  });
  $('div.demo-show4> h3').click(function() {
    $('div.demo-show2> div').hide();  
    $('div.demo-show1> div').hide();  
    $('div.demo-show3> div').hide();  
    $('div.demo-show5> div').hide();    
    var $nextDiv = $(this).next();
    var $visibleSiblings = $nextDiv.siblings('div:visible');

    if ($visibleSiblings.length ) {
      $visibleSiblings.slideUp('fast', function() {
        $nextDiv.slideToggle('fast');
      });
    } else {
       $nextDiv.slideToggle('fast');
    }
  });
  $('div.demo-show5> h3').click(function() {
    $('div.demo-show2> div').hide();  
    $('div.demo-show1> div').hide();  
    $('div.demo-show3> div').hide();
    $('div.demo-show4> div').hide();    
    var $nextDiv = $(this).next();
    var $visibleSiblings = $nextDiv.siblings('div:visible');

    if ($visibleSiblings.length ) {
      $visibleSiblings.slideUp('fast', function() {
        $nextDiv.slideToggle('fast');
      });
    } else {
       $nextDiv.slideToggle('fast');
    }
  });
});


function changeFormat(value)
{

	if(value=='70x100')
	{
		alert("Atentie! Formatul ales de dumneavoastra este brut! Formatul finit al lucrarii poate fi 34x47 cm/ 47x68 cm/ 64x96 cm");
		document.getElementById('format1').value='700';
		document.getElementById('format2').value='1000';
	}

	if(value=='50x70')
	{
		alert("Atentie! Formatul ales de dumneavoastra este brut! Formatul finit al lucrarii poate fi 34x47 cm/ 47x68 cm/ 64x96 cm");
		document.getElementById('format1').value='500';
		document.getElementById('format2').value='700';
	}

	if(value=='35x50')
	{
		alert("Atentie! Formatul ales de dumneavoastra este brut! Formatul finit al lucrarii poate fi 34x47 cm/ 47x68 cm/ 64x96 cm");
		document.getElementById('format1').value='350';
		document.getElementById('format2').value='500';
	}

	if(value=='841x594')
	{
		document.getElementById('format1').value='841';
		document.getElementById('format2').value='594';
	}

	if(value=='594x420')
	{
		document.getElementById('format1').value='595';
		document.getElementById('format2').value='420';
	}

	if(value=='420x297')
	{
		document.getElementById('format1').value='420';
		document.getElementById('format2').value='297';
	}

	if(value=='')
	{
		document.getElementById('format1').value='';
		document.getElementById('format2').value='';
	}
}


function changeFormat2(value)
{
	if(value=='')
	{
		document.getElementById('format1').value='';
		document.getElementById('format2').value='';
	}
	if(value=='420x297')
	{
		document.getElementById('format1').value='420';
		document.getElementById('format2').value='297';
	}
	if(value=='297x210')
	{
		document.getElementById('format1').value='297';
		document.getElementById('format2').value='210';
	}
	if(value=='210x148.5')
	{
		document.getElementById('format1').value='210';
		document.getElementById('format2').value='148.5';
	}
	if(value=='148.5x105')
	{
		document.getElementById('format1').value='148.5';
		document.getElementById('format2').value='105';
	}
	if(value=='210x99')
	{
		document.getElementById('format1').value='210';
		document.getElementById('format2').value='99';
	}
	if(value=='630x297')
	{
		document.getElementById('format1').value='630';
		document.getElementById('format2').value='297';
	}
	if(value=='210x210')
	{
		document.getElementById('format1').value='210';
		document.getElementById('format2').value='210';
	}
}


