// 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] ============================= */
/* ================================================================================== */
/* =============================== .jAjax [START] =================================== */
// Important, required function getScrollXY;
var Global_jAjaxPerm=true;
function jAjax(){
	try{
		if(Global_jAjaxPerm==false){ self.setTimeout("jAjax('"+'test'+"')", 300); }
		elements=$JQ('.jAjax');
		
		var glob=0;
		for(i=0;i<elements.length;i++){
			c_href='';
			single=$JQ(elements).eq(i).find('.jAjax_link');
			//alert(single.length);
			if(single.length==1){ c_href=$JQ(single).eq(0).attr('href'); }
			if(c_href!='' && c_href !='#'){
				$JQ(elements).eq(i).attr('class','.jAjaxDone');
				
				$JQ(elements).eq(i).bind("ajaxSend", function(){
					Global_jAjaxPerm=false;
					$JQ(this).unbind('ajaxSend');
					$JQ(this).hide();
					
				}).bind("ajaxComplete", function(){
					$JQ(this).unbind('ajaxError');
					$JQ(this).unbind('ajaxComplete');
					$JQ(this).show(800, function(){ Global_jAjaxPerm=true; });					
					
				}).bind("ajaxError", function(){
					$JQ(this).unbind('ajaxError');
					$JQ(this).unbind('ajaxComplete');
					$JQ(this).html('<div class="loading"><img src="graph/shared/empty.gif" alt="" width="18" height="18" /></div>');
					$JQ(this).show(800, function(){ Global_jAjaxPerm=true; });
				});
				Global_jAjaxPerm=false;
				$JQ(elements).eq(i).load(c_href);
				self.setTimeout("jAjax('"+'test'+"')", 300);
				return false;
			}//if
			
		}//for
	}catch(err){ if(DebugQueryMode==true){ alert(' jAjax: '+err); }}
}


function jAjaxSliderSet(){
	try{
		var elements = $JQ('a');
		for(i=0;i<=elements.length;i++){
			if($JQ(elements).eq(i).attr('rev')=='jslider'){
				$JQ(elements).eq(i).click(function () {
					var new_href=$JQ(this).attr('href');
					if(new_href=='' || new_href=='#'){ return false; }
					//var new_href='https://myhealthangel01.worldsecuresystems.com/mini/help/programs_faq/my_weight.html';
					//cmsSlideShow(new_href);
					jAjaxSlider(new_href);
					return false;
				});
				
				$JQ(elements).eq(i).bind("ajaxError", function(){
					//$JQ(this).unbind('ajaxError');
					//$JQ(this).unbind('ajaxComplete');
					
					$JQ('#layer_slider').html('<a class="layer_slider_close" href="#"><img src="graph/shared/empty.gif" alt="" /></a><div class="loading_error" style="display:none">Unable to load page</div>');
					$JQ(".layer_slider_close").click(function () { 
						$JQ('#layer_main').remove();
						return false;
					});
					$JQ('#layer_slider .loading_error').show(100);
					
					//$JQ('#layer_opacity').animate({opacity:0}, 4000,"swing",function() {  });  
					//$JQ('#layer_slider').animate({opacity:0.9}, 2000,"linear",function() {  $JQ('#layer_main').remove(); });  
					return true;
				}).bind("ajaxComplete", function(){
					//$JQ(this).unbind('ajaxError');
					//$JQ(this).unbind('ajaxComplete');
					$JQ('#layer_slider .layer_slider_close').css('opacity',0);	
					$JQ('#layer_slider .layer_slider_close').animate({opacity:1}, 800,"swing");
					return false;
				});
				
				
			}
		}	
		
		
			
	}catch(err){ if(DebugQueryMode==true){ alert(' jAjaxSliderSet: '+err); }}
}

function jAjaxSlider(c_href){
	try{
		var elements=$JQ('#layer_main');
		if(elements.length>0){ return false; }
		$JQ('body').prepend('<div class="layer_main" id="layer_main"></div>');
		$JQ('#layer_main').append('<div class="layer_opacity" id="layer_opacity"></div>');
		$JQ('#layer_main').append('<div class="layer_slider" id="layer_slider" align="center"><a class="layer_slider_close" href="#"><img src="graph/shared/empty.gif" alt="" /></a></div>');
		
		$JQ('#layer_slider').append('<div class="layer_slider_ajax"><div class="jAjax"><a class="jAjax_link" href="'+c_href+'"></a></div></div>');
		
		$JQ('#layer_slider .layer_slider_close').css('opacity',0);
		$JQ('#layer_main').css('height', $JQ('body').attr('scrollHeight'));
		$JQ('#layer_opacity').css('height', $JQ('body').attr('scrollHeight'));
		
		var scrolls=getScrollXY();
		var c_top=scrolls[1]+150;
		$JQ('#layer_slider').animate({top:c_top}, 60, "linear");
		
		$JQ(".layer_opacity").click(function () { 
		  	$JQ('#layer_main').remove();
		  	return false;
		});
		
		$JQ(".layer_slider_close").click(function () { 
		  	$JQ('#layer_main').remove();
		  	return false;
		});
		
		$JQ('#layer_opacity').css('opacity',0);
		$JQ('#layer_main').show();
		jAjaxSliderPosition();
		$JQ('#layer_opacity').animate({opacity:0.6}, 1000,"swing",function() { jAjax();  });
		
		
		//$JQ('#layer_main').show(1000, );
		
		
		
	}catch(err){ if(DebugQueryMode==true){ alert(' jAjaxSlider: '+err); }}
}

function jAjaxSliderPosition(){
	try{
		var elements=$JQ('#layer_main');
		if(elements.length!=1){ return false; }
		
		c_bodywidth=parseInt($JQ('body').attr('offsetWidth'));
		if(c_bodywidth<1000){ c_bodywidth=1000; }
		
		$JQ('#layer_main').css('width',c_bodywidth);
		$JQ('#layer_opacity').css('width',c_bodywidth);
		
		if(parseInt($JQ('.layer_slider_ajax').attr('offsetHeight'))>=430){ 
			$JQ('.layer_slider_ajax').css('padding-right','18px');
		}
		
		var c_left=parseInt((c_bodywidth/2)- ($JQ('#layer_slider').attr('offsetWidth')/2 ));
		//var scrolls=getScrollXY();
		//var c_top=scrolls[1]+150;
		
		//$JQ('#layer_slider').css('left',c_left);
		//$JQ('#layer_slider').css('top',c_top);
		$JQ('#layer_slider').animate({left:c_left}, 60, "linear");
		//$JQ('#layer_slider').animate({top:c_top}, 60, "linear");
		self.setTimeout("jAjaxSliderPosition('"+'test'+"')", 400);
		
	}catch(err){ if(DebugQueryMode==true){ alert('jAjaxSliderPosition: '+err); }}
}
/* =============================== .jAjax [END] ===================================== */
/* =============================== .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){
				$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*/
				}
			}
		}//for
	}catch(err){ if(DebugQueryMode==true){ alert('jnFormRadioClick: '+err); }}
}

var glob_nFormRadio=new Array();

