// JavaScript Document
//łśćłżź
var DebugQueryMode=true; //Show Alerts
var jDebugMode=true; //Show Alerts
//var IE=false;

var GlobIE6=false;
var GlobIE7=false;
var GlobIE8=false;

if(jQuery.browser.msie && jQuery.browser.version == 6){ GlobIE6=true; }
if(jQuery.browser.msie && jQuery.browser.version == 7){ GlobIE7=true; }
if(jQuery.browser.msie && jQuery.browser.version == 8){ GlobIE8=true; }


/* ================================================================================== */
/* =============================== jquery.ready [START] ============================= */
/* ================================================================================== */
/* =============================== .nForm [START] =================================== */
function jnFormRadioClick(This){
	try{ 
		ID=$JQ(This).attr('id');
		var unique_name='';
		for(i=0;i<glob_nFormRadio.length;i++){
			if(glob_nFormRadio[i].idgraph==ID){
				//$JQ('#'+glob_nFormRadio[i].idgraph).attr('class','nform_check2');
				//$JQ('#'+glob_nFormRadio[i].idradio).attr('checked','checked');
				unique_name=glob_nFormRadio[i].name;
				break;				
			}
		}
		if(unique_name==''){ return false; }
		for(i=0;i<glob_nFormRadio.length;i++){
			if(glob_nFormRadio[i].name==unique_name){ // Update 1 [START]
				var c_type=$JQ('#'+glob_nFormRadio[i].idradio).attr('type');
				
				if(c_type=='radio'){
					$JQ('#'+glob_nFormRadio[i].idgraph).attr('class','nform_check1');
					if(glob_nFormRadio[i].idgraph==ID){
						$JQ('#'+glob_nFormRadio[i].idgraph).attr('class','nform_check2');
						$JQ('#'+glob_nFormRadio[i].idradio).attr('checked','checked');
						$JQ('#'+glob_nFormRadio[i].idradio).change(); /*Added*/
					}
				}//if-radio
				if(c_type=='checkbox'){
					c_checked=$JQ('#'+glob_nFormRadio[i].idradio).attr('checked');
					
					if(c_checked==false){
						if(glob_nFormRadio[i].idgraph==ID){
							$JQ('#'+glob_nFormRadio[i].idgraph).attr('class','nform_check2');
							$JQ('#'+glob_nFormRadio[i].idradio).attr('checked','checked');
							$JQ('#'+glob_nFormRadio[i].idradio).change(); /*Added*/
						}
					}else{
						if(glob_nFormRadio[i].idgraph==ID){
							$JQ('#'+glob_nFormRadio[i].idgraph).attr('class','nform_check1');
							$JQ('#'+glob_nFormRadio[i].idradio).attr('checked','');
							$JQ('#'+glob_nFormRadio[i].idradio).change(); //alert(unique_name+' '+c_checked);
						}
					}//else
				}//if-checkbox
			}// Update 1 [END]
		}//for
	}catch(err){ if(DebugQueryMode==true){ alert('jnFormRadioClick: '+err); }}
}

var glob_nFormRadio=new Array();

function jnFormRadioSet(IDarray,Mode){
	try{//[Last Update: 8.maja.2011]
		if(!IDarray || IDarray.length==0){ return false; }
		if(!Mode || Mode==''){ Mode=''; }
		
		switch(Mode){
			case 'reset': break;
			case '': break;
			default: Mode='';
		}
		
		
		var unique_name='';
		var c_id='';
		for(var i=0;i<IDarray.length;i++){
			c_id=IDarray[i];
			if((c_id.slice(0,12)=='nform_radio_') || (c_id.slice(0,12)=='nform_check_')){ //Update 1
				$JQ('#'+c_id).attr({'class':'nform_check1'}); //Update 2 (NOTE: Reset Form)
				
				c_idradio=c_id.slice(12,c_id.length);
				
				if((unique_name=='') && (Mode!='reset')){ 
					unique_name=c_id;
					if(glob_nFormRadio.length){
						for(k=0;k<glob_nFormRadio.length;k++){
							if(glob_nFormRadio[k].name==unique_name){ return false; }
						}
					}
				}
				var air={}
				air.name=unique_name;
				air.idgraph=c_id;
				air.idradio=c_idradio;
				c_count=glob_nFormRadio.length;
				
				if(Mode==''){
					$JQ('#'+air.idradio).data('jnFormRadioSet_status',$JQ('#'+air.idradio).attr('checked'));
				}
				if(Mode=='reset'){ 
					var c_status=$JQ('#'+air.idradio).data('jnFormRadioSet_status');
					if(c_status==true){ $JQ('#'+air.idgraph).attr('class','nform_check2'); }
					else{ $JQ('#'+air.idgraph).attr('class','nform_check1'); }
					//alert('Original:'+c_status+' Actual:'+$JQ('#'+air.idradio).attr('checked'));
				}
				
				if((Mode!='reset') && ($JQ('#'+air.idradio).attr('checked')==true)){ //alert(c_idradio);
					$JQ('#'+air.idgraph).attr('class','nform_check2'); //set at start
				}
				
				if(!c_count){ c_count=0; }
				glob_nFormRadio[c_count]=air;
				
				$JQ('#'+c_id).unbind('click');
				$JQ('#'+c_id).click(function () { 
				  	jnFormRadioClick(this);
				});
				
						
			}
		}//for
	}catch(err){ if(DebugQueryMode==true){ alert('jnFormRadioSet: '+err); }}
}
/* =============================== .nForm [END] ===================================== */
/* =============================== .Plugin-jdialoga [START] ========================= */
/* ===============================   Last Update 05.10.2010 ========================= */
$JQ.jDocumentSize = function(){
	try{
		var dimensions = {width: 0, height: 0};
		
		var c_bodyheight=$JQ('body').height();
		var c_documentheight=$JQ(document).height();
		var c_windowheight=$JQ(window).height();
		var c_height=0;
		
		if(c_documentheight-c_bodyheight>0){ dimensions.height=c_documentheight; }
		else{ dimensions.height= c_documentheight }
		if(c_windowheight>dimensions.height){ dimensions.height=c_windowheight; }
		if(c_documentheight>dimensions.height){ dimensions.height=c_documentheight; }
		
		
		if(c_bodyheight<c_windowheight){ //vertival scrollbar in IE8 is visible
			if(GlobIE8==true){ dimensions.height=dimensions.height-4; }
		} 
		
		var c_bodywidth=$JQ('body').width();
		var c_documentwidth=$JQ(document).width();
		if(c_documentwidth-c_bodywidth>0){ dimensions.width=c_documentwidth; }
		else{ dimensions.width=$JQ(document).width(); }
		
		return dimensions;
	}catch(err){ if(jDebugMode==true){ alert('jDocumentSize: ' + err); }}
}


function jFlashTransparent(){
	try{
		var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
		if(is_chrome==true){ return false; }
		$JQ('embed').each(function(){
			if($JQ(this).attr('rel')!='flash_wmodeactive'){
		  		$JQ(this).attr('wmode','transparent');
				$JQ(this).attr('rel','flash_wmodeactive');
				$JQ(this).wrap('<div id="flash_wmodehtml" />');
				var c_flash=$JQ('#flash_wmodehtml').html();
				$JQ('#flash_wmodehtml').html(c_flash);
				$JQ('#flash_wmodehtml').find('embed').eq(0).unwrap();
		  	}
		});
	}catch(err){ if(jDebugMode==true){ alert('jFlashTransparent: ' + err); }}
}	

var jDebugPluginMode=true; //Show Alerts

