// ********** Chris horisontal resizer
// ********** Optimum-Web
(function($){
jQuery.fn.ch_card = function(opt) {
	  return this.each(function() {        
            new j_ch_card_class(this, opt);
      });
}
var defaults = {	
	css_class:'',
	container:''
};
jQuery.ch_card_class = function(el,opt){	
	this.options = jQuery.extend({}, defaults, opt || {});
	var self = this;
	var container =el;
	var left=jQuery(el).parent().offset().left;
	jQuery(el).css({"left":left+"px"});
	
	var start_top_pos = ( (window.location.href.indexOf('index.html')!=-1) || (window.location.href.lastIndexOf('/') == window.location.href.length - 1))?843:443;//jQuery(el).position().top; //|| window.location.href.indexOf('.html')==-1
	jQuery(window).scroll(function(){
		refreshTopPosition();						   
	});	
	function refreshTopPosition(){
		var top_pos =start_top_pos - jQuery(document).scrollTop();
		if(top_pos<30)top_pos = 30;
		//jQuery(container ).animate({'top':top_pos+'px'},100,'linear');
		jQuery(container ).css({'top':top_pos+'px'});	
	}
	refreshTopPosition();
}
var j_ch_card_class = jQuery.ch_card_class;
})(jQuery);


(function($){
jQuery.fn.ch_card_new = function(opt) {
	  return this.each(function() {        
            new j_ch_card_class_new(this, opt);
      });
}
var defaults = {	
	css_class:'',
	container:''
};
jQuery.ch_card_class_new = function(el,opt){	
	this.options = jQuery.extend({}, defaults, opt || {});
	var self = this;
	var container =el;
	var start_top_pos = 443;//jQuery(el).position().top;
	jQuery(window).scroll(function(){
		refreshTopPosition();						   
	});	
	function refreshTopPosition(){
		var top_pos =start_top_pos - jQuery(document).scrollTop();
		if(top_pos<30)top_pos = 30;
		//jQuery(container ).animate({'top':top_pos+'px'},100,'linear');
		jQuery(container ).css({'top':top_pos+'px !important'});	
	}
	refreshTopPosition();
}
var j_ch_card_class_new = jQuery.ch_card_class_new;
})(jQuery);