function jnFormRadioSet(IDarray){
	try{
		if(!IDarray || IDarray.length==0){ return false; }
		var unique_name='';
		for(i=0;i<IDarray.length;i++){
			c_id=IDarray[i];
			if(c_id.slice(0,12)=='nform_radio_'){
				c_idradio=c_id.slice(12,c_id.length);
				//alert(glob_nFormRadio.length)
				if(unique_name==''){ 
					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($JQ('#'+air.idradio).attr('checked')==true){
					$JQ('#'+air.idgraph).attr('class','nform_check2'); //set at start
				}
				
				if(!c_count){ c_count=0; }
				glob_nFormRadio[c_count]=air;
				
				$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] =========================== */
/* =============================== .jMenuAnimation [START] ========================== */
function jMenuSetAnimation(Name, Duration){
	try{ 
		if(!Name || Name=='' || Name.length<2){ return false; }
		if(!Duration || Duration==''){ Duration=300; }
		
		switch(Name.charAt(0)){
			case '.': break;
			case '#': break;
			default: Name='#'+Name;
		}
		
		$JQ(Name+' .img2').css('opacity',0);
		$JQ(Name+' .img2').css('visibility','visible');
		$JQ(Name+' .img_lt').css('opacity',0);
		$JQ(Name+' .img_lt').css('visibility','visible');
		$JQ(Name+' .img_rt').css('opacity',0);
		$JQ(Name+' .img_rt').css('visibility','visible');
		
		$JQ(Name).hover(function(){
			$JQ(this).find('.img2').eq(0).animate({ opacity:1 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
			$JQ(this).find('.img_lt').eq(0).animate({ opacity:1 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
			$JQ(this).find('.img_rt').eq(0).animate({ opacity:1 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
		},function(){
			$JQ(this).find('.img2').eq(0).animate({ opacity:0 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
			$JQ(this).find('.img_lt').eq(0).animate({ opacity:0 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
			$JQ(this).find('.img_rt').eq(0).animate({ opacity:0 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
		});
		
	}catch(err){ if(jDebugMode==true){ alert('jItemHoverAnimation: ' + err); }}
}
/* =============================== .jMenuAnimation [END] ============================ */
/* =============================== .jReboxA [START] ================================= */
function jReboxA_ClickA0(event){
	try{
		var ID=event.data.ID;
		var Duration=event.data.Duration;
		var Num=event.data.Num;
		var LINKindex=event.data.LINKindex;
		
		
		var elements = $JQ('#'+ID+' .li0');
		var c_ul01;
		
		for(var i=0;i<elements.length;i++){
			c_ul01=$JQ(elements).eq(i).find('.ul01').eq(0);
			if(LINKindex==i){
				c_height=$JQ(c_ul01).height();
				if(c_height==0){
					$JQ(c_ul01).css('height','auto');
					c_height=$JQ(c_ul01).height();
					$JQ(c_ul01).css('height',0);
					$JQ(c_ul01).animate({ height:c_height },{easing:"easeInOutSine",duration:Duration, queue:false, complete:function(){    }});
				}
			}else{
			
				//c_height=$JQ(c_ul01).height();
				//if(c_height>0){ alert(c_height+' - '+i); }
				$JQ(c_ul01).animate({ height:0 },{easing:"easeInOutSine",duration:Duration, queue:false, complete:function(){    }});
			}
		}
		return false;
	}catch(err){ if(jDebugMode==true){ alert('jReboxA: ' + err); }}
}

function jReboxA(ID, Duration, Num){
	try{
		if(!ID || ID==''){ return false; } 
		if(!Duration || Duration==''){ Duration=300; }
		if(!Num || Num==''){ Num==-1; } 
		
		var elements = $JQ('#'+ID+' .li0');
		var c_ul01;
		var c_height=0;
		for(var i=0;i<elements.length;i++){
			c_ul01=$JQ(elements).eq(i).find('.ul01').eq(0);
			$JQ(c_ul01).css('height','auto');
			c_height=$JQ(c_ul01).height();
			$JQ(c_ul01).css('height',0);
			if((Num>=0) && (Num==i)){ $JQ(c_ul01).animate({ height:c_height },{easing:"easeInOutSine",duration:Duration, queue:false, complete:function(){    }}); }
		}
		
		var elements = $JQ('#'+ID+' .a0');
		for(var i=0;i<elements.length;i++){
			$JQ(elements).eq(i).bind("click", {ID:ID, Duration:Duration, Num:Num, LINKindex:i}, jReboxA_ClickA0);
		}
	}catch(err){ if(jDebugMode==true){ alert('jReboxA: ' + err); }}
}
/* =============================== .jReboxA [END] =================================== */
/* =============================== .jReboxB [START] ================================= */
function jReboxB_ClickA0(event){
	try{
		var ID=event.data.ID;
		var Duration=event.data.Duration;
		var Num=event.data.Num;
		var LINKindex=event.data.LINKindex;
		
		
		var elements = $JQ('#'+ID+' .li0');
		var c_ul01;

		for(var i=0;i<elements.length;i++){
			c_ul01=$JQ(elements).eq(i).find('.ul01').eq(0);
			if(LINKindex==i){
				c_height=$JQ(c_ul01).height();
				if(c_height==0){
					$JQ(c_ul01).css('height','auto');
					c_height=$JQ(c_ul01).height();
					$JQ(c_ul01).css('height',0);
					$JQ(c_ul01).stop(true,false).animate({ height:c_height },{easing:"easeInOutSine",duration:Duration, queue:false, complete:function(){    }});
				}else{
					$JQ(c_ul01).stop(true,false).animate({ height:0 },{easing:"easeInOutSine",duration:Duration, queue:false, complete:function(){    }});
				}
			}else{
			
				//c_height=$JQ(c_ul01).height();
				//if(c_height>0){ alert(c_height+' - '+i); }
				$JQ(c_ul01).stop(true,false).animate({ height:0 },{easing:"easeInOutSine",duration:Duration, queue:false, complete:function(){    }});
			}
		}
		return false;
	}catch(err){ if(jDebugMode==true){ alert('jReboxB: ' + err); }}
}

function jReboxB(ID, Duration, Num){
	try{ 
		if(!ID || ID==''){ return false; } 
		if(!Duration || Duration==''){ Duration=300; }
		//if(!Num || Num==''){ Num=-1; } 
		if(typeof(Num)=="undefined" || Num==null){ Num=-1;  } /*Path for Num=0*/
		
		var elements = $JQ('#'+ID+' .li0');
		var c_ul01;
		var c_height=0;
		for(var i=0;i<elements.length;i++){
			c_ul01=$JQ(elements).eq(i).find('.ul01').eq(0);
			$JQ(c_ul01).css('height','auto');
			c_height=$JQ(c_ul01).height();
			$JQ(c_ul01).css('height',0);
			if((Num>=0) && (Num==i)){ $JQ(c_ul01).stop(true,false).animate({ height:c_height },{easing:"easeInOutSine",duration:Duration, queue:false, complete:function(){    }}); }
			
		}
		
		var elements = $JQ('#'+ID+' .a0');
		for(var i=0;i<elements.length;i++){
			$JQ(elements).eq(i).bind("click", {ID:ID, Duration:Duration, Num:Num, LINKindex:i}, jReboxB_ClickA0);
		}
	}catch(err){ if(jDebugMode==true){ alert('jReboxB: ' + err); }}
}
/* =============================== .jReboxB [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,
			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] ============================ */
/* =============================== .single [START] ================================== */
(function($JQ){
	var _sleeptimer;
	$JQ.sleep = function( time2sleep, callback )
	{
		$JQ.sleep._sleeptimer = time2sleep;
		$JQ.sleep._cback = callback;
		$JQ.sleep.timer = setInterval('$JQ.sleep.count()', 1000);
	}
	$JQ.extend ($JQ.sleep, {
		current_i : 1,
		_sleeptimer : 0,
		_cback : null,
		timer : null,
		count : function()
		{
			if ( $JQ.sleep.current_i === $JQ.sleep._sleeptimer )
			{
				clearInterval($JQ.sleep.timer);
				$JQ.sleep._cback.call(this);
			}
			$JQ.sleep.current_i++;
		}
	});
})(jQuery);

function jItemHoverAnimation(Name, Duration){
	try{ 
		if(!Name || Name=='' || Name.length<2){ return false; }
		if(!Duration || Duration==''){ Duration=300; }
		
		switch(Name.charAt(0)){
			case '.': break;
			case '#': break;
			default: Name='#'+Name;
		}
		
		$JQ(Name+' img').css('opacity',0);
		$JQ(Name+' img').css('visibility','visible');
		$JQ(Name+' input').css('opacity',0);
		$JQ(Name+' input').css('visibility','visible');
		
		$JQ(Name).hover(function(){
			$JQ(this).find('img').eq(0).animate({ opacity:1 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
			$JQ(this).find('input').eq(0).animate({ opacity:1 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
		},function(){
			$JQ(this).find('img').eq(0).animate({ opacity:0 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
			$JQ(this).find('input').eq(0).animate({ opacity:0 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
		});
		
	}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(){
			$JQ('#'+Data.IDimg).stop(true,false).animate({ opacity:1 },{easing:"swing",duration:Duration, queue:false, complete:function(){    }});
		},function(){
			$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 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); }}
}




$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] =============================== */
/* ================================================================================== */