(function($) {
	$JQ.fn.jdialoga = function(func, options) {
		var defaults={
			width:400,
			left:-9999,
			opacityID:'dialoga_opacity',
			opacityVALUE:0.7,
			btn_jclose:'dialoga_jclose',
			CScontent: 'dialoga_jcontent',
			AllowOpacity:'false',
			positionVer:'true',
			positionHor:'true'
		};
		
		var gdefaults={
			width:400,
			opacityID:'dialoga_opacity',
			opacityVALUE:0.7,
			btn_jclose:'dialoga_jclose',
			CScontent: 'dialoga_jcontent',
			AllowOpacity:'false',
			positionVer:'true',
			positionHor:'true'
		};
		<!-- ============== jset  =============== -->
		function jset(This){
			try{
				$JQ(This).css('width',defaults.width);
				$JQ(This).css('height','auto');
				$JQ(This).css('visibility','visible');
				$JQ(This).css('left',defaults.left);
				$JQ(This).data('status') ? $JQ(This).data('status',$JQ(This).data('status')) : $JQ(This).data('status','closed');  //closed,progress,opened
				$JQ(This).data('status_opacity') ? $JQ(This).data('status',$JQ(This).data('status')) : $JQ(This).data('status','closed');  //closed,progress,opened
				
				if(defaults.AllowOpacity=='true'){ $JQ(This).css('opacity',0); }
				
				$JQ('#'+defaults.opacityID).css('visibility','visible');
				$JQ('#'+defaults.opacityID).css('opacity',0);
				$JQ('#'+defaults.opacityID).css({'width':'0px','height':'0px'});
				$JQ('#'+defaults.opacityID).find('iframe').css({'height':'0px'});
				
				$JQ(This).find('.'+defaults.btn_jclose).each(function(index){
					$JQ(this).bind("click", {This:This}, jclose_click);
				});
				
				$JQ('#'+defaults.opacityID).bind("click", {This:This}, jclose_click);
				
				
				jFlashTransparent(); //NEW
				$JQ(window).resize(function(){ 
					jopacity_refresh(This);
				});
				
				$JQ(window).scroll(function(){
					
				});
				  
			}catch(err){ if(jDebugPluginMode==true){ alert('jdialoga-jset: ' + err); }}
		}
		<!-- ==============/jset  =============== -->
		<!-- ============== jopacity_refresh  === -->
		function jopacity_refresh(This){
			try{
				var c_status=$JQ(This).data('status_opacity') ? $JQ(This).data('status_opacity') : 'undefined';
				
				if(($JQ(This).data('status_opacity')=='closed') || (c_status=='undefined')){  
					$JQ('#'+defaults.opacityID).css({'width':'0px','height':'0px'});
					$JQ('#'+defaults.opacityID).find('iframe').css({'height':'0px'});
					return false;
				}
				$JQ('#'+defaults.opacityID).css({'width':'100%','height':$JQ(window).height()}); //allow dynamic height adjustment
				$JQ('#'+defaults.opacityID).css({'width':'100%','height':$JQ.jDocumentSize().height}); //refreshsize
				$JQ('#'+defaults.opacityID).find('iframe').css({'height':$JQ.jDocumentSize().height});
			}catch(err){ if(jDebugPluginMode==true){ alert('jdialoga-jopacity_refresh: ' + err); }}
		}
		<!-- ==============/jopacity_refresh  === -->
		<!-- ============== jopacity_open  ====== -->
		function jopacity_open(This){
			try{ 
				
				if($JQ(This).data('status_opacity')=='opened'){ return false; }
				
				$JQ('#'+defaults.opacityID).css({'width':'100%','height':$JQ.jDocumentSize().height}); //REPLEACED
				$JQ('#'+defaults.opacityID).find('iframe').css({'height':$JQ.jDocumentSize().height});
				
				if(GlobIE6==true || GlobIE7==true || GlobIE8==true){ $JQ('#'+defaults.opacityID).find('*').stop(true,false).animate({ opacity:defaults.opacityVALUE },{easing:"easeInOutSine",duration:400, queue:false, complete:function(){    }});} //IE7,8 Fix
				$JQ('#'+defaults.opacityID).stop(true,false).animate({ opacity:defaults.opacityVALUE },{easing:"easeInOutSine",duration:400, queue:false, complete:function(){ $JQ(This).data('status_opacity','opened');   }}); 
			}catch(err){ if(jDebugPluginMode==true){ alert('jdialoga-jopacity_open: ' + err); }}
		}
		<!-- ==============/jopacity_open  ====== -->
		<!-- ============== jopacity_close  ===== -->
		function jopacity_close(This){
			try{
				if($JQ(This).data('status_opacity')=='closed'){ return false; }
				if(GlobIE6==true || GlobIE7==true || GlobIE8==true){ $JQ('#'+defaults.opacityID).find('*').stop(true,false).animate({ opacity:0 },{easing:"easeInOutSine",duration:200, queue:false, complete:function(){    }});  } //IE7,8 Fix
				$JQ('#'+defaults.opacityID).stop(true,false).animate({ opacity:0 },{easing:"easeInOutSine",duration:200, queue:false, complete:function(){ 
					$JQ('#'+defaults.opacityID).css({'width':0,'height':0});
					$JQ('#'+defaults.opacityID).find('iframe').css({'height':'0px'});
					$JQ(This).data('status_opacity','closed'); 
				}}); 
				
			}catch(err){ if(jDebugPluginMode==true){ alert('jdialoga-jopacity_close: ' + err); }}
		}
		<!-- ==============/jopacity_close  ===== -->
		<!-- ============== jopen  ============== -->
		function jopen(This){
			try{
				if($JQ(This).data('status')=='opened'){ return false; }
				jFlashTransparent();
				$JQ(This).oneTime(1000,function(i) {
					if($JQ(This).data('status')=='opened'){ return false; }
					$JQ(This).everyTime(100,function(i){ jcenter(This); });
					//jFlashTransparent();
					jcenter(This, true);
					if(defaults.AllowOpacity=='true'){ 
						if(GlobIE6==true || GlobIE7==true || GlobIE8==true){ $JQ(This).find('*').stop(true,false).animate({ opacity:1 },{easing:"easeInOutSine",duration:200, queue:false, complete:function(){  
							$JQ(This).find('.jitemhover *').stop(true,false).trigger('mouseleave');  
						}});
						
					} //IE7,8 Fix
						$JQ(This).stop(true,false).animate({ opacity:1 },{easing:"easeInOutSine",duration:600, queue:false, complete:function(){ $JQ(This).data('status','opened');    }}); 
					}else{ $JQ(This).data('status','opened'); }
				});//oneTime
				jopacity_open(This); //ACTIVATE
				
			}catch(err){ if(jDebugPluginMode==true){ alert('jdialoga-jopen: ' + err); }}
		}
		<!-- ==============/jopen  ============== -->
		<!-- ============== jcenter  ============ -->
		function jcenter(This,Override){
			try{
				if(typeof(Override)=="undefined" || Override==null){ Override=false; }
				var c_left=0;
				var c_top=0;
				c_left=parseInt($JQ.jDocumentSize().width/2)-parseInt($JQ(This).width()/2);
				
				if($JQ(window).height() > $JQ(This).height()){
					c_top=parseInt($JQ(window).height()/2)- parseInt($JQ(This).height()/2)+$JQ(window).scrollTop();
				}else{ c_top=0; }

				if(($JQ(This).data('status')=='opened') || (Override==true)){
					if(($JQ(This).data('status')=='opened') && (defaults.positionHor=='true' || defaults.positionVer=='true')){ 
						if($JQ(This).is(':animated')){ return false; } 
						$JQ(This).stop(true,false); 
					}
					
					if(defaults.positionHor=='true'){ 
						if(Override==true){ $JQ(This).css('left',c_left); }
						else{ $JQ(This).animate({ 'left':c_left },{easing:"easeOutSine",duration:300, queue:false, complete:function(){    }}); }
					}
					if(defaults.positionVer=='true'){
						if(Override==true){ $JQ(This).css('top',c_top); }
						else{ $JQ(This).animate({ 'top':c_top },{easing:"easeOutSine",duration:300, queue:false, complete:function(){    }});  } //easeInOutSine
					} //jopacity_open ADDED
					jopacity_refresh(This);
				}
			}catch(err){ if(jDebugPluginMode==true){ alert('jdialoga-jcenter: ' + err); }}
		}
		<!-- ==============/jcenter  ============ -->
		<!-- ============== jclose_click  ======= -->
		function jclose_click(event){
			try{
				jclose(event.data.This);
				return false;
			}catch(err){ if(jDebugPluginMode==true){ alert('jdialoga-jclose_click: ' + err); }}
		}
		<!-- ==============/jclose_click  ======= -->
		<!-- ============== jclose  ============= -->
		function jclose(This){
			try{
				
				$JQ(This).stopTime();
				if(defaults.AllowOpacity=='true'){
					if(GlobIE6==true || GlobIE7==true || GlobIE8==true){ $JQ(This).find('*').stop(true,false).animate({ opacity:0 },{easing:"easeInOutSine",duration:400, queue:false, complete:function(){    }});   } //IE7,8 Fix
					$JQ(This).stop(true,false).animate({ opacity:0 },{easing:"easeInOutSine",duration:400, queue:false, complete:function(){ 
						jopacity_close(This);
						$JQ(This).css('left',defaults.left); 
						jcontent(This,'&nbsp;'); 
						$JQ(This).data('status','closed');
						
					}});//animate
				}else{ 
					$JQ(This).data('status','closed'); 
					$JQ(This).oneTime(200,function(i){ 
						if($JQ(This).data('status')=='closed'){ $JQ(This).css('left',defaults.left); jcontent(This,'&nbsp;'); }
					 });  
				 }
				
				jopacity_close(This);
				
			}catch(err){ if(jDebugPluginMode==true){ alert('jdialoga-jclose: ' + err); }}
		}
		<!-- ==============/jclose  ============= -->
		<!-- ============== jcontent  =========== -->
		function jcontent(This, Content){
			try{
				try{ Content=Content.replace(/\n/g,'<br />'); }catch(errs){}
				var c_obj=$JQ(This).find('.'+defaults.CScontent).eq(0);
				$JQ(c_obj).empty();
				$JQ(c_obj).html(Content);
				
			}catch(err){ if(jDebugPluginMode==true){ alert('jdialoga-jcontent: ' + err); }}
		}
		<!-- ==============/jcontent  =========== -->
		<!-- ============== jaddcontent  ======== -->
		function jaddcontent(This, Content){
			try{
				try{ Content=Content.replace(/\n/g,'<br />'); }catch(errs){}
				var element=$JQ(This).find('.'+defaults.CScontent).eq(0);
				Content=Content+'<br />'+$JQ(element).html();
				$JQ(element).html(Content);
			}catch(err){ if(jDebugPluginMode==true){ alert('jdialoga-jaddcontent: ' + err); }}
		}
		<!-- ==============/jaddcontent  ======== -->
		
		
		return this.each(function(){
			$JQ(this).data('defaults_width', $JQ(this).data('defaults_width') ? $JQ(this).data('defaults_width') : gdefaults.width );
			$JQ(this).data('defaults_opacityID', $JQ(this).data('defaults_opacityID') ? $JQ(this).data('defaults_opacityID') : gdefaults.opacityID );
			$JQ(this).data('defaults_opacityVALUE', $JQ(this).data('defaults_opacityVALUE') ? $JQ(this).data('defaults_opacityVALUE') : gdefaults.opacityVALUE );
			$JQ(this).data('defaults_btn_jclose', $JQ(this).data('defaults_btn_jclose') ? $JQ(this).data('defaults_btn_jclose') : gdefaults.btn_jclose );
			$JQ(this).data('defaults_CScontent', $JQ(this).data('defaults_CScontent') ? $JQ(this).data('defaults_CScontent') : gdefaults.CScontent );
			$JQ(this).data('defaults_AllowOpacity', $JQ(this).data('defaults_AllowOpacity') ? $JQ(this).data('defaults_AllowOpacity') : gdefaults.AllowOpacity );
			$JQ(this).data('defaults_positionVer', $JQ(this).data('defaults_positionVer') ? $JQ(this).data('defaults_positionVer') : gdefaults.positionVer );
			$JQ(this).data('defaults_positionHor', $JQ(this).data('defaults_positionHor') ? $JQ(this).data('defaults_positionHor') : gdefaults.positionHor );
			
			if(options){ $JQ(this).data('defaults_width', options.width>gdefaults.width ? options.width : gdefaults.width );}
		 	if(options){ $JQ(this).data('defaults_opacityID', options.opacityID!='' ? options.opacityID : gdefaults.opacityID );}
			if(options){ $JQ(this).data('defaults_opacityVALUE', options.opacityVALUE>=0 ? options.opacityVALUE : gdefaults.opacityVALUE );}
			if(options){ $JQ(this).data('defaults_btn_jclose', options.btn_jclose!='' ? options.btn_jclose : gdefaults.btn_jclose );}
			if(options){ $JQ(this).data('defaults_CScontent', options.CScontent!='' ? options.CScontent : gdefaults.CScontent );}
			if(options){ $JQ(this).data('defaults_AllowOpacity', options.AllowOpacity!='' ? options.AllowOpacity : gdefaults.AllowOpacity );}
			if(options){ $JQ(this).data('defaults_positionVer', options.positionVer!='' ? options.positionVer : gdefaults.positionVer );}
			if(options){ $JQ(this).data('defaults_positionHor', options.positionHor!='' ? options.positionHor : gdefaults.positionHor );}
			
			defaults.width= $JQ(this).data('defaults_width');
			defaults.opacityID= $JQ(this).data('defaults_opacityID');
			defaults.opacityVALUE= $JQ(this).data('defaults_opacityVALUE');
			defaults.btn_jclose= $JQ(this).data('defaults_btn_jclose');
			defaults.CScontent= $JQ(this).data('defaults_CScontent');
			defaults.AllowOpacity= $JQ(this).data('defaults_AllowOpacity');
			defaults.positionVer= $JQ(this).data('defaults_positionVer');
			defaults.positionHor= $JQ(this).data('defaults_positionHor');
			
			switch(func){
				case 'set': 	jset(this);  break;
				case 'open': 	jopen(this); break;
				case 'close': 	jclose(this); break;
				case 'content': 	jcontent(this,options); break;
				case 'addcontent': 	jaddcontent(this,options); break;
				default: break;
			}//switch
		
		});//each
	};//function
 })(jQuery);
