jQuery.noConflict(); 

function showResetPasswordForm()
{
	jQuery('.mod_lostPassword').fadeIn();
}

function set_nav(id)
{
	jQuery('#reseller_ad_nav .ce_text').removeClass('active'); 
	jQuery('#reseller_ad_nav #' + id).addClass('active');
	jQuery('#reseller_ad_nav .active').corner();
}

jQuery.fn.innerWrap = function() {
	var a, args = arguments;
	return this.each(function() {
		if (!a)
			a = jQuery.clean(args, this.ownerDocument);
		// Clone the structure that were using to wrap
		var b = a[0].cloneNode(true),
		    c = b;
		// Find the deepest point in the wrap structure
		while ( b.firstChild )
			b = b.firstChild;
		// append the child nodes to the wrapper
		jQuery.each(this.childNodes, function(i, node) { 
			b.appendChild(node); 
		});
		jQuery(this)
			// clear the element
			.empty()
			// add the new wrapper with the previous child nodes appended
			.append(c);
	});
};


jQuery(document).ready(function() {
	
	/*	Newsletter sign-up */
	if(jQuery('.mod_subscribe #ctrl_email').val() == '')
	{
		jQuery('.mod_subscribe #ctrl_email').val('E-Mail-Adresse');
		jQuery('.mod_subscribe #ctrl_email').click(function() {
			if(jQuery('.mod_subscribe #ctrl_email').val() == 'E-Mail-Adresse')
				jQuery('.mod_subscribe #ctrl_email').val('');
		});
		jQuery('.mod_subscribe #ctrl_email').focusout(function() {
			if(jQuery('.mod_subscribe #ctrl_email').val() == '')
				jQuery('.mod_subscribe #ctrl_email').val('E-Mail-Adresse');
		});
	}
	
	jQuery('.hl_headlines h2').innerWrap('<span></span>');
	jQuery('.mod_lostPassword').hide();
	
	
	/*	Set order button url */
	jQuery('.product_box .order_btn a').click(function() { 
		var select_box = jQuery(this).parents('.product_box').find('.product_variant');
		var btn_link = jQuery(this).attr('href').split(': ')[0];
		this.href = btn_link + ': ' + select_box.val();
	});
	
	jQuery('.product_box .product_variant').change(function() { 
		var btn = jQuery(this).parents('.product_box').find('.order_btn a');
		var btn_link = btn.attr('href').split(': ')[0];
		btn.attr('href', btn_link + ': ' + jQuery(this).val());
	});
	
});
