var global = [];

global['win_w'] = jQuery(window).width();
global['win_h'] = jQuery(window).height();

jQuery.fn.collection = function() {
	var $this = jQuery(this);
	var col = [];
	col['item_w'] = $this.find('.item').width();
}

/* For Content scrollers */
jQuery(function() {
	//Global Body min width fixed for IE
	// on Page Load
	if(global['win_w'] <= 980) {
		jQuery('body').css('width', 980);
	}
	
	// on Window Resize
	jQuery(window).resize(function() {
		global['win_w'] = jQuery(window).width();
		if(global['win_w'] <= 980) {
			jQuery('body').css('width', 980);
		}
		else {
			jQuery('body').css('width', 'auto');
		}
	});

	// my wonder script c/o chrissy
	var height = jQuery(window).height();
	
	if (height <= 700)
		jQuery('div.std, div.scroll-pane').css('height', '380px');
		
	jQuery('.scroll-pane').jScrollPane();
	jQuery('.cms-collection .std').removeAttr('style');
});

jQuery(document).ready(function() {
	
	var windowWidth = jQuery(window).width();
	var h = jQuery(window).height();
	
	// Collection
	
	jQuery('#collection').collection();
	resizePage();
	
	jQuery(window).resize(function() {
		var windowWidth = jQuery(window).width();
		if(windowWidth >= 1000){
			
			resizePage();
		}
			
	});

	
   jQuery("#a-login-submit").click(function(){
   
		jQuery("#login-form").submit();
		
   });
   
   jQuery("#a-register-submit").click(function(){
   
		jQuery(".registration-form-ire").submit();
		
   });
});

function resizePage(){
	
	var width = jQuery(window).width();

	jQuery(".wrapper").css("width",  width);

	jQuery('img#back-image').imgscale({
		parent : '.wrapper',
		scale: 'fill',
		center: false, 
		fade: 0
	});
	
	jQuery("#one-page-checkout").css("width", width - 35);
	jQuery("#home-content").css("width", width);
}