/* =============================== .Plugin-jdialoga [END] =========================== */
/* =============================== .jMenuSet [START] ================================ */
function jMenuSet(Data){
	try{
		if(!Data || Data==''){ return false; }
		if(!Data.ID || Data.ID==''){ return false; }
		var elements = $JQ('#'+Data.ID).find('li');
		var c_widthmain=$JQ('#'+Data.ID).find('ul').attr('offsetWidth');
		var c_width=0;
		
		//BC function catSetSelectedCSSItem(menuid){} - removes onmouseout
		if($JQ(elements).length<=0){ return false; }
		var c_links=document.getElementById(Data.ID).getElementsByTagName('li');
		for(var i=0; i<c_links.length;i++){
			c_links[i].onmouseout= function(){}
		}
		//BC function catSetSelectedCSSItem(menuid){} - removes onmouseout
		
		$JQ(elements).each(function(index){
			if(($JQ(this).attr('id')!='') && ($JQ(this).parent().parent().parent().attr('id')==Data.ID)){
				var c_href=$JQ(this).find('a').eq(0).attr('href');
				//$JQ(this).find('a').eq(0).css('display','none');
				$JQ(this).find('a').eq(0).remove();
				$JQ(this).prepend('<a class="" href="'+c_href+'"><img src="/bc_graph/shared/empty.gif" alt="" /></a>');
			}
		});
		
	}catch(err){ if(jDebugMode==true){ alert('jMenuSet: ' + err); }}
}

function jMenuSetActive(Data){
	try{
		if(!Data || Data==''){ return false; }
		if(!Data.ID || Data.ID==''){ return false; }
		if(!Data.IDbread || Data.IDbread==''){ return false; }
		if(!Data.DisplaySub || Data.DisplaySub==''){ Data.DisplaySub==''; }
		
		switch(Data.DisplaySub) {
			case false: break;
			case true: break;
			default: Data.DisplaySub=true;
		}
		
		
		if($JQ('#'+Data.IDbread).find('a').length<1){ return false; }
		var c_breadhref=$JQ('#'+Data.IDbread).find('a:last').attr('href').toLowerCase();
		var elements = $JQ('#'+Data.ID).find('a');
		var c_found=false;
		
		$JQ(elements).each(function(index){
			var c_href=$JQ(this).attr('href').toLowerCase();
			if(c_href==c_breadhref){
				$JQ(this).attr({'class':'active'});
				$JQ(this).parentsUntil('#'+Data.ID).attr({'class':'active'});
				if(Data.DisplaySub==false){ $JQ(this).parent().attr({'class':''}); }
				c_found=true;
			}
		});
		
		if(c_found==true){
			$JQ('#'+Data.ID).find('ul').eq(0).removeClass('active');
			elements = $JQ('#'+Data.ID).find('ul[class="active"]');
			$JQ(elements).each(function(index){
				$JQ(this).parent().find('a').eq(0).attr({'class':'active'});
			});
		}
		
	}catch(err){ if(jDebugMode==true){ alert('jMenuSetActive: ' + err); }}
}

function jMenuSetBCReset(ID){
	try{
		if(!ID || ID==''){ return false; }
		
		var elements = $JQ('#'+ID).find('li');
		//BC function catSetSelectedCSSItem(menuid){} - removes onmouseout
		if($JQ(elements).length<=0){ return false; }
		var c_links=document.getElementById(ID).getElementsByTagName('li');
		for(var i=0; i<c_links.length;i++){
			c_links[i].onmouseout= function(){}
		}
		//BC function catSetSelectedCSSItem(menuid){} - removes onmouseout
		
	}catch(err){ if(jDebugMode==true){ alert('jMenuSetBCReset: ' + err); }}
}
/* =============================== .jMenuSet [END] ================================== */
/* =============================== .jSubMenuSet [START] ============================= */
function jSubMenuSet(Data){
	try{
		if(!Data || Data==''){ return false; }
		if(!Data.ID || Data.ID==''){ return false; }
		var elements = $JQ('#'+Data.ID).find('li');
		
		//BC function catSetSelectedCSSItem(menuid){} - removes onmouseout
		if($JQ(elements).length<=0){ return false; }
		var c_links=document.getElementById(Data.ID).getElementsByTagName('li');
		for(var i=0; i<c_links.length;i++){
			c_links[i].onmouseout= function(){}
		}
		//BC function catSetSelectedCSSItem(menuid){} - removes onmouseout
		
		$JQ(elements).each(function(index){
			if(($JQ(this).attr('id')!='') && ($JQ(this).parent().parent().parent().attr('id')==Data.ID)){
				var c_href=$JQ(this).find('a').eq(0).attr('href');
				//$JQ(this).find('a').eq(0).css('display','none');
				$JQ(this).find('a').eq(0).remove();
				$JQ(this).prepend('<a class="jitemhover" href="'+c_href+'"><img src="/bc_graph/shared/empty.gif" alt="" /></a>');
			}
		});
		
	}catch(err){ if(jDebugMode==true){ alert('jMenuSet: ' + err); }}
}

function jSubMenuSetActive(Data){
	try{
		if(!Data || Data==''){ return false; }
		if(!Data.ID || Data.ID==''){ return false; }
		if(!Data.IDbread || Data.IDbread==''){ return false; }
		
		if($JQ('#'+Data.IDbread).find('a').length<1){ return false; }
		var c_breadhref=$JQ('#'+Data.IDbread).find('a:last').attr('href').toLowerCase();
		var elements = $JQ('#'+Data.ID).find('a');
		
		$JQ(elements).each(function(index){
			var c_href=$JQ(this).attr('href').toLowerCase();
			if(c_href==c_breadhref){
				$JQ(this).parent().attr({'class':'active'});
			}
		});
		
	}catch(err){ if(jDebugMode==true){ alert('jSubMenuSetActive: ' + err); }}
}
/* =============================== .jSubMenuSet [END] =============================== */
/* =============================== .SliderMVA [START] =============================== */
function jSliderMVA_Set(event){
	try{//[Last Update: 16.stycznia.2010]
		var Data=event.data.Data;
		
		if(jQuery.data(document.body,Data.IDslide).PERM!=true){ return false; }
		else{ jQuery.data(document.body,Data.IDslide,{PERM:false}); }
		
		$JQ('#'+Data.IDlink+' li').attr('class','');
		$JQ('#'+Data.IDlink+' li').eq(event.data.LINKindex).attr('class','active');
		var c_fullwidth=parseInt($JQ('#'+Data.IDslide+' ul').css('width'));
		var c_width=parseInt($JQ('#'+Data.IDslide+' li').eq(0).attr('offsetWidth'));
		var c_left=parseInt($JQ('#'+Data.IDslide+' ul').css('left'));
		
		var c_newlt=event.data.LINKindex*c_width*(-1);
		var c_newheight=$JQ('#'+Data.IDslide+' li').eq(event.data.LINKindex).attr('offsetHeight');
		//alert(c_newheight+' - ' +$JQ('#'+Data.IDslide+' li').eq(event.data.LINKindex).height());
		$JQ('#'+Data.IDslide+' ul').animate({ left:c_newlt },{easing:"easeInOutExpo",duration:1000, queue:false, complete:function(){ jQuery.data(document.body,Data.IDslide,{PERM:true});  }}); 
		$JQ('#'+Data.IDslide).animate({ height:c_newheight },{easing:"swing",duration:750, queue:false, complete:function(){     }}); //setHeight
		return false;
	}catch(err){ if(jDebugMode==true){ alert('jSliderMVA_Set: ' + err); }}
}

function jSliderMVA_Direction(event){
	try{//[Last Update: 18.kwietnia.2011] (NOTE: alert #50 info removed)
		var Data=event.data.Data;
		var c_direction=event.data.Direction;
		var elements=$JQ('#'+Data.IDlink+' li');
		var c_active=-1;
		
		for(var i=0;i<elements.length;i++){
			if($JQ(elements).eq(i).attr('class')=='active'){  c_active=i; break; }
		}
		if(c_active==-1){ /*alert('MVA Error: #50');*/ return false;  }
		
		switch(c_direction) {
			case 'next': if(c_active<elements.length-1){ c_active+=1; }else{ c_active=0; }  break;
			case 'prev': if(c_active>=1){ c_active-=1; }else{ c_active=elements.length-1; }  break;
			default: return false;
		}
		if(c_active>=0 && c_active<elements.length){ $JQ(elements).eq(c_active).click(); }
		return false;
	}catch(err){ if(jDebugMode==true){ alert('jSliderMVA_Direction: ' + err); }}
}
			
			
function jSliderMVA(Data){
	try{//[Last Update: 21.maja.2011] (NOTE: jitemhover added)
		if(!Data || Data==''){ return false; }
		if(!Data.IDprev || Data.IDprev==''){ return false; }
		if(!Data.IDnext || Data.IDnext==''){ return false; }
		if(!Data.IDlink || Data.IDlink==''){ return false; }
		if(!Data.IDslide || Data.IDslide==''){ return false; }
		if(!Data.Num || Data.Num==''){ Data.Num=-1; }else{ Data.Num=parseInt(Data.Num); }
		if(!Data.AdditionalFields || Data.AdditionalFields==''){ Data.AdditionalFields=0; }
		if((Data.AdditionalFields<0) || (isNaN(Data.AdditionalFields)==true)){ Data.AdditionalFields=0; } //Data.AdditionalFields - Display Additional Fields (for 4 boxes Data.AdditionalFields=3)
		if(!Data.Timer || Data.Timer==''){ Data.Timer=false; }
		
		var c_total=$JQ('#'+Data.IDslide+' li').length; //setWidth
		var c_width=parseInt($JQ('#'+Data.IDslide).find('li').eq(0).attr('offsetWidth'));
		var c_height=parseInt($JQ('#'+Data.IDslide).find('li').eq(0).attr('offsetHeight'));
		if(c_total<=0 || c_width<=0){ return false; }

		$JQ('#'+Data.IDslide).animate({ height:c_height },{easing:"swing",duration:750, queue:false, complete:function(){     }}); //setHeight
		$JQ('#'+Data.IDslide+' ul').css('width',parseInt(c_total*c_width));
		$JQ('#'+Data.IDslide+' ul').css('left',0);
		
		
		var elements=$JQ('#'+Data.IDlink+' li');
		//Added auto links creation
		if(elements.length==0){ 
			$JQ('#'+Data.IDlink).empty();
			$JQ('#'+Data.IDlink).append('<ul></ul>');
			
			for(var i=0;i<parseInt(c_total-Data.AdditionalFields);i++){
				//$JQ('#'+Data.IDlink).find('ul').eq(0).append('<li><a href="#"><img src="'+GlobPathEmptyGif+'" alt="" /></a></li>');
				$JQ('#'+Data.IDlink).find('ul').eq(0).append('<li><a class="jitemhover" href="#"><img src="'+GlobPathEmptyGif+'" alt="" /></a></li>'); //Update 1
			}
			elements=$JQ('#'+Data.IDlink+' li');
		}
		//Added auto links creation
		$JQ(elements).attr('class','');
		
		if((Data.Num>0 && Data.Num<elements.length) && (c_total==elements.length)){ 
			$JQ(elements).eq(Data.Num).attr('class','active');
			$JQ('#'+Data.IDslide+' ul').css('left',parseInt((-1)*Data.Num*c_width));
			
		}else{ $JQ(elements).eq(0).attr('class','active'); }
		
		jQuery.data(document.body,Data.IDslide,{PERM:true});
		for(var i=0; i<elements.length; i++){
			$JQ(elements).eq(i).bind("click", {Data:Data, LINKindex:i}, jSliderMVA_Set);
		}
		
		$JQ('#'+Data.IDprev).bind("click", {Data:Data, Direction:'prev'}, jSliderMVA_Direction);
		$JQ('#'+Data.IDnext).bind("click", {Data:Data, Direction:'next'}, jSliderMVA_Direction);
		
		if(Data.Timer==true){ jSliderMVA_TimerSet(Data); }
		
	}catch(err){ if(jDebugMode==true){ alert('jSliderMVA: ' + err); }}
}

function jSliderMVA_TimerSet(Data){
	try{//[Last Update: 16.stycznia.2010]
		if(!Data || Data==''){ return false; }
		if(!Data.IDprev || Data.IDprev==''){ return false; }
		if(!Data.IDnext || Data.IDnext==''){ return false; }
		if(!Data.IDlink || Data.IDlink==''){ return false; }
		if(!Data.Duration || Data.Duration==''){ return false; }
		if(Data.Duration<=0){ return false; }
		
		$JQ('#'+Data.IDprev).add('#'+Data.IDnext).bind("mouseover", {Data:Data}, jSliderMVA_TimerOver);
		$JQ('#'+Data.IDprev).add('#'+Data.IDnext).bind("mouseout", {Data:Data}, jSliderMVA_TimerOut);
		
		$JQ('#'+Data.IDslide).add('#'+Data.IDlink+' a').bind("mouseover", {Data:Data}, jSliderMVA_TimerOver);
		$JQ('#'+Data.IDslide).add('#'+Data.IDlink+' a').bind("mouseout", {Data:Data}, jSliderMVA_TimerOut);
		
		jSliderMVA_setTimerPerm(Data,true);
		Data.Status='firstrun';
		jSliderMVA_Timer(Data);
		return true;
	}catch(err){ if(jDebugMode==true){ alert('jSliderMVA_TimerSet: ' + err); }}
}

