/*
 * Couponmonkey // Main JS
 * 
 * This file contains all required functions and configurations
 * for the Couponmonkey website.
 *
 * Copyright 2008 Stefan Heckler
 * 
 * @author: Stefan Heckler
 * @version: $Id: cm.js 71 2009-10-03 00:39:02Z jh $
 */

// general configuration
var cmConfig = new Array();
	
	// url definitions
	cmConfig['baseurl'] = '/';
	cmConfig['mediaurl'] = cmConfig['baseurl']+'media/';
 

/*
 * sIFR configuration
 * 
 * We replace all h1 and h2 tags on the website with "Georgia Italic"
 * h1-Element on rootpage has various fontsize
 */
  
var sIFRUnivers = {
	src: cmConfig['mediaurl']+'font/univers.swf'
};

sIFR.activate(sIFRUnivers);

sIFR.replace(sIFRUnivers,
	{
		selector: '.MainCol h2',
		css: [
			'.sIFR-root { font-size: 20px; color: #ffffff; letter-spacing: 0.3; }',
			'a { color: #ffffff; text-decoration: none; }',
			'a:hover { color: #ffffff; }'
		],
		// fine tuning
		wmode: 'transparent'
	}
);

sIFR.replace(sIFRUnivers,
	{
		selector: '.HomeDesc h3',
		css: [
			'.sIFR-root { font-size: 20px; color: #fd7402; letter-spacing: 0.3; }',
			'a { color: #fd7402; text-decoration: none; }',
			'a:hover { color: #fd7402; }'
		],
		// fine tuning
		wmode: 'transparent'
	}
);

sIFR.replace(sIFRUnivers,
	{
		selector: '.LeftCol h2',
		css: [
			'.sIFR-root { font-size: 17px; color: #fd7402; letter-spacing: 0.3; }',
			'a { color: #fd7402; text-decoration: none; }',
			'a:hover { color: #fd7402; }'
		],
		// fine tuning
		wmode: 'transparent'
	}
);


$(document).ready(function() {
	
	
	
	$(".CouponContainer .CouponListShopLink").each(function(){
		
		available_height = $(this).parent("div.CouponContainer").height();
		own_height = $(this).height();
		padding = (available_height - 10 - own_height)/2;
		
		$(this).css('padding-top', padding +'px');

	});
		
	$(".CouponContainer .RoundButton.RedeemVoucher").each(function(){
		
		available_height = $(this).parent("div.CouponContainer").height() - 18; // h3.height = 18px
		own_height = $(this).height();
		padding = (available_height - 10 - own_height)/2 - 9; // 9 = h3.height / 2
		
		$(this).css('margin-top', padding +'px');

	});
	
	
	
	$(".ShopAlternativeRedirect .ShopLink").click(function(){
				
		$(".ShopAlternativeRedirect .CouponCode").css('visibility', 'visible');
		$(".ShopAlternativeRedirect .CouponCode").css('float', 'none');
		$(".ShopAlternativeRedirect .CouponCodeNote").remove();

		return true;
	});
	
    $(".LeftCol input#sword").focus(
        function(){
            if($(this).val() == 'Suchbegriff ...') $(this).val('');
        }
    );
    $(".LeftCol input#sword").blur(
        function(){
            if($(this).val() == '') $(this).val('Suchbegriff ...');
        }
    );

});
