/*
	Copyright (c) 2005 - 2009 Dacon, http://www.dacon.nl
*/
//<![CDATA[
jQuery(function(){
	if(typeof sIFR == "function"){
		 sIFR.replaceElement("h1", named({sFlashSrc: "./inc/swf/sIFR-2.0.7/impact.swf", sColor: "#FFFFFF", sWmode: "transparent"}));
		 sIFR.replaceElement("h2", named({sFlashSrc: "./inc/swf/sIFR-2.0.7/impact.swf", sColor: "#CC0000", sCase: "upper", sWmode: "transparent"}));
	 	 sIFR.replaceElement(".column h3", named({sFlashSrc: "./inc/swf/sIFR-2.0.7/impact.swf", sColor: "#FFFFFF", sWmode: "transparent"}));
	 	 sIFR.replaceElement("#header h3", named({sFlashSrc: "./inc/swf/sIFR-2.0.7/impact.swf", sColor: "#FFFFFF", sWmode: "transparent", sFlashVars: "textalign=right"}));
	 	 sIFR.replaceElement("#menu h4", named({sFlashSrc: "./inc/swf/sIFR-2.0.7/impact.swf", sColor: "#FFFFFF", sWmode: "transparent", sFlashVars: "textalign=right&underline=true"}));
	 	 sIFR.replaceElement(".column h4", named({sFlashSrc: "./inc/swf/sIFR-2.0.7/impact.swf", sColor: "#FFFFFF",sBgColor: "#333333",  sFlashVars: ""}));
	};

	
	$('.menu_item').mouseover(function(){
		$(this).animate({
			paddingTop:'0px'
		},'fast');
	});
	
	$('.menu_item').mouseout(function(){
		$(this).stop().animate({
			paddingTop:'25px'
		},'fast');
	});
	
	//var currentTime = new Date()
	//new swfobject.embedSWF("inc/swf/PolaroidFlashGallery/polaroid.swf?"+currentTime, "fullscreendemo", "50%", "50%", "8", "",{bgcolor: "#666666", xmlURL:"http://www.awkidswear.com/inc/swf/PolaroidFlashGallery/photos.xml"}, { menu: "false"});

        $('#fullscreendemo').text('Loading...');

        $.get('inc/swf/PolaroidFlashGallery/photos.xml', function(data){

            $('#fullscreendemo').text('');
            nr = 0;

            $(data).find('photo').each(function(i){
			
               // strip path
               parts = $(this).attr('url').split('/');
               parts.reverse();		

               $('#fullscreendemo').append('<div class="photoHolder"><div class="photo" style="background-image:url(\'photo.php?src=http://www.awkidswear.com/cms/upload/' + parts[0] + '&h=152&w=152&zc=1\')"><a class="photoLink" rel="group" href="' + $(this).attr('url') + '" title="' + $(this).attr('desc') + '">&nbsp;</a></div>' + $(this).attr('desc') + '</div>');

               if($('#fullscreendemo').parent().attr('id') === 'column_right'){
                  if(i%2 === 1){
                      $('.photoHolder:last').addClass('last');
                  }
               }
                /*
               // calc max size 130 x 130 px
               $p = $('#photo' + nr)
               // check if this is not an alt message
               if($p.height() === 14){
                  $p.parent().remove();
               }
               else{
                   if($p.width() > $p.height()){
                       $p.width(130);
                       $p.height( Math.round(( 130 / $p.width() ) * $p.height()) );
                   }
                   else{
                       $p.height(130);
                       $p.width( Math.round(( 130 / $p.height() ) * $p.width()) );
                   }
               }

               if($('#fullscreendemo').parent().attr('id') === 'column_right'){
                  if(nr%2 === 1){

                  }
               }

               nr++;*/
            });

            $('.photoLink').fancybox({
                'onStart'			:	function(){
                    $("#column_left > *").css({
                        'display'	:	'none',
                    });
                },
                'onClosed'			: 	function(){
                    $("#column_left > *").css({
                        'display'	:	'block'
                    });
                }
            });
            
        }, 'xml');


	$('#showroom').fancybox({type:'iframe', width: $(window).width() - 100, height: $(window).height() - 100});
})
//]]>
