/* CSS fixes to IE @2007 */

function shoppingcart() {
	
	
	// focus effects for MSIE browsers
	if($.browser.msie){
		$('input[@type="text"], input[@type="password"]').focus(function(){ $(this).addClass('focus'); });
		$('input[@type="text"], input[@type="password"]').blur(function(){ $(this).removeClass('focus'); });
	
		/* iE7 is to dummy to support properly even this...
		$('select').focus(function(){ $(this).addClass('focus'); });
		$('select').blur(function(){ $(this).removeClass('focus'); });
		*/
		$('textarea').focus(function(){ $(this).addClass('focus'); });
		$('textarea').blur(function(){ $(this).removeClass('focus'); });
	}


	// terms & conditions on checkout review &buy step
	// terms & cond. should be hide by default if JS is supported by browser
	$('#terms_text').hide();
	// on click event on #show_terms terms() function is bind
	$('#show_terms').bind('click',terms);
	// supporting MSIE browser to hover not a element, by setting hover event for span
	$('#show_terms').hover(function(){
		$(this).addClass('hovertag');
	},function(){
		$(this).removeClass('hovertag');
	});

	
	function terms(){
		// get alt logo as a header for terms & cond.
		var CartTitle = $('#logo img').attr('alt');
		// show terms & cond. layer and prepend header into it
		$('#header').remove();
		// safari bug???
		$('#terms_text').prependTo('#holder');
		$('#terms_text').show();
		$('#terms_text').prepend('<div id="header"><div class="nw"></div><h3>'+CartTitle+'<span id="close"></span></h3></div>');
		
		// bind a function to remove the header and hide terms & cond. lyear
		// when click on span in header h3
		$('#terms_text #close').click(function(){ $('#terms_text').hide(); $('#terms_text #header').remove();});
	}
		
}
$(document).ready(shoppingcart);