
function convertColorToHex(rgbString) {
	var parts = rgbString.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
	// parts now should be ["rgb(0, 70, 255", "0", "70", "255"]

	delete (parts[0]);
	for (var i = 1; i <= 3; ++i) {
		parts[i] = parseInt(parts[i]).toString(16);
		if (parts[i].length == 1) parts[i] = '0' + parts[i];
	}
	return "#" + parts.join(''); // "0070ff"
}
jQuery(document).ready(function() {
		
		//ifixpng
		jQuery('img').ifixpng();
		
		//sifr
		if (sifrEnable) {
			if(typeof sIFR == "function"){
				$(".sifr").each(function(index){
					var params = new Object();
					params.sFlashSrc = "/flash/sifr.swf";
					params.sWmode = "transparent";
					params.sColor = convertColorToHex($(this).css("color"));
					if ($(this).css("text-transform").toLowerCase() == "uppercase") {
						params.sCase = "upper";
					} else if ($(this).css("text-transform").toLowerCase() == "lowercase") {
						params.sCase = "lower";
					}

					$(this).addClass("sifr" + index);
					sIFR.replaceElement((".sifr" + index), named(params));
				});
			};
		}

		//prettyPhoto
		jQuery("a[rel^='prettyPhoto']").prettyPhoto({
		    markup:'<div class="pp_pic_holder"> \
      <div class="pp_top"> \
       <div class="pp_left"></div> \
       <div class="pp_middle"></div> \
       <div class="pp_right"></div> \
      </div> \
      <div class="pp_content_container"> \
       <div class="pp_left"> \
       <div class="pp_right"> \
        <div class="pp_content"> \
         <div class="pp_loaderIcon"></div> \
         <div class="pp_fade"> \
          <a href="#" class="pp_expand" title="Expand the image">Expand</a> \
          <div class="pp_hoverContainer"> \
           <a class="pp_next" href="#">next</a> \
           <a class="pp_previous" href="#">previous</a> \
          </div> \
          <div id="pp_full_res"></div> \
          <div class="pp_details clearfix"> \
           <a class="pp_downloadImg" href="#" target="_blank">Download</a> \
           <a class="pp_close" href="#">Close</a> \
           <div class="pp_nav"> \
            <a href="#" class="pp_arrow_previous">Previous</a> \
            <p class="currentTextHolder">0/0</p> \
            <a href="#" class="pp_arrow_next">Next</a> \
           </div> \
          </div> \
         </div> \
        </div> \
       </div> \
       </div> \
      </div> \
      <div class="pp_bottom"> \
       <div class="pp_left"></div> \
       <div class="pp_middle"></div> \
       <div class="pp_right"></div> \
      </div> \
     </div> \
     <div class="pp_overlay"></div> \
     <div class="ppt"></div>',
		    changepicturecallback: function() {
		        if ($('#pp_full_res') != undefined) {
		            var imgUrl = $('#pp_full_res img').attr("src");
		            if (imgUrl != undefined) {
		                $(".pp_downloadImg")
		                    .show()
		                    .attr("href", imgUrl);
		            } else {
		                $(".pp_downloadImg")
		                    .hide();
		            }
		        } else {
		            $(".pp_downloadImg")
		                .hide();
		        }
		    }
		});
		
		//prettyPopin 600x450
		jQuery("a[rel^='prettyPopin600x450']").prettyPopin({
			modal: false, /* true/false */
			width: 600, /* true/false */
			height: 450, /* true/false */
			opacity: 0.5, /* value from 0 to 1 */
			animationSpeed: 'fast' /* slow/medium/fast */
		});
		
		
		//prettyPopin 400x300
		jQuery("a[rel^='prettyPopin400x300']").prettyPopin({
			modal: false, /* true/false */
			width: 400, /* true/false */
			height: 300, /* true/false */
			opacity: 0.5, /* value from 0 to 1 */
			animationSpeed: 'fast' /* slow/medium/fast */
		});
		
		//prettyPopin 500x600
		jQuery("a[rel^='prettyPopin400x600']").prettyPopin({
			modal: false, /* true/false */
			width: 500, /* true/false */
			height: 600, /* true/false */
			opacity: 0.5, /* value from 0 to 1 */
			animationSpeed: 'fast' /* slow/medium/fast */
		});
		
		
		//prettyHack
		jQuery("select.prettyHack730x1000").prettyPopinHack({
			modal: false, /* true/false */
			width: 730, /* true/false */
			height: 1000, /* true/false */
			opacity: 0.5, /* value from 0 to 1 */
			animationSpeed: 'fast' /* slow/medium/fast */
		});

		
	//swfobject
	function embedswfobject(swf,divId, width, height, ver ,atuoupdate ,flashVars,params,attributes) {
		swfobject.embedSWF(swf,divId, width, height, ver ,atuoupdate ,flashVars,params,attributes) ;	
	}



	
});