function jSliderMVA_setTimerPerm(Data,Value){
	try{//[Last Update: 16.stycznia.2010]
		if(!Data || Data==''){ return false; }
		if(!Data.IDslide || Data.IDslide==''){ return false; }
		if(typeof(Value)=="undefined" || Value==null){ return false; }
		if((Value!=true) && (Value!=false)){ return false; }
		
		var c_date = new Date();
		var c_datemls = c_date.valueOf()
		
		$JQ('#'+Data.IDslide).data('jSliderMVA_TimerPerm',Value);
		$JQ('#'+Data.IDslide).data('jSliderMVA_TimerPermTimeSet',c_datemls);
		
	}catch(err){ if(jDebugMode==true){ alert('jSliderMVA_setTimerPerm: ' + err); }}
}

function jSliderMVA_TimerOver(event){
	try{//[Last Update: 16.stycznia.2010]
		var Data=event.data.Data;
		jSliderMVA_setTimerPerm(Data,false);
	}catch(err){ if(jDebugMode==true){ alert('jSliderMVA_TimerOver: ' + err); }}
}

function jSliderMVA_TimerOut(event){
	try{//[Last Update: 16.stycznia.2010]
		var Data=event.data.Data;
		jSliderMVA_setTimerPerm(Data,true);
	}catch(err){ if(jDebugMode==true){ alert('jSliderMVA_TimerOut: ' + err); }}
}

function jSliderMVA_Timer(Data){
	try{//[Last Update: 16.stycznia.2010]
		if(!Data || Data==''){ return false; }
		if(!Data.IDprev || Data.IDprev==''){ return false; }
		if(!Data.IDnext || Data.IDnext==''){ return false; }
		if(!Data.Duration || Data.Duration==''){ return false; }
		if(Data.Duration<=0){ return false; }
		if(!Data.Status || Data.Status==''){ Data.Status=''; }
		
		var TimerPerm=$JQ('#'+Data.IDslide).data('jSliderMVA_TimerPerm') ? true : false;
		
		if((TimerPerm==true) && (Data.Status!='firstrun')){
			
			var c_date = new Date();
			var c_datemls = c_date.valueOf()
			var c_oldmls=parseInt($JQ('#'+Data.IDslide).data('jSliderMVA_TimerPermTimeSet'));
			var c_diff=c_datemls-c_oldmls
			
			var c_duration=Data.Duration;
			if(c_diff<Data.Duration){ c_duration=parseInt(Data.Duration-c_diff); }
			else{ $JQ('#'+Data.IDnext).click(); }
			$JQ(this).oneTime(c_duration,function(i){ jSliderMVA_Timer(Data); });
			return;
		}else{
			Data.Status='right'; 
			$JQ(this).oneTime(Data.Duration,function(i){ jSliderMVA_Timer(Data); });
		}
	}catch(err){ if(jDebugMode==true){ alert('jSliderMVA_Timer: ' + err); }}
}
/* =============================== .SliderMVA [END] ================================= */
/* =============================== .jImageLoader [START] ============================ */
function jImageLoader_Download(Data,Counter){ 
	try{//[Last Update: 06.listopada.2010]
		if(!Data.This || Data.This==''){ return false; }
		if(!Data.Mode || Data.Mode==''){ return false; }
		if(!Data.TAG || Data.TAG==''){ return false; }
		if(!Counter || Counter==''){ Counter=0; }
		if(Counter>=2){ return false; }
		//alert(Data.SRCorigin);
		//if(!Data.SRC){ return false; }
		
		//alert(Data.SRC);
		
		//$JQ.ajaxSetup({ cache: false });
		//$JQ.ajax({ cache: false, global:false });
		var img = new Image();
		//$JQ.ajaxSetup({ cache:false, global:false });
		$JQ(img).load(function(){
			//$JQ(Data.This).append(img);//alert($JQ(Data.This).attr('class'));
			$JQ(Data.This).animate({ opacity:0 },{easing:"easeInOutSine",duration:200, queue:false, complete:function(){   
				if(Data.Anime==true){ $JQ(Data.This).removeClass('jimgload_animebefore'); }
				if(Data.TAG=='img'){ $JQ(Data.This).attr('src',Data.SRC); }
				else{ $JQ(Data.This).css('background-image',Data.SRCorigin); }
				$JQ(Data.This).animate({ opacity:1 },{easing:"easeInOutSine",duration:400, queue:false, complete:function(){   }});
			}});//animate
		}).error(function(){
			$JQ(Data.This).animate({ opacity:0 },{easing:"easeInOutSine",duration:200, queue:false, complete:function(){
				if(Data.Anime==true){ 
					$JQ(Data.This).removeClass('jimgload_animebefore');
					$JQ(Data.This).addClass('jimgload_animeerror');
				}
				$JQ(Data.This).oneTime(10000,function(i){
					Counter++;
					jImageLoader_Download(Data,Counter);
				});//oneTime
				$JQ(Data.This).animate({ opacity:1 },{easing:"easeInOutSine",duration:400, queue:false, complete:function(){   }});
				
			}});//animate
		}).attr('src',Data.SRC);
	}catch(err){ if(jDebugMode==true){ alert('jImageLoader_Download: ' + err); }}
}


