jQuery(document).ready(function($) {
	

	jQuery("#loginredirect").click(function(){	
		var path = window.location.host;
		window.location = "http://" + path + "/customer/account/create/";
	});
	
	/*jQuery(".register-form button").click(function(){
		alert (x);
		if( jQuery("input[name=is_subscribed]:checked").val() == true )	{
			return true;
		} else {
			jQuery("#ask-for-newsletter").dialog({
					resizable: false,
					height:170,
					modal: true,
					buttons: {
						"Newsletter abonnieren": function() {
							jQuery("#is_subscribed").hide();
							jQuery("#is_subscribed").after('<input type="checkbox" id="is_subscribed" value="1" title="In den Newsletter eintragen" name="is_subscribed" checked>');
							jQuery("#is_subscribed").checked = true;
							jQuery( this ).dialog( "close" );
							jQuery(".register-form").submit();
							return true;
							
						},
						"Schließen": function() {
							jQuery(this).dialog("close");
							var x = true;
							return true;
						}
					}
			});
		}
	});*/
	
	jQuery('.product-img-box p img').click(function(){
		var imgsrc = jQuery('.product-img-box p img').attr('src');
		var imgtitle = jQuery('.product-img-box p img').attr('title');
		PopupCenter(imgsrc,imgtitle,800,600);
		
	});
	
	jQuery('.category-products ul.products-grid li.item , .category-products ol.products-list li.item').mouseover(function(){
		jQuery(this).css({'border':'1px solid #479600'});											
	});
	jQuery('.category-products ul.products-grid li.item , .category-products ol.products-list li.item').mouseleave(function(){
		jQuery(this).css({'border':'1px solid #ddd'});											
	});
								
    /*jQuery("#loginredirect").click(function(){
			if(jQuery(".lrgbtn:checked").val() == "register"){
				var path = window.location.host;
				window.location = "http://" + path + "/customer/account/create/";
			}else{
				checkout.setMethod();
			}										
	});*/
	$('#billing-address-select').attr('disabled','disabled');

	startPos = $(".block-cart").position().top;
	$(window).scroll(function (e) {
		scrTop = $(window).scrollTop();
		if ((startPos-5) < scrTop) {
			if ($.browser.msie && $.browser.version <= 6 ) {
				topPos = startPos + (scrTop - startPos) +5;
				$(".block-cart").css("position", "absolute").css("top", topPos +"px").css('zIndex', '500').css('width','200px');
			} else {
				$(".block-cart").css("position", "fixed").css("top", "20px").css("zIndex", "500").css('width','200px');
			}
		} else {
			$(".block-cart").css("position", "static");
		}
	});
	$('#day').keyup(function(){
		if($(this).val().length==2){
			$('#month').focus();
		}
	});
	$('#month').keyup(function(){
		if($(this).val().length==2){
			$('#year').focus();
		}
	});
		
	
	

});
function PopupCenter(pageURL,title,w,h) {
			var left = (screen.width/2)-(w/2);
			var top = (screen.height/2)-(h/2);
			var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);
		} 







