jQuery.noConflict();

jQuery(document).ready(function(){

if(jQuery('#pane1').is("div"))
{
        jQuery('#pane1').jScrollPane({scrollbarWidth:18, showArrows:true});
}


//аПаОаКаАаЗ/б�аКб�б�б�аИаЕ аБаЛаОаКаОаВ аВ аЛаВаОаЙ аКаОаЛаОаНаКаЕ
jQuery('div.userinfoLeft > h3 > img').click(
function()
{
	var hiddenBlock = jQuery(this).parent().next();
	if(hiddenBlock.css("display")!="block")
	{
	hiddenBlock.show(200);
	jQuery(this).parent().append('<img src="/images/userinfo/forward_noact.gif" alt="" style="cursor: default" />');
	jQuery(this).css("display","none");
	return true;
	}
});
jQuery('div.userinfoOpen > div > div.userinfoOpenReduce').click(
function()
{
	jQuery(this.parentNode.parentNode).hide(200);
	jQuery(this.parentNode.parentNode).prev().find("img").eq(1).remove();
	jQuery(this.parentNode.parentNode).prev().find("img").eq(0).css("display","inline");
	return true;
});
jQuery('div.clubpageText > h3 > img').click(
function()
{
	var hiddenBlock = jQuery(this).parent().next();
	if(hiddenBlock.css("display")!="block")
	{
	hiddenBlock.show(200);
	jQuery(this).parent().append('<img src="/images/userinfo/forward_noact.gif" alt="" style="cursor: default" />');
	jQuery(this).css("display","none");
	return true;
	}
});

// аПаОаКаАаЗ/б�аКб�б�б�аИаЕ б�аАаБаЛаИб�б�
jQuery('#feed').click(
function()
{
	if(jQuery('#feedback').css('display')!='block')
	{
	jQuery('#feedback').show(400);
	jQuery(this).addClass("no_activ");
	}
});

jQuery('#feedClose').click(
function()
{
	jQuery("#feed").removeClass("no_activ");
	return true;
});


// аПаОаКаАаЗ/б�аКб�б�б�аИаЕ б�аОб�аМб�
jQuery('#showContactUs').click(
function()
{
        jQuery('.userinfoContactsExt').fadeIn(300);
        jQuery(this).css('display','none');
        return true;
});

jQuery('.hideContactUs').click(
function()
{
        jQuery('.userinfoContactsExt').fadeOut(300);
        jQuery('.userinfoSendMessage').fadeOut(300);
        jQuery('#showContactUs').css('display','inline');
        return true;
});


jQuery('.userinfoBtnContact').click(
function()
{
        if(jQuery('#showContactUs').css('display')=='inline')
        {
        jQuery('.userinfoContactsExt').fadeIn(300);
        jQuery('#showContactUs').css('display','none');
        }
        else
        {
        jQuery('.userinfoContactsExt').fadeOut(300);
        jQuery('#showContactUs').css('display','inline');
        }
        return true;
});


// б�аАаБаОб�аА б� б�аОб�аО
//functions list photo
jQuery(".nav > .next").livequery('click',function()
{
	var num=parseInt(jQuery('#current').text());
	if(num<parseInt(jQuery('#total').text()))
	{
	var id="photo"+num;
	var next_id="photo"+(num+1);

	/*jQuery('#'+id).fadeOut(300);*/
	jQuery('#'+id).removeClass();
	jQuery('#current').empty();
	jQuery('#current').append(num+1);
	}
	/*jQuery('#'+next_id).fadeIn(300);*/
	jQuery('#'+next_id).addClass("visible");
	//jQuery('.product_photo').css("height",jQuery('#'+next_id).height()+"px");
});

jQuery(".nav > .prev").livequery('click',
function()
{
	var num=parseInt(jQuery('#current').text());
	if(num>1)
	{
	var id="photo"+num;
	var next_id="photo"+(num-1);
	/*jQuery('#'+id).fadeOut(300);*/
	jQuery('#'+id).removeClass();
	jQuery('#current').empty();
	jQuery('#current').append(num-1);
	}
	/*jQuery('#'+next_id).fadeIn(300);*/
	jQuery('#'+next_id).addClass("visible");
	//jQuery('.product_photo').css("height",jQuery('#'+next_id).height()+"px");
});

tb_init('a.thickbox');

//show plus
function tb_init(domChunk){
jQuery('.product_photo').livequery('mouseover',function(){
if(this.getElementsByTagName('div').item(0).style.display!="block")
{
	this.getElementsByTagName('div').item(0).style.display="block";
	this.getElementsByTagName('div').item(0).style.top=(this.offsetHeight-126)/2+"px";
}
});
//hide plus
jQuery('.product_photo').livequery('mouseout',function(){
this.getElementsByTagName('div').item(0).style.display="none";
});

//increase photo
jQuery('.product_photo').livequery('click',function(){
var a = jQuery(this).find('.visible').eq(0).parent().attr("href");
tb_show(a);
this.blur();
return false;
});
}
function tb_show(url) 
{	
	jQuery("body").append("<div id='TB_overlay'></div>"); //zatemnenie 
	jQuery("body").append("<div class='big_photo'><img src='' /><div id='close'></div></div>")
	jQuery('.big_photo').fadeIn(400);
	jQuery('.big_photo > img').attr("src",url);
	var left=document.body.clientWidth/2-jQuery('.big_photo > img').width()/2;
	if(jQuery.browser.msie || jQuery.browser.opera) var top=document.body.clientHeight/2-jQuery('.big_photo > img').height()/2+document.body.scrollTop/2;
	else var top=document.body.clientHeight/2-jQuery('.big_photo > img').height()/2+window.scrollY;
	jQuery(".big_photo").css("top",top);
	jQuery(".big_photo").css("left",left+"px");
	close();
	document.onkeydown = function(e) 	
		{
			if(jQuery.browser.msie) { // ie
			keycode = event.keyCode;
			} else { // mozilla
			keycode = e.which;
			}
			if(keycode == 27){
			if(jQuery(".big_photo").css("display")=="block")
			{
			jQuery(".big_photo").fadeOut(400);
			jQuery('.big_photo > img').attr("src","");
			jQuery("#TB_overlay").remove();
			jQuery(".big_photo").remove();
			}
			}
		}
}

//show finish form project
jQuery("span.finish").click(
function()
{
	jQuery(this).parent().parent().next().find("form.clubpageHideForm").eq(0).slideDown(200);
	return false;
});

//show finish form
jQuery("span.clubpageBtnCanc").click(
function()
{
	jQuery(this).parent().parent().slideUp(200);
	return false;
});

//disable/enable button finish form
jQuery("textarea.clubpageFinalFeedback").keyup(
function()
{
	if(this.value!='')
	{
		jQuery(this).parents("form").find("input[type=submit]").eq(0).removeClass("disable").removeAttr("disabled");
	}
	/*
	 * 2009-08-18, Alena: to make Close Project button disabled when Final Feedback textarea is not filled
	 */
	else
	{
	        jQuery(this).parents("form").find("input[type=submit]").eq(0).addClass("disable").attr("disabled", "disabled");
	}
	// --- //
	return true;
});

								});

function close()
{
jQuery('#close').click(function()
{
		jQuery(".big_photo").fadeOut(400);
		jQuery('.big_photo > img').attr("src","");
		jQuery("#TB_overlay").remove();
		jQuery(".big_photo").remove();
});

}