function jImageLoader_Set(Name,Mode,Anime,Timer){ 
	try{//[Last Update: 06.listopada.2010]
		if(!Name || Name=='' || Name.length<2){ return false; }
		if(!Mode || Mode==''){ Mode='series'; } //inactive
		if(typeof(Anime)=="undefined" || Anime==null){ Anime=false; }
		if(!Timer || Timer==''){ Timer=false; }
		
		switch(Name.charAt(0)){
			case '.': break;
			case '#': break;
			//default: Name='#'+Name;
		}
		
		switch(Mode.toLowerCase()){
			case 'series': break;
			case 'parallel': break;
			default: Mode='series';
		}
		
		//$JQ(Name).attr('src','/bc_graph/shared/empty.gif');
		//$JQ(Name).css('display','block');
		
		$JQ(Name).each(function(index){
			var This=this;
			var c_src='';
			var c_srcorigin='';
			var c_tagname=$JQ(this).get(0).tagName.toLowerCase();
			
			$JQ(this).data('jImageLoader_status', $JQ(this).data('jImageLoader_status') ? $JQ(this).data('jImageLoader_status') : 'start' );
			if($JQ(this).data('jImageLoader_status')!='start'){ return true; }
			else{ $JQ(this).data('jImageLoader_status','end'); }
			
			if(c_tagname=='img'){ 
				c_src=$JQ(this).attr('src');
				$JQ(this).attr('src','/bc_graph/shared/empty.gif');
			}
			else{ 
				c_src=$JQ(this).css('background-image'); 
				c_srcorigin=c_src;
				c_src=c_src.slice(c_src.indexOf('(')+1,c_src.lastIndexOf(')')); 
				c_src=c_src.replace(/"/g,''); 
				$JQ(this).css('background-image','url("/bc_graph/shared/empty.gif")');
			}
			
			$JQ(this).css({'opacity':0,'display':'block'});
			if(Anime==true){ $JQ(this).addClass('jimgload_animebefore'); }
			$JQ(this).stop(true,false).animate({ opacity:1 },{easing:"easeInOutSine",duration:400, queue:false, complete:function(){   
				jImageLoader_Download({This:This, Mode:Mode, Anime:Anime, SRC:c_src, TAG:c_tagname, SRCorigin:c_srcorigin});
			}});//animate
		});
		
		if(Timer==true){
			$JQ(this).oneTime(1000,function(i){ if(GlobIE6!=true){ jImageLoader_Set('.jimgload','',true,true); } });
		}
	}catch(err){ if(jDebugMode==true){ alert('jImageLoader_Set: ' + err); }}
}
/* =============================== .jImageLoader [END] ============================== */
/* =============================== .jBC_ajaxSendForm [START] ======================== */
function jBC_ajaxSystemMessage(c_text){
	try{
		jBC_ajaxSystemMessage.success='';
		jBC_ajaxSystemMessage.message='';
		if(!c_text || c_text==''){ return false; }
		
		c_text=c_text.substring(c_text.lastIndexOf("{")+1, c_text.indexOf("}"));
		c_success=c_text.substring(c_text.indexOf(":")+2, c_text.lastIndexOf(",")).toLowerCase();
		c_message=c_text.substring(c_text.lastIndexOf('":')+3, c_text.lastIndexOf('"'));
		if((c_success!='false') && (c_success!='true')){ return false; }
		jBC_ajaxSystemMessage.success=c_success;
		jBC_ajaxSystemMessage.message=c_message;
		
		return true;
	}catch(err){ if(jDebugMode==true){ alert('jBC_ajaxSystemMessage: ' + err); }}
}

function jBC_ajaxFormProcessV2Response(c_text){
	try{
		jBC_ajaxFormProcessV2Response.success='';
		
		if(!c_text || c_text==''){ return false; }
		
		c_text=c_text.substring(c_text.lastIndexOf("{")+1, c_text.indexOf("}"));
		c_success=c_text.substring(c_text.indexOf(":")+2, c_text.indexOf(",")).toLowerCase();
		
		
		var c_idname='"success":';
		c_success=c_text.slice(c_text.indexOf(c_idname)+c_idname.length+1, c_text.length);
		c_success=c_success.slice(0,c_success.indexOf(','));
		
		if((c_success!='false') && (c_success!='true')){ return false; }
		
		var c_idname='"entityId":';
		c_entityId=c_text.slice(c_text.indexOf(c_idname)+c_idname.length+2, c_text.length);
		c_entityId=c_entityId.slice(0,c_entityId.indexOf('",'));
		
		
		var c_idname='"objectTypeId":';
		c_objectTypeId=c_text.slice(c_text.indexOf(c_idname)+c_idname.length+2, c_text.length);
		c_objectTypeId=c_objectTypeId.slice(0,c_objectTypeId.indexOf('",'));
		
		var c_idname='"objectId":';
		c_objectId=c_text.slice(c_text.indexOf(c_idname)+c_idname.length+2, c_text.length);
		c_objectId=c_objectId.slice(0,c_objectId.indexOf('",'));
		
		var c_idname='"message":';
		c_message=c_text.slice(c_text.indexOf(c_idname)+c_idname.length+2, c_text.length);
		c_message=c_message.slice(0,c_message.indexOf('"'));
		
		jBC_ajaxSystemMessage.success=c_success;
		jBC_ajaxSystemMessage.entityId=c_entityId;
		jBC_ajaxSystemMessage.objectTypeId=c_objectTypeId;
		jBC_ajaxSystemMessage.objectId=c_objectId;
		jBC_ajaxSystemMessage.message=c_message;
		
		return true;
	}catch(err){ if(jDebugMode==true){ alert('jBC_ajaxSystemMessage: ' + err); }}
}

function jBC_ajaxSendForm(ID,Data){ //Note: Data added
	try{//[Last Update: 28.listopada.2010]
		if(!ID || ID==''){ return false; }
		if(typeof(Data)=="undefined" || Data==null){ var Data=new Array(); }
		if(!Data.SuccessText || Data.SuccessText==''){ Data.SuccessText='<b class="color_green">Your message hes been sent.</b>'; }
		if(!Data.GAfolder || Data.GAfolder==''){ Data.GAfolder=ID; }
		var $c_form = $JQ('#'+ID);
		var c_action=$c_form.attr('action');
		if((c_action.length>1) && (c_action.charAt(0)=='#')){ c_action=c_action.slice(1,c_action.length); }

		$JQ.ajax({
			type: 'POST',
			url: c_action,
			data: $c_form.serialize(),
			dataType: "JSON", 
			global: false,
			success: function(msg){
					
					var general_phrasestart='<!-- [[jBC_general(START)]] -->';
					var general_phraseend='<!-- [[jBC_general(END)]] -->';
					
					if((msg.indexOf(general_phrasestart)>-1) && (msg.indexOf(general_phraseend)>-1)){
						var c_info=msg.slice(msg.indexOf(general_phrasestart)+general_phrasestart.length, msg.indexOf(general_phraseend)+general_phraseend.length);
						var c_info=c_info.replace('error','color_red');
						alert(c_info);
						return false;
					}
					
					if(msg.indexOf('"SystemMessage"')>-1){
						var c_err=jBC_ajaxSystemMessage(msg);
						if(c_err){ alert('<b class="color_red">'+jBC_ajaxSystemMessage.message+'</b>'); }
						else{ alert('<b class="color_red">Unknown System Error Occured</b> - Please Try Again.');	}
						return false;
					}
					
					if(msg.indexOf('"FormProcessV2Response"')>-1){
						var c_err=jBC_ajaxFormProcessV2Response(msg);
						if(c_err){ 
							//alert('<b class="color_green">Your message hes been send.</b>');
							alert(Data.SuccessText);
							$c_form.find('input[type="reset"]').eq(0).trigger('click');
							//_gaq._trackPageview('/GA/webform/'+Data.GAfolder);
							_gaq.push(['_trackPageview','/GA/webform/'+Data.GAfolder]);
							
							if(Data.GAfolder=='online-enquiry'){ 
								//_gaq._trackEvent('Online Enquiry','Submit'); 
								_gaq.push(['_trackEvent', 'Online Enquiry','Submit']);
							}
							
						}else{ alert('<b class="color_red">Unknown Response Error Occured</b> - Please Try Again.');	}
						return false;
					}
					alert('<b class="color_red">Response hasn&acute;t been detected.</b><br />'+msg);
			},
			error: function(msg){
					var c_err=jBC_ajaxSystemMessage(msg.responseText);
					if(c_err){ alert('<b class="color_red">'+jBC_ajaxSystemMessage.message+'</b>'); }
					else{ alert('<b class="color_red">Unknown Error Occured</b> - Please Try Again.');	}
			}
		});
	}catch(err){ if(jDebugMode==true){ alert('jBC_ajaxSendForm: ' + err); }}
}
/* =============================== .jBC_ajaxSendForm [END] ========================== */
/* =============================== .jBC_ajaxSlider [START] ========================== */
$JQ.jBC_ajaxSliderAnimation = function(This,Order){
	try{
		if(!This || This==''){ return false; }
		if(!Order || Order==''){ return false; }
		
		var c_id=jQuery.data(This,'IDslider-animation');
		if(!c_id || c_id==''){ return false; }
		var c_left=$JQ(This).offset().left;
		var c_top=$JQ(This).offset().top;
		c_left+=$JQ(This).width();
		
		switch(Order) {
			case 'open': 	if($JQ('#'+c_id).length==0){
								$JQ('body').append('<div id="'+c_id+'" class="ajax_loadera"><div class="ajax_loadera-anime"></div></div>');
								c_top=c_top-$JQ('#'+c_id).height();
								$JQ('#'+c_id).css({'opacity':0,'left':c_left,'top':c_top})
							}
							$JQ('#'+c_id).stop(true,false).animate({ opacity:1},{easing:"easeInOutSine",duration:400, queue:false, complete:function(){ 	}});
							break;
							
			case 'close':  	$JQ('#'+c_id).stop(true,true).animate({ opacity:0},{easing:"easeInOutSine",duration:2000, queue:false, complete:function(){ $JQ('#'+c_id).remove(); 	}});
							break;
			default: return false;
		}
		
	}catch(err){ if(jDebugMode==true){ alert('jBC_ajaxSliderAnimation: ' + err); }}
}
function jBC_ajaxSliderClick(event){
	try{
		var Index=event.data.Index;
		var IDdialog=event.data.IDdialog;
		var c_href=$JQ(this).attr('href');
		var This=$JQ(this);
		
		if(c_href=='' || c_href=='#'){ return false; }
		jQuery.data(This,'IDslider-animation','ajax_loadera-jslider_'+Index);
		
		//var c_href='orderRetrievev2-test.aspx';
		$JQ.ajax({
			url: c_href,
			global: false,
			cache: false,
			type: 'POST',
			beforeSend: function(){
				//alert(event.pageX +', '+ event.pageY+' ['+$JQ(This).position().left+','+$JQ(This).position().top+']');
				//alert($JQ(This).offset().left+','+$JQ(This).offset().top); // "DIV"
				$JQ.jBC_ajaxSliderAnimation(This,'open');
			},
			success: function(msg){
				try{
					//if(msg.indexOf('<body>')==-1){ alert('<b class="color_red">Unable to display selected page.</b><br />Incorrect data format.'); return false; }
					//var c_body=msg.slice(msg.indexOf('<body>')+6,msg.lastIndexOf('</body>'));
					c_body=msg;
					var c_dialogcontent=$JQ('#'+IDdialog).find('.'+IDdialog+'_jcontent').eq(0);
					$JQ(c_dialogcontent).empty();
					$JQ(c_dialogcontent).append(c_body);
					$JQ('#'+IDdialog).jdialoga('open');
				}catch(err){ if(jDebugMode==true){ alert('jBC_ajaxSliderClick-success: ' + err); }}
			},
			error: function(msg){
				alert('<b class="color_red">Unable to load page.</b><br />The page doesn&prime;t exist, or<br /> there is the problem with internet connection.');
			},
			complete: function(msg){
				$JQ.jBC_ajaxSliderAnimation(This,'close');
			}
		});
		
		return false;
	}catch(err){ if(jDebugMode==true){ alert('jBC_ajaxSliderClick: ' + err); }}
}

function jBC_ajaxSliderSet(Rel, IDdialog){
	try{
		if(!Rel || Rel==''){ return false; }
		if(!IDdialog || IDdialog==''){ return false; }
		var elements=$JQ.find('a[rel='+Rel+']');
		if(elements.length<=0){ return false; }
		
		
		$JQ(elements).each(function(index){
			if($JQ(this).hasClass('ajax_sliderclick')==false){
				$JQ(this).bind("click", {Index:index, IDdialog:IDdialog}, jBC_ajaxSliderClick);
				$JQ(this).addClass('ajax_sliderclick');
			}
		});
		
		return false; 
	}catch(err){ if(jDebugMode==true){ alert('jBC_ajaxSliderSet: ' + err); }}
}
/* =============================== .jBC_ajaxSlider [END] ============================ */
/* =============================== .jCommentBlogRecreate [START] ==================== */
function jCommentBlogRecreate(mainClass, ID, firstcommentID){
	try{
		var c_name, c_date, c_rate, c_cont, container;
		if($JQ('#tag_commentlist').html()=='{tag_commentlist,date}'){ return false; } //New line, checks if comments are not disabled
		var main=$JQ('.'+mainClass);
		if(main.length>1){ $JQ(main).css('display','none'); return false; }
		$JQ(main).eq(0).css('display','block');
		//var old=$JQ('.comment-container');
		var old=$JQ('.blog-comment-container');
		for(i=0;i<old.length;i++){
			c_flag=$JQ('.blog-comment-container:eq('+i+') .header .flag').html();
			c_name=$JQ('.blog-comment-container:eq('+i+') .header .name').html();
			c_date=$JQ('.blog-comment-container:eq('+i+') .header .date').html();
			c_rate=$JQ('.blog-comment-container:eq('+i+') .header .rating').html();
			c_cont=$JQ('.blog-comment-container .content:eq('+i+')').html();
			
			container='<div class="combox_title"><div class="c_name">' + c_flag + ' ' + c_name + ' ' + c_rate + '</div><div class="c_date">' + c_date + '</div></div>';
			container+='<div class="combox">' + c_cont + '</div>';
			
			$JQ('#'+ID).append(container);
			if(i==0){ $JQ('#'+firstcommentID).html(c_cont); }
		}
		
		if(old.length<=0){ 
			container='<p align="center">Post has no comments.</p>';
			$JQ('#'+ID).append(container);
			$JQ('#'+firstcommentID).html(container);
		}
		
	}catch(err){ if(jDebugMode==true){ alert('jCommentBlogRecreate: '+err); }}
}
/* =============================== .jCommentBlogRecreate [END] ====================== */
/* =============================== .jBlogSubRandom [START] ========================== */
function jBlogSubRandom(Data){
	try{
		if(!Data || Data==''){ return false; }
		if(!Data.Name || Data.Name==''){ return false; }
		if(!Data.DisplayTotal || Data.DisplayTotal==''){ return false; }
		if(typeof Data.DisplayTotal!='number' || Data.DisplayTotal<0){ return false; }
		
		switch(Data.Name.charAt(0)){
			case '.': break;
			case '#': break;
			default: Data.Name='#'+Data.Name;
		}
		
		var elements=$JQ(Data.Name).find('ul').eq(0).find('li');
		if(elements.length<Data.DisplayTotal){ Data.DisplayTotal=elements.length; }
		
		var c_random=-1;
		var c_count=0;
		var c_helper=0;
		for(var i=0;i<Data.DisplayTotal;i++){
			c_random=Math.floor(Math.random()*elements.length);
			if((c_random>=0) && c_random<=elements.length){
				if($JQ(elements).eq(c_random).hasClass('iblogrand')==false){
					$JQ(elements).eq(c_random).addClass('iblogrand'); 
					c_count++;
				}
			}//if
			if((c_count<Data.DisplayTotal) && (i==Data.DisplayTotal-1)){ 
				if(c_helper>=3){ break; }else{ c_helper++; i=i-1; }
			}//if
		}//for
		
		$JQ(elements).each(function(index){
			if($JQ(this).hasClass('iblogrand')==false){ $JQ(this).css({'display':'none'}); }
		});
	}catch(err){ if(jDebugMode==true){ alert('jBlogSubRandom: '+err); }}
}
/* =============================== .jBlogSubRandom [END] ============================ */
/* =============================== .jGA_Tracker [START] ============================= */
function jGA_Tracker(Data){
	try{ //[Last Update: 29.czerwca.2011]
	if(!Data || Data==''){ return false; }
	if(!Data.IDbread || Data.IDbread==''){ Data.IDbread=''; }
	if(!Data.IDbreadblog || Data.IDbreadblog==''){ Data.IDbreadblog=''; }
	if(Data.IDbread=='' && Data.IDbreadblog==''){ return false; }
	if(!Data.FolderPath || Data.FolderPath==''){ return false; }
	else{ 
		if(Data.FolderPath.charAt(0)!='/'){ Data.FolderPath='/'+Data.FolderPath; }
		if(Data.FolderPath.charAt(Data.FolderPath.length-1)!='/'){ Data.FolderPath=Data.FolderPath+'/'; }
	}
	
	var c_id='';
	for(var i=0; i<2; i++){
		switch(i){
			case 0: c_id=Data.IDbread; break;
			case 1: c_id=Data.IDbreadblog; break;
			default: return false; 
		}
	
		if(c_id!=''){
			var elements=$JQ('#'+c_id).find('a:last');
			if(elements.length==1){
				var c_href=$JQ(elements).attr('href');
				if(c_href.length>1){
					if(c_href.charAt(0)=='/'){ c_href=c_href.slice(1,c_href.length);  }
					//_gaq._trackPageview('/folder/file')
					//_gaq._trackPageview(Data.FolderPath+c_href);
					_gaq.push(['_trackPageview', Data.FolderPath+c_href]);
					
					return true;
				}
			}//if
		}//if
	}//for
		
	}catch(err){ if(jDebugMode==true){ alert('jGA_Tracker: '+err); }}
}
/* =============================== .jGA_Tracker [END] =============================== */
/* =============================== .single [START] ================================== */
function jSetBlur(Timer){ 
	try{//[Last Update: 09.listopada.2010]
		
		$JQ('a').each(function(index){
			$JQ(this).data('jSetBlur_status', $JQ(this).data('jSetBlur_status') ? $JQ(this).data('jSetBlur_status') : 'start' );
			if($JQ(this).data('jSetBlur_status')!='start'){ return true; }
			else{ $JQ(this).data('jSetBlur_status','end'); }
			$JQ(this).focus(function(){ $JQ(this).blur() });
		});
	
		if(Timer==true){
			$JQ(this).oneTime(1000,function(i){ jSetBlur(Timer) });
		}
		
	}catch(err){ if(jDebugMode==true){ alert('jSetBlur: ' + err); }}
}

function jItemHoverAnimation(Name, Duration, Timer){ 
	try{//[Last Update: 09.listopada.2010]
		if(!Name || Name=='' || Name.length<2){ return false; }
		if(!Duration || Duration==''){ Duration=300; }
		if(!Timer || Timer==''){ Timer=false; }

		switch(Name.charAt(0)){
			case '.': break;
			case '#': break;
			default: Name='#'+Name;
		}
		
		$JQ(Name).each(function(index){
			$JQ(this).data('jItemHoverAnimation_status', $JQ(this).data('jItemHoverAnimation_status') ? $JQ(this).data('jItemHoverAnimation_status') : 'start' );
			if($JQ(this).data('jItemHoverAnimation_status')!='start'){ return true; }
			else{ $JQ(this).data('jItemHoverAnimation_status','end'); }
			if($JQ(this).find('*').length==0){
				$JQ('<img src="/bc_graph/shared/empty.gif" alt="" />').appendTo(this);
			}
			
			$JQ(this).find('img').css('opacity',0);
			$JQ(this).find('img').css('visibility','visible');
			$JQ(this).find('input').css('opacity',0);
			$JQ(this).find('input').css('visibility','visible');
			$JQ(this).hover(function(){
				$JQ(this).find('img').eq(0).stop(true,false).animate({ opacity:1 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
				$JQ(this).find('input').eq(0).stop(true,false).animate({ opacity:1 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
			},function(){
				$JQ(this).find('img').eq(0).stop(true,false).animate({ opacity:0 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
				$JQ(this).find('input').eq(0).stop(true,false).animate({ opacity:0 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
			});//hover
		});
		
		if(Timer==true){
			$JQ(this).oneTime(1000,function(i){ jItemHoverAnimation(Name, Duration, Timer); });
		}
		
	}catch(err){ if(jDebugMode==true){ alert('jItemHoverAnimation: ' + err); }}
}

function jSpecificItemHoverAnimation(Data, Duration){
	try{ 
		if(!Data.IDlink || Data.IDlink==''){ return false; }
		if(!Data.IDimg || Data.IDimg==''){ return false; }
		if(!Duration || Duration==''){ Duration=300; }
		
		
		$JQ('#'+Data.IDimg).css('opacity',0);
		$JQ('#'+Data.IDimg).css('visibility','visible');
		
		$JQ('#'+Data.IDlink).hover(function(){
			if(GlobIE7==true || GlobIE8==true){ $JQ('#'+Data.IDimg).find('*').stop(true,false).animate({ opacity:1 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }}); } //IE7,8 Fix
			$JQ('#'+Data.IDimg).stop(true,false).animate({ opacity:1 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
		},function(){
			if(GlobIE7==true || GlobIE8==true){ $JQ('#'+Data.IDimg).find('*').stop(true,false).animate({ opacity:0 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }}); } //IE7,8 Fix
			$JQ('#'+Data.IDimg).stop(true,false).animate({ opacity:0 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
		});
	}catch(err){ if(jDebugMode==true){ alert('jSpecificItemHoverAnimation: ' + err); }}
}

function jLightboxFinder(Data){
	try{//[Last Update: 03.stycznia.2011]
		if(!Data.Relpart || Data.Relpart==''){ return false; }
		if(!Data.Duration || Data.Duration==''){ Data.Duration=1000; }
		if(!Data.Timer || Data.Timer==''){ Data.Timer=false; }
		
		$JQ('a').each(function(index){
			var c_rel=$JQ(this).attr('rel');
			if(c_rel.length>=Data.Relpart.length){
				if(c_rel.indexOf(Data.Relpart)==0){
					$JQ(this).data('jLightboxFinder_status', $JQ(this).data('jLightboxFinder_status') ? $JQ(this).data('jLightboxFinder_status') : 'start' );
					if($JQ(this).data('jLightboxFinder_status')!='start'){ return true; } 
					//$JQ(this).lightBox();
					$JQ('a[rel='+c_rel+']').lightBox(); //Update
					$JQ(this).data('jLightboxFinder_status','done');
				}
			}
		});
		
		if(Data.Timer==true){
			$JQ(this).oneTime(Data.Duration,function(i){ jLightboxFinder(Data); });
		}
		
	}catch(err){ if(jDebugMode==true){ alert('jLightboxFinder: ' + err); }}
}

function jMinHeight(Name, Height){
	try{
		if(!Name || Name=='' || Name.length<2){ return false; }
		if(!Height || Height=='' || Height<=0){ return false; }
		
		switch(Name.charAt(0)){
			case '.': break;
			case '#': break;
			default: Name='#'+Name;
		}
		
		var elements=$(Name);
		var c_height;
		
		for(var i=0; i<elements.length;i++){
			//c_height=parseInt($(Name).eq(i).css('height'));
			c_height=parseInt($(Name).eq(i).height()); //IE6 Path;
			if(c_height<Height){ $(Name).eq(i).css('height',Height); }
		}
		return true;
	}catch(err){ if(jDebugMode==true){ alert('jMinHeight: ' + err); }}
}

function jSetClickFalse(Data){ 
	try{//[Last Update: 27.listopada.2010]
		if(!Data.Relpart || Data.Relpart==''){ return false; }
		if(!Data.Duration || Data.Duration==''){ Data.Duration=1000; }
		if(!Data.Timer || Data.Timer==''){ Data.Timer=false; }
		
		$JQ('a[rel='+Data.Relpart+']').each(function(index){
			$JQ(this).data('jSetClickFalse_status', $JQ(this).data('jSetClickFalse_status') ? $JQ(this).data('jSetClickFalse_status') : 'start' );
			if($JQ(this).data('jSetClickFalse_status')!='start'){ return true; } 
			$JQ(this).bind("click",{},function(){ return false; });
		});
		
		if(Data.Timer==true){
			$JQ(this).oneTime(Data.Duration,function(i){ jSetClickFalse(Data) });
		}
		
	}catch(err){ if(jDebugMode==true){ alert('jSetClickFalse: ' + err); }}
}

function jTextClear(Data){
	try{//[LAST UPDATE: 18.listopada.2010, NOTE: Compatible with IE6]
		if(!Data.Text || Data.Text==''){ return false; }
		if(!Data.AllowedChars || Data.AllowedChars==''){ return false; }
		if(Data.AllowedChars.length<=0){ return false; }
		//Data.Text=Data.Text.toString();
		//alert(Data.Text.length);
		var c_newtext='';
		var c_found=false;
		for(var i=0;i<Data.Text.length;i++){
			Data.Text.charAt(i);
			c_found=false;
			for(var k=0;k<Data.AllowedChars.length;k++){
				if(Data.AllowedChars.charAt(k)==Data.Text.charAt(i)){ c_found=true; break; }
			}
			if(c_found==true){c_newtext=c_newtext+Data.Text.charAt(i); }
		}
		return c_newtext;
		
	}catch(err){ if(jDebugMode==true){ alert('jTextClear: ' + err); }}
}

function jTextVerify(Data){
	try{//[LAST UPDATE: 22.luty.2011, NOTE: Compatible with IE6]
		if(!Data.Text || Data.Text==''){ return false; }
		if(!Data.AllowedChars || Data.AllowedChars==''){ return false; }
		if(Data.AllowedChars.length<=0){ return false; }
		
		var c_found=false;
		for(var i=0;i<Data.Text.length;i++){
			Data.Text.charAt(i);
			c_found=false;
			for(var k=0;k<Data.AllowedChars.length;k++){
				if(Data.AllowedChars.charAt(k)==Data.Text.charAt(i)){ c_found=true; break; }
			}
			if(c_found==false){ return false; }
		}
		return true;
		
	}catch(err){ if(jDebugMode==true){ alert('jTextVerify: ' + err); }}
}

function jInputKeypressFilter(event){
	try{
		var AllowedChars=event.data.AllowedChars;
		if(!AllowedChars || AllowedChars==''){ return true; }
		
		var c_key=event.which; //event.keyCode;
		var c_keychar=String.fromCharCode(c_key);
		
		if((c_key==null) || (c_key==0) || (c_key==8) || (c_key==9) || (c_key==13) || (c_key==27) ){ return true; } //Control keys
		//if((("0123456789").indexOf(c_keychar) > -1)){  return true; }
		if(((AllowedChars).indexOf(c_keychar) > -1)){  return true; }
		else{ return false; }

	}catch(err){ if(jDebugMode==true){ alert('jInputKeypressFilter: ' + err); }}
}

function jOpacityHoverAnimation(Data){ 
	try{//[Last Update: 21.maja.2011]
		if(!Data || Data==''){ return false; }
		if(!Data.Name || Data.Name=='' || Data.Name.length<2){ return false; }
		if(!Data.OpacityStart || Data.OpacityStart==''){ Data.OpacityStart=0.50; }
		if(!Data.OpacityEnd || Data.OpacityEnd==''){ Data.OpacityEnd=1.0; }
		if(!Data.Duration || Data.Duration==''){ Duration=300; }
		if(!Data.Timer || Data.Timer==''){ Timer=false; }

		switch(Data.Name.charAt(0)){
			case '.': break;
			case '#': break;
			default: Data.Name='#'+Data.Name;
		}
		
		$JQ(Data.Name).each(function(index){
			$JQ(this).data('jOpacityHoverAnimation_status', $JQ(this).data('jOpacityHoverAnimation_status') ? $JQ(this).data('jOpacityHoverAnimation_status') : 'start' );
			if($JQ(this).data('jOpacityHoverAnimation_status')!='start'){ return true; }
			else{ $JQ(this).data('jOpacityHoverAnimation_status','end'); }
			/*if($JQ(this).find('*').length==0){
				$JQ('<img src="/bc_graph/shared/empty.gif" alt="" />').appendTo(this);
			}*/
			
			//$JQ(this).find('img').css('opacity',0);
			//$JQ(this).find('img').css('visibility','visible');
			//$JQ(this).find('input').css('opacity',0);
			//$JQ(this).find('input').css('visibility','visible');
			$JQ(this).css('opacity',Data.OpacityStart);
			//$JQ(this).css('opacity',0.2);
			//alert(Data.OpacityEnd);
			$JQ(this).hover(function(){
			
				if(GlobIE8==true){ $JQ(this).find('*').stop(true,false).animate({ opacity:Data.OpacityEnd },{easing:"swing",duration:Data.Duration, queue:false, complete:function(){    }}); }
				$JQ(this).stop(true,false).animate({ opacity:Data.OpacityEnd },{easing:"swing",duration:Data.Duration, queue:false, complete:function(){    }});
			},function(){
				if(GlobIE8==true){ $JQ(this).find('*').stop(true,false).animate({ opacity:Data.OpacityStart },{easing:"swing",duration:Data.Duration, queue:false, complete:function(){    }}); }
				$JQ(this).stop(true,false).animate({ opacity:Data.OpacityStart },{easing:"swing",duration:Data.Duration, queue:false, complete:function(){    }});
			});
			
		});
		
		if(Data.Timer==true){
			$JQ(this).oneTime(1000,function(i){ jOpacityHoverAnimation(Data); });
		}
		
	}catch(err){ if(jDebugMode==true){ alert('jOpacityHoverAnimation: ' + err); }}
}

$JQ(document).ready(function(){
	//jTopAnimation();
	//jMenuAnimation('menul');
});
/* =============================== .single [END] ==================================== */
/* =============================== .Disabled [START] ================================ */
/*
function jAjaxClearboxCleaner(){
	try{
		var elements=$JQ('.jAjaxDone').find('a');
		for(i=0;i<elements.length;i++){
			c_rev=$JQ(elements).eq(i).attr('rev');
			if(c_rev.toLowerCase()=='clearbox'){
				$JQ(elements).eq(i).click(function () { return false; });
			}
		}
		
		setBlur();
		
	}catch(err){ if(DebugQueryMode==true){ alert('jAjaxClearboxCleaner: '+err); }}
}
*/
/* =============================== .Disabled [END] ================================== */
/* ================================================================================== */
/* =============================== jquery.ready [END] =============================== */
/* ================================================================================== */

