(function(jQuery) { jQuery.System_Colors = _system_colors = { aqua: [0, 255, 255], azure: [240, 255, 255], beige: [245, 245, 220], black: [0, 0, 0], blue: [0, 0, 255], brown: [165, 42, 42], cyan: [0, 255, 255], darkblue: [0, 0, 139], darkcyan: [0, 139, 139], darkgrey: [169, 169, 169], darkgreen: [0, 100, 0], darkkhaki: [189, 183, 107], darkmagenta: [139, 0, 139], darkolivegreen: [85, 107, 47], darkorange: [255, 140, 0], darkorchid: [153, 50, 204], darkred: [139, 0, 0], darksalmon: [233, 150, 122], darkviolet: [148, 0, 211], fuchsia: [255, 0, 255], gold: [255, 215, 0], green: [0, 128, 0], indigo: [75, 0, 130], khaki: [240, 230, 140], lightblue: [173, 216, 230], lightcyan: [224, 255, 255], lightgreen: [144, 238, 144], lightgrey: [211, 211, 211], lightpink: [255, 182, 193], lightyellow: [255, 255, 224], lime: [0, 255, 0], magenta: [255, 0, 255], maroon: [128, 0, 0], navy: [0, 0, 128], olive: [128, 128, 0], orange: [255, 165, 0], pink: [255, 192, 203], purple: [128, 0, 128], violet: [128, 0, 128], red: [255, 0, 0], silver: [192, 192, 192], white: [255, 255, 255], yellow: [255, 255, 0] }; jQuery.get_RGB = function(color) { var result = null; try { if (color && color.constructor == Array && color.length == 3) return color; if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color)) return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color)) return [parseFloat(result[1]) * 2.55, parseFloat(result[2]) * 2.55, parseFloat(result[3]) * 2.55]; if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) return [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)]; if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) return [parseInt(result[1] + result[1], 16), parseInt(result[2] + result[2], 16), parseInt(result[3] + result[3], 16)]; return _system_colors[jQuery.trim(color).toLowerCase()]; } catch (e) { } return result; }; WebForms_Ajax_Fix = function() { try { var pm = Sys.WebForms.PageRequestManager.getInstance(); if (typeof (pm) != 'undefined' && typeof (window.jQuery) != 'undefined') { window.jQuery._readyList = null; if (typeof (window.jQuery.readyList) != 'undefined') { window.jQuery._readyList = []; for (i in window.jQuery.readyList) if (typeof (window.jQuery.readyList) == 'function') window.jQuery._readyList[window.jQuery._readyList.length] = window.jQuery.readyList[i]; } if (typeof (pm.add_pageLoaded) == 'function') { var handler = Function.createDelegate(this, function() { if (pm && pm._postBackSettings) { if (typeof (window.jQuery) != 'undefined') { jQuery.isReady = false; if (window.jQuery._readyList) window.jQuery.readyList = window.jQuery._readyList; window.jQuery.ready(); } } }); pm.add_pageLoaded(handler); } } } catch (e) { } }; jQuery(function() { WebForms_Ajax_Fix(); }); animation_fix_helper = function(i, v) { if (window.jQuery) { window.jQuery.fx.step[v] = function(fx) { if (fx.state == 0) { fx.start = window.jQuery.StyleColor(fx.elem, v); fx.end = window.jQuery.get_RGB(fx.end); } if (typeof (fx.start) != 'undefined' && typeof (fx.end) != 'undefined' && fx.start.length == 3 && fx.end.length == 3) { fx.elem.style[v] = 'rgb(' + [Math.max(Math.min(parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0), Math.max(Math.min(parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0), Math.max(Math.min(parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)].join(',') + ')'; } } } }; animation_fix = function() { var temp = ['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor']; window.jQuery.each(temp, animation_fix_helper); }; animation_fix(); ; jQuery.StyleColor = function(element, attr) { var color; do { color = jQuery.curCSS(element, attr); if (color != '' && color != 'transparent' || jQuery.nodeName(element, "body")) break; attr = "backgroundColor"; } while (element = element.parentNode); return jQuery.get_RGB(color); }; jQuery.AllStyles = function(obj) { var o = {}; if (typeof (obj) != 'undefined' && typeof (obj.style) != 'undefined') { for (index in obj.style) { o[index] = obj.style[index]; } } return o; }; _innerProperties = function(obj) { var list = []; for (name in obj) { try { if (typeof (obj[name]) != 'undefined' && name.toLowerCase() != 'innerhtml' && name.toLowerCase() != 'outerhtml') list.push(name); } catch (e) { } } list.sort(); var result = ''; try { result += ''; } catch (e) { result += (e.message); } return result; }; jQuery.Properties = function(obj, recursive) { if (typeof (obj) == 'undefined' || !obj) return false; if (arguments.length < 2) recursive = false; var list = []; for (name in obj) { try { if (typeof (obj[name]) != 'undefined' && name.toLowerCase() != 'innerhtml' && name.toLowerCase() != 'outerhtml') list.push(name); } catch (e) { } } list.sort(); var result = 'jQuery'; try { result += ''; } catch (e) { result += (e.message); } result += ''; var id = '_'; var dt = new Date(); id = id + dt.getMilliseconds().toString(); var w = window.open('about:blank', id); if (w && w.window && w.window.document) w.window.document.writeln(result); return obj; }; jQuery.ScrollBarWidth = function() { var div = window.jQuery('
'); window.jQuery('body').append(div); var w1 = window.jQuery('div', div).innerWidth(); div.css('overflow-y', 'scroll'); var w2 = jQuery('div', div).innerWidth(); window.jQuery(div).remove(); return (w1 - w2); }; jQuery.KillEvent = function(evt) { if (typeof (evt) != 'undefined') { if (evt.preventDefault) evt.preventDefault(); if (evt.stopPropagation) evt.stopPropagation(); if (evt.returnValue) evt.returnValue = false; if (evt.cancelBubble) evt.cancelBubble = true; } } })(jQuery); window.jQuery.fn.extend({ AllStyles: function() { if (this.length == 1) { return window.jQuery.AllStyles(this[0]); } return null; }, StyleColor: function(name) { if (this.length == 1) { return window.jQuery.StyleColor(this[0], name); } return null; } }); (function(jQuery) { jQuery.extend({ SGInstances: [] }); function _ScrollGallery(obj) { this.Format = ''; this.ReferenceId = obj.ReferenceId; this.isPreLoaded = false; this.preLoadIndex = 0; obj = this.FixConfig(obj); this.TImageWidth = obj.TImageWidth; this.TImageHeight = obj.TImageHeight; this.ImageWidth = obj.ImageWidth; this.ImageHeight = obj.ImageHeight; this.MessageBackColor = obj.MessageBackColor; this.MessageColor = obj.MessageColor; this.Images = obj.Images; this.Container = jQuery('#' + obj.ReferenceId); this.NoImageText = obj.NoImageText; this.SelectImageText = obj.SelectImageText; this.ResizeValue = obj.ResizeValue; this.ResizeValue_Regex = new RegExp('([?]|[&])RESIM_ORAN=' + this.ResizeValue); for (i in this.Images) { i = parseInt(i); var _img = document.createElement('img'); _img = window.jQuery(_img); _img.attr('id', 'load_i_' + i).css('display', 'none'); _img.load(function() { }); var _src = this.Images[i][0]; _src = _src.replace(this.ResizeValue_Regex, ''); _img.attr('src', _src); } this.isPreLoaded = true; if (this.Container.length == 1) this.SetupGallery(); }; _ScrollGallery.prototype = { SetupGallery: function() { if (this.Images.length == 0) { this.Container.empty().append(this.NoImageText); return false; } this.Container.addClass('ScrollGallery'); var html = '
{selecttext}
'; html = html.replace(/\{imagewidth\}/, this.ImageWidth).replace(/\{imageheight\}/, this.ImageHeight).replace('{selecttext}', this.SelectImageText); var _is = ''; for (i in this.Images) { i = parseInt(i); _is = this.Format; var tmp = this.Images[i][0]; tmp += (tmp.indexOf('?') > -1) ? '&' : '?'; tmp += 'RESIM_ORAN=' + this.ResizeValue; _is = _is.replace('{imagesource}', tmp); _is = _is.replace('{imageid}', '{referenceid}_i_' + (i + 1)); html += _is; } html += '
'; html = html.replace(/\{timageheight\}/g, this.TImageHeight).replace(/\{timagewidth\}/g, this.TImageWidth).replace(/\{referenceid\}/g, this.ReferenceId); this.Container = jQuery('#' + this.ReferenceId); this.Container.data('SG', this); this.Container.html(html); this.ThumbContainer = jQuery('#' + this.ReferenceId + '_thumb'); this.ThumbContainer.css('width', this.ImageWidth); this.ThumbContainer.mouseout(function() { jQuery(this).find('img').each(function() { jQuery(this).css('opacity', 0.33); }); }); this.ThumbContainer.find('img').data('thisobject', this).data('clickfunction', this.ImageClick).click(function() { (jQuery(this).data('clickfunction')).call(this); }).each(function(i) { var img = jQuery(this); img.data('imageindex', parseInt(i)).css('opacity', 0.33).hover(function() { img.css('opacity', 1); }, function() { img.css('opacity', 0.33); }); }); if (jQuery.browser) { var v = jQuery.browser.version[0]; if (!isNaN(v)) { v = parseInt(v); if (jQuery.browser.msie) { var extraHeightForScroll = jQuery.ScrollBarWidth(); this.ThumbContainer.css('height', this.ThumbContainer.height() + extraHeightForScroll + 10); } } } var sw = this.Images.length * this.TImageWidth; if (sw > this.ImageWidth) this.ThumbContainer.animate({ scrollLeft: (sw) }, 1001, 'linear', function() { jQuery(this).animate({ scrollLeft: 0 }, 555); }); this.ImageContainer = jQuery('#' + this.ReferenceId + '_Image'); this.ImageContainer.css('position', 'relative'); }, ImageClick: function() { var image = jQuery(this); var oThis = image.data('thisobject'); if (typeof (oThis) !== undefined) { oThis.ImageContainer.children('img').stop(); var image2 = image.clone(); var _src = image2.attr('src'); _src = _src.replace(oThis.ResizeValue_Regex, ''); image2.attr('src', _src); data = null; if (typeof (image.data('imageindex')) !== undefined) { var data = oThis.Images[image.data('imageindex')][1]; } var top = 0 + (oThis.ImageHeight / 2); var lef = 0 + (oThis.ImageWidth / 2); image2.css({ opacity: 1, cursor: 'default', left: lef, top: top, width: 10, height: 10, position: 'relative', opacity: 0.01, zIndex: 1 }); oThis.ImageContainer.empty().append(image2); image2.animate({ width: oThis.ImageWidth, height: oThis.ImageHeight, top: 0, left: 0, opacity: 1 }, 1000, 'linear', function() { if (data) { var info = '
' + data + '
'; oThis.ImageContainer.append(info); info = jQuery('#' + image.attr('id') + '_info'); if (info.length == 1) { info.hide().css({ position: 'relative', left: 0, width: oThis.ImageWidth, zIndex: 2, backgroundColor: oThis.MessageBackColor, opacity: 0.66, cursor: 'default', color: oThis.MessageColor }); var h = info.height(); h = image2.position().top - h; info.css({ top: h }); image2.attr('alt', info.text()).attr('title', info.text()); info.slideDown(1000, null); info.dblclick(function() { jQuery(this).slideUp(222); }); } } }); }; }, FixConfig: function(obj) { if (obj === undefined) obj = {}; var defaults = { TImageWidth: 120, TImageHeight: 100, ImageWidth: 400, ImageHeight: 300, MessageBackColor: '#FFFFCC', MessageColor: '#000000', Images: [], ReferenceId: '', NoImageText: 'Resim sayısı = 0
Image count = 0', SelectImageText: 'Lütfen resim seçiniz!
Please select image!', ResizeValue: -80 }; for (name in defaults) { if (obj[name] === undefined) obj[name] = defaults[name]; } return obj; } }; jQuery.scrollgallery = function(obj) { if (typeof (obj) !== undefined) { if (typeof (obj) == 'string') { for (i in this.SGInstances) { if (typeof (this.SGInstances[i][0]) !== undefined && this.SGInstances[i][0] === obj) return this.SGInstances[i][1]; } } else { if (typeof (obj) == 'object') { if (typeof (obj.ReferenceId) !== undefined) { if (jQuery('#' + obj.ReferenceId).length == 1) { var ng = new _ScrollGallery(obj); var instance = { 0: obj.ReferenceId, 1: ng }; this.SGInstances[this.SGInstances.length] = instance; return ng; } } } } } }; jQuery.extend({ ScrollGallery: function(obj) { return this.scrollgallery(obj); } }); })(window.jQuery)