$(document).ready(function(){
	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
	
    $('#qsearch ul li a').click(function() {
		$('#qsearch ul li a').removeClass('hov');
		$(this).addClass('hov');
		var show = $(this).attr('href').split('#')[1];
		
		$('#ajax_inputs div').hide();
		$('div.cr' + show ).show();
		
		return false;
	});
	
	$('#ajax_inputs a').click( function() {
		
		var inpName = $(this).attr('href').split('=')[0];
		var inpVal	= $(this).attr('href').split('=')[1];
		var inpType	= inpName.replace("[]", "");
	
		if ( $(this).attr('class') == 'white' ) {
			$(this).removeClass('white');
			$('.inp_' + inpType + inpVal ).remove();
			//alert('.inp_' + inpType + inpVal);
		} else {
			$(this).addClass('white');
			var elem = '<input type="text" name="' + inpName +'" value="' + inpVal + '" class="inp_' + inpType + inpVal + '"/>';
			$('#hidden_inputs').append(elem);
		}
		
		return false;
	});

	
});



var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = window.open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}


