﻿/*
 * jQuery ixcore 1.0.1
 *
 * Copyright (c) 2009 ixcore.corp.
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * jQuery ixcore Utilities
 *
 * Depends:
 *	ixcore.utilities.js
 */(function($){$.fn.emptySelect=function(){return this.each(function(){if(this.tagName=='SELECT')this.options.length=0})};$.fn.loadSelect=function(optionsDataArray){return this.emptySelect().each(function(){if(this.tagName=='SELECT'){var selectElement=this;$.each(optionsDataArray,function(index,optionData){var option=new Option(optionData.name,optionData.value);if(!($.support.noCloneEvent)){selectElement.add(option)}else{selectElement.add(option,null)}})}})}})(jQuery);/*
 * jQuery ixcore fancyzoom
 *
 * Copyright (c) 2009
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * Depends:
 *	ixcore.fancyzoom.js
 */(function($){$.fn.fancyzoom=function(options){var settings=$.extend({targetImageId:'ixcore_fancyzoom_image',loadingImageUrl:'/js/jquery/resource/fancyzoom/images/loading.gif',loadingImageId:'ixcore_fancyzoom_loading'},options||{});var thumbnails=this.filter('a[href$=.jpg]:has(img),a[href$=.gif]:has(img),a[href$=.png]:has(img)');return thumbnails.each(function(){$(this).click(function(event){var $this=$(this);var source=$('img',$this).eq(0);var $document=$(window);$('#'+settings.targetImageId+'').click();$('<img id="'+settings.loadingImageId+'" src="'+settings.loadingImageUrl+'" />').css({position:'absolute',zIndex:999999}).hide().appendTo('body');var $loding=$('#'+settings.loadingImageId+'');$loding.css({top:(event.pageY-($loding.height()/2)),left:(event.pageX-($loding.width()/2))}).show();$('<img id="'+settings.targetImageId+'" />').hide().bind('load',function(event){$loding.remove();var $this=$(this);var x=$document.width();var y=$document.height();var imageWidth=$this.width();var imageHeight=$this.height();if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x;if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y}}else if(imageHeight>y){imageWidth=imageWidth*(y/imageHeight);imageHeight=y;if(imageWidth>x){imageHeight=imageHeight*(x/imageWidth);imageWidth=x}}$this.css({opacity:0,top:source.offset().top,left:source.offset().left,width:source.width(),height:source.height()});$this.animate({opacity:1,top:(y/2)-(imageHeight/2)+$document.scrollTop(),left:(x/2)-(imageWidth/2)+$document.scrollLeft(),width:imageWidth,height:imageHeight},'slow')}).bind('click',function(event){$(this).animate({opacity:0,top:source.offset().top,left:source.offset().left,width:source.width(),height:source.height()},'slow',function(){$(this).remove()})}).appendTo('body').css({position:'absolute',zIndex:999998,cursor:'pointer'}).attr('src',$(this).attr('href'));return false})})}})(jQuery);
