﻿; var vietad_config = [6, 1, 10000, "http://banner.vietad.vn/Ad.aspx", "http://logb.vietad.vn/clickbanner.aspx", -1, -1, -1, "sa"]; var boutputstr = ""; var $vaddomain = "http://embed.vietad.vn/"; var $bud = "undefined"; var $bif = (self.location != top.location); var $bof = false; var $bmw = R2(); var $bus = O(); var $bmd = $bmw.document; var $bcu = null; var $burl = ""; var A = null; var B = vietad_config; var bss = false; var IE6 = (navigator.appVersion.indexOf('MSIE 6.0') == -1) ? false : true; var $isBallonAdLoaded = false; var $timeOut = 300; var _ballonAds = null; var $traverseTimer = null; var $zoneType = null; var C = { w: { n: ["vietad_width"], i: [], e: [] }, h: { n: ["vietad_height"], i: [], e: [] }, sz: { n: ["vietad_sizeId"], i: [], e: [] }, i: { n: ["vietad_zoneId"], i: [], e: [] }, t: { n: ["vietad_typeId"], i: [], e: [] }, tc: { n: ["vietad_titleColor"], i: [], e: [] }, dc: { n: ["vietad_desColor"], i: [], e: [] }, bgc: { n: ["vietad_bgColor"], i: [], e: [] }, bdc: { n: ["vietad_borderColor"], i: [], e: [] }, lc: { n: ["vietad_linkColor"], i: [], e: [] }, cid: { n: ["vietad_containerid"], i: [], e: [] }, flt: { n: ["vietad_underfilter"], i: [], e: [] }, tlul: { n: ["vietad_underline"], i: [], e: [] }, zt: { n: ["vietad_zoneType"], i: [], e: []} }; var D = N("i"); function R2() { try { var cx = top.document.location; return top; } catch (err) { $bof = true; } var cwd = window; while (cwd != cwd.parent) { var cp = cwd.parent; try { var cx = cp.document.location; } catch (err) { return cwd; } cwd = cp; } return cwd; } function O() { if (!$bmw.vietad_adunits) { $bmw.vietad_adunits = []; } return $bmw.vietad_adunits; } function G() { var cw = window; var csz = { "1": [760, 90], "2": [468, 60], "3": [728, 90], "4": [950, 90], "5": [658, 60], "6": [120, 60], "7": [250, 60], "8": [120, 600], "9": [120, 240], "10": [160, 600], "11": [180, 250], "12": [250, 300], "13": [360, 190], "14": [250, 250], "15": [200, 200], "16": [336, 280], "17": [300, 250], "18": [290, 200], "19": [100, 100] }; g($bmw, B[8]); d(); } function g(cw, cf) { var ct = new Date(); var cs = ct.getTime(); L(cw); (!cw.vietad_data[cf]) ? cw.vietad_data[cf] = 1 : cw.vietad_data[cf]++; cw.vietad_data.t = cs; } function L(cw) { if (!cw.vietad_data) { cw.vietad_data = {}; } } function d() { var ct = new Date(); var cs = ct.getTime(); var cu = {}; cu.w = window; cu.zid = D; cu.t = cs; cu.zt = N('zt'); cu.tp = N('t'); cu.sz = N("sz"); cu.width = N('w'); cu.height = N('h'); cu.tc = N('tc'); cu.dc = N('dc'); cu.bgc = N('bgc'); cu.bdc = N('bdc'); cu.lc = N('lc'); cu.zt = N('zt'); if (!$bus[D]) { $bus[D] = []; } $bus[D].push(cu); $bcu = cu; } function V() { var ct = new Date(); var cs = ct.getTime(); var cr = true; var cw = window; var cl = $bus[D].length; if (cl > B[1]) { cr = false; } cl = $bus.length; if (cl > B[0]) { return false; } if ($bif) { cr = true; } return cr; } function N(ck) { var cr = null; var co = C[ck]; var cw = window; for (var i = 0; i < co.n.length; i++) { if (cw[co.n[i]]) { cr = cw[co.n[i]]; break; } } return cr; } function T(cs) { if (typeof encodeURIComponent == "function") { return encodeURIComponent(cs.toString()); } else { return S(cs.toString()); } } function p(ck, cv) { if (!ck || ck == "") return; if (!cv) cv = ""; $burl = $burl + "&" + ck + "=" + cv; } function o(ck) { p(ck, N(ck)); } function b() { var cr = R(); cr = T(cr); p("r", cr); } function f(ck, cv) { if (!ck || (!cv && cv != 0) || ck == "" || (cv == "" && typeof cv == "string")) return; $burl = $burl + "&" + ck + "=" + cv; } function R() { var cr = ""; try { cr = $bmd.referrer; } catch (err) { } if (cr == null) { cr = ""; } return cr; } function e(ck) { f(ck, N(ck)); } function Z() { p("u", T(Q())); } function W() { $bcu.i = Math.random(); var cn = "vietadtmpf" + $bcu.i; var cs = "<img name='" + cn + "' id='" + cn + "' style='width:0px;height:0px;padding:0px;margin:0px;border:0px;vertical-align:baseline;' border=0 />"; document.write(cs); } function w() { var cf = "-1"; if ($bif) { var cw = window; cf = T(cw.location.href); } f("fu", cf); } function Q() { if ($bof && $bmd.referrer) return $bmd.referrer; return $bmd.location.href; } function J() { if (typeof D == $bud) { D = ""; } if (!D) { D = ""; } $burl = "?i=" + D; } function c() { var ca = Math.floor(Math.random() * 10000) + 10001; try { if ($bmw.vietad_data.sid) { ca = $bmw.vietad_data.sid; } else { ca = ca - 10001; $bmw.vietad_data.sid = ca; } } catch (err) { } f("ac", ca); } function K() { if (A) return; A = {}; var cu = navigator.userAgent.toLowerCase(); A.isOpera = (cu.indexOf('opera') > -1); A.isIE = (!A.isOpera && cu.indexOf('msie') > -1); A.isFF = (!A.isOpera && !A.isIE && cu.indexOf('firefox') > -1); A.addEvent = function(o, c, h) { if (this.isIE) { o.attachEvent('on' + c, h); } else { o.addEventListener(c, h, false); } } } function H() { if (parseInt(vietad_height) == 165 || parseInt(vietad_height) == 156) vietad_height = 180; if (parseInt(vietad_height) == 730) vietad_height = 700; if (parseInt(vietad_height) == 629) vietad_height = 640; var ci = "vietadf" + $bcu.i; $burl = B[3] + $burl; $burl = $burl + "&id=" + ci; $burl = $burl.substring(0, 2048); var cs = "<iframe name='" + ci + "' id='" + ci + "' border=0 frameborder=0  marginwidth='0' marginheight='0' scrolling='no' "; var cs = cs + "style=\"width:" + vietad_width + "px; height:" + vietad_height + "px;\" "; var cs = cs + "src=\"" + $burl + "\"></iframe>"; document.write(cs); } function E() { var cf = (function() { var cu = B[4] + $bcu.s; document.getElementById("vietadtmpf" + $bcu.i).setAttribute("src", cu); }); A.addEvent(window, "load", cf); } function TrackImpression(cmp) { var url = ''; url = '?z=' + D; url = url + '&type=F5D58A5CFC32925D'; url = url + '&lst=' + cmp; url = url + '&Pref=' + T(Q()); var cu = B[4] + url; SendHttpRequest(cu); } function U() { var cm = C; var cw = window; for (var co in cm) { var cn = cm[co].n; if (cn) { for (var i = 0; i < cn.length; i++) { if (typeof cw[cn[i]] != $bud) { cw[cn[i]] = null; } } } } } function F() { K(); J(); Z(); p('w', $bcu.width); p('h', $bcu.height); p('sz', $bcu.sz); p('t', $bcu.t); p('tc', $bcu.tc); p('dc', $bcu.dc); p('bgc', $bcu.bgc); p('bdc', $bcu.bdc); p('lc', $bcu.lc); p('zt', $bcu.tp); b(); $bcu.s = $burl; try { f("dx", $bmw.vietad_data[B[8]]); } catch (err) { } w(); W(); c(); $bcu.q = $burl; if (parseInt($bcu.tp) == 2) { var value = readCookie('closeAdVad'); if (!value) { LoadJquery(); InitAd(); } } else H(); U(); } G(); if (V()) { F(); } function Adtt(s) { document.write(s); } function InitAd() { if ($traverseTimer == null) $traverseTimer = (new Date()).getTime(); $burl = B[3] + $burl; $burl = $burl.substring(0, 2048); LoadData($burl); } function LoadData(url) { document.write("<SCRIPT LANGUAGE='Javascript' SRC='" + url + "'></SCRIPT>"); } function LoadJquery() { var html_doc = document.getElementsByTagName('head')[0]; var css_file = $vaddomain + 'Vad_balloon_ads_new.css'; var css = document.createElement('link'); css.setAttribute('rel', 'stylesheet'); css.setAttribute('type', 'text/css'); css.setAttribute('href', css_file); html_doc.appendChild(css); if (IE6 == true) { var css_file = $vaddomain + 'VietAd_IE6.css'; var css = document.createElement('link'); css.setAttribute('rel', 'stylesheet'); css.setAttribute('type', 'text/css'); css.setAttribute('href', css_file); html_doc.appendChild(css); } else { var css_file = $vaddomain + 'VietAd_IE7.css'; var css = document.createElement('link'); css.setAttribute('rel', 'stylesheet'); css.setAttribute('type', 'text/css'); css.setAttribute('href', css_file); html_doc.appendChild(css); } } function LoadFileExendFromVad(url, type) { var doc = document.getElementsByTagName('head')[0]; if (type = 'js') { var js = document.createElement('script'); js.setAttribute('type', 'text/javascript'); js.setAttribute('src', js_file); doc.appendChild(js); } else { var css = document.createElement('link'); css.setAttribute('rel', 'stylesheet'); css.setAttribute('type', 'text/css'); css.setAttribute('href', css_file); doc.appendChild(css); } } var statusMini = false; function BallonAds(impression, click, filetype, file, width, height, url, title, layoutId, top, left, min, status, zone) { this.Impression = impression; this.Click = click; this.FileType = filetype; this.SrcFile = file; this.Width = width; this.Height = height; this.Url = url; this.Title = title; this.LayoutId = layoutId; this.Top = top; this.Left = left; this.Min = min; this.Status = status; this.ZoneId = zone; } function ClickBalloonAds() { if ($zoneType != null && _ballonAds != null) { var url = ''; url = '?z=' + D; url = url + '&type=2879BB7B31C03D83'; url = url + '&c=' + _ballonAds.Click; url = url + '&Pref=' + T(Q()); url = url + '&url=' + _ballonAds.Url; var cu = B[4] + url; SendHttpRequest(cu); window.open(_ballonAds.Url); } } function SendHttpRequest(url) { var imgObj = document.createElement('img'); imgObj.type = 'image/gif'; imgObj.src = url; imgObj.style.display = 'none'; registerImg(imgObj); } function registerImg(obj) { try { document.getElementsByTagName("head")[0].appendChild(obj); } catch (err) { } } function WriteBallonAds() { var displayString = ''; var isRich = false; if ($zoneType != null && _ballonAds != null) { displayString += '<div id="divBalloonAdsVad" style="height:' + (parseInt(_ballonAds.Height) + 33) + 'px">'; displayString += '<div id="VadboxMgic">'; displayString += '<div id="VadtitleMgic">'; displayString += '<div class="VadctnerTitleMgic">'; displayString += '<div class="VadlogoItem"><a href="http://vietad.vn" target="_blank"><img src="http://img.vietad.vn/BalloonAd/logoitem.png" style="border:0px" /></a></div>'; displayString += '<div class="VadctnerText"> <marquee scrolldelay="200"><div><a href="javascript:void(0)" onclick="ClickBalloonAds();">' + _ballonAds.Title + '</a> - <a href="http://vietad.vn/Publics/ZoneDetail.aspx?zoneId=' + _ballonAds.ZoneId + '" target="_blank"> Ads by VietAd</a></div></marquee></div>'; displayString += '<div class="VadgrBtnCtrol"><a class="Vaddown"   href="javascript:void(0);" onclick="VadShowOrClose();"></a><a class="Vadclose" href="javascript:void(0);" onclick="closeBalloonAdsVad();"></a></div>'; displayString += '<div class="Vadclearboth"></div>'; displayString += '</div>'; displayString += '</div>'; displayString += '<div id="VadcterMgic">'; displayString += '<div class="VadboxInside">'; displayString += '<a style="position:absolute;border:0px; top:29px; background:#EEcc33; opacity:0; filter:alpha(opacity=0); width:250px; height:' + _ballonAds.Height + 'px; display:block; cursor:pointer; z-index:20000; cursor:pointer;border:1px solid red;" href="javascript:void(0);" onclick="ClickBalloonAds();">&nbsp;</a>'; switch (_ballonAds.FileType) { case 'Flash': if (parseInt(_ballonAds.LayoutId) != 9) { isRich = true; displayString = '<div id="divBalloonAdsVad" class="boxTiprightBtomVad" style="border:0px;width:' + parseInt(_ballonAds.Width) + 'px; height:' + parseInt(_ballonAds.Height) + 'px">'; } displayString += '<object id="BalloonObjVad" name="BalloonObjVad" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + _ballonAds.Width + '" height="' + _ballonAds.Height + '">'; displayString += '<param name="movie" value="' + _ballonAds.SrcFile + '" />'; displayString += '<param name="allowScriptAccess" value="always"/>'; displayString += '<param name="quality" value="high" />'; displayString += '<param name="wmode" value="transparent">'; displayString += '<!--[if !IE]>-->'; displayString += '<object name="BalloonObjVad" type="application/x-shockwave-flash" data="' + _ballonAds.SrcFile + '" width="' + _ballonAds.Width + '" height="' + _ballonAds.Height + '">'; displayString += '<param name="swliveconnect" value="true" />'; displayString += '<param name="allowScriptAccess" value="always"/>'; displayString += '<param name="quality" value="high" />'; displayString += '<param name="wmode" value="transparent">'; displayString += '<!--<![endif]-->'; displayString += '<!--[if !IE]>-->'; displayString += '</object>'; displayString += '<!--<![endif]-->'; displayString += '</object>'; break; case 'Image': displayString += '<img style="border:0px; position:relative; z-index:0;" src="' + _ballonAds.SrcFile + '" width="' + _ballonAds.Width + '" height="' + _ballonAds.Height + '">'; break; default: break; } if (isRich) { displayString += '</div> ' } else { displayString += '</a>'; displayString += '</div>'; displayString += '</div>'; displayString += '</div>'; displayString += '<div id="VadtipId">'; displayString += '<div class="VadtipIdR">'; displayString += '<div class="VadtipCtner">'; displayString += '<div class="Vadctner">'; displayString += '<div class="VaditemLgo"><a href="http://vietad.vn" target="_blank"><img src="http://img.vietad.vn/BalloonAd/logo2.png" style="border:0px" /></a></div>'; displayString += '<div class="VadtextTip"><marquee scrolldelay="200"><div><a href="javascript:void(0)" onclick="ClickBalloonAds();">' + _ballonAds.Title + '</a> - <a href="http://vietad.vn/Publics/ZoneDetail.aspx?zoneId=' + _ballonAds.ZoneId + '" target="_blank"> Ads by VietAd</a></div></marquee></div>'; displayString += '<div class="VadgrTipCtrol"  > <a class="VadupTip" href="javascript:void(0)" onclick="VadShowOrClose();"></a> <a class="VadcloseTip"  href="javascript:void(0);" onclick="closeBalloonAdsVad();"></a></div>'; displayString += '<div class="Vadclearboth"></div>'; displayString += '</div>'; displayString += '</div>'; displayString += '</div>'; displayString += '</div>'; displayString += '</div>' }; document.write(displayString); } } var timeOutPopupVad; function setMinButton() { var obj = swfobject.getObjectById("BalloonObjVad"); if (obj && typeof obj.JStoASviaExternalInterface != "undefined") { obj.JStoASviaExternalInterface('min'); } } function showBalloonAdsVad() { if ($zoneType != null && _ballonAds != null) { var w = '0px'; w = parseInt(_ballonAds.Width); w = w + 'px'; var sPos = 'bottom_right'; if (sPos == 'bottom_left') { document.getElementById("divBalloonAdsVad").style.left = 0; document.getElementById("divBalloonAdsVad").style.display = 'block'; } else if (sPos == 'bottom_right') { document.getElementById("divBalloonAdsVad").style.right = '-' + w; document.getElementById("divBalloonAdsVad").style.display = 'block'; if (parseInt(_ballonAds.LayoutId) == 9) { if (typeof cpmst_ChangeSizeIframe == "function") { cpmst_ChangeSizeIframe(parseInt(_ballonAds.Height) + 33, _ballonAds.Width, 1); } jQueryCustom("#divBalloonAdsVad").animate({ right: "2px" }, { duration: "slow" }); timeOutPopupVad = setTimeout("minBalloonAdsVad()", 15000); } else document.getElementById("divBalloonAdsVad").style.right = '0px'; } switch (parseInt(_ballonAds.LayoutId)) { case 13: VadPopupPreexpand(); break; case 14: VadPopupExpand(); break; default: break; } TrackImpression(_ballonAds.Impression); } } function VadPopupExpand() { if ($zoneType != null && _ballonAds != null) { if (typeof cpmst_ChangeSizeIframe == 'function') { cpmst_ChangeSizeIframe(_ballonAds.Height, _ballonAds.Width, 1); } document.getElementById("divBalloonAdsVad").style.clip = "rect(0px " + _ballonAds.Width + "px " + _ballonAds.Height + "px 0px)"; } } function VadPopupPreexpand() { if ($zoneType != null && _ballonAds != null) { if (typeof cpmst_ChangeSizeIframe == 'function') { var expand = 1; if (parseInt(_ballonAds.LayoutId) == 14) { expand = 0; } var height = parseInt(_ballonAds.Height) - parseInt(_ballonAds.Top); var width = parseInt(_ballonAds.Width) - parseInt(_ballonAds.Left); cpmst_ChangeSizeIframe(height, width, expand); } document.getElementById("divBalloonAdsVad").style.clip = "rect(" + _ballonAds.Top + "px " + _ballonAds.Width + "px " + _ballonAds.Height + "px " + _ballonAds.Left + "px)"; } } function VadMinPopUp() { if ($zoneType != null && _ballonAds != null) { if (typeof cpmst_ChangeSizeIframe == 'function') { var height = parseInt(_ballonAds.Height) - parseInt(_ballonAds.Min); if (_ballonAds.LayoutId == 9) height = 33; var width = parseInt(_ballonAds.Width) - parseInt(_ballonAds.Left); cpmst_ChangeSizeIframe(height, width, 0); } document.getElementById("divBalloonAdsVad").style.clip = "rect(" + _ballonAds.Min + "px " + _ballonAds.Width + "px " + _ballonAds.Height + "px " + _ballonAds.Left + "px)"; } } function VadClosePopUp() { jQueryCustom("#divBalloonAdsVad").fadeOut("slow"); } function VadClickPopUp() { if ($zoneType != null && _ballonAds != null) { var url = ''; url = '?z=' + D; url = url + '&type=2879BB7B31C03D83'; url = url + '&c=' + _ballonAds.Click; url = url + '&Pref=' + T(Q()); url = url + '&url=' + _ballonAds.Url; var cu = B[4] + url; SendHttpRequest(cu); window.open(_ballonAds.Url); } } function setTimeDelay() { timeOutPopupVad = setTimeout("minBalloonAdsVad()", 7000); } function clearTimeDelay() { clearTimeout(timeOutPopupVad); } function minBalloonAdsVad() { clearTimeDelay(); var h = '0px'; statusMini = true; if (_ballonAds != null) { h = parseInt(_ballonAds.Height); h = h - 4 + 'px' } if (0) { if (IE6 == false) { jQueryCustom("#divBalloonAdsVad").animate({ bottom: "-250px" }, { duration: "slow" }); } else { jQueryCustom("#divBalloonAdsVad").animate({ height: "195px" }, 700); } } else { if (IE6 == false) { if (typeof cpmst_ChangeSizeIframe == 'function') { cpmst_ChangeSizeIframe(33, _ballonAds.Width, 0); } jQueryCustom("#divBalloonAdsVad").animate({ bottom: "-" + h }, { duration: "slow", complete: function() { if (document.getElementById('VadtipId')) document.getElementById('VadtipId').style.display = 'block'; if (document.getElementById('VadboxMgic')) document.getElementById('VadboxMgic').style.display = 'none'; } }); } else { jQueryCustom("#divBalloonAdsVad").animate({ height: "20px" }, 700); } }; timeOutPopupVad = setTimeout("maxBalloonAdsVad()", 300000); } function VadShowOrClose() { clearTimeDelay(); if (statusMini == true) maxBalloonAdsVad(); else minBalloonAdsVad(); } function maxBalloonAdsVad() { clearTimeDelay(); var h = '0px'; statusMini = false; if (_ballonAds != null) { h = _ballonAds.Height + 'px'; } if (0) { if (IE6 == false) { jQueryCustom("#divBalloonAdsVad").animate({ bottom: "0" }, { duration: "slow" }); } else { jQueryCustom("#divBalloonAdsVad").animate({ height: "227px" }, 700); } } else { if (IE6 == false) { if (typeof cpmst_ChangeSizeIframe == 'function') { cpmst_ChangeSizeIframe(parseInt(_ballonAds.Height) + 33, _ballonAds.Width, 1); } if (document.getElementById('VadtipId')) document.getElementById('VadtipId').style.display = 'none'; if (document.getElementById('VadboxMgic')) document.getElementById('VadboxMgic').style.display = 'block'; jQueryCustom("#divBalloonAdsVad").animate({ bottom: "0" }, { duration: "slow" }); } else { jQueryCustom("#divBalloonAdsVad").animate({ height: "227px" }, 700); } }; timeOutPopupVad = setTimeout("minBalloonAdsVad()", 15000); } function closeBalloonAdsVad() { jQueryCustom("#divBalloonAdsVad").fadeOut("slow"); var value = readCookie('closeAdVad'); createCookie('closeAdVad', 'closed', 5); } function WriteBug(msg) { document.getElementById('bug').innerHTML += '<br/>' + msg; } function createCookie(name, value, minutes) { if (minutes) { var date = new Date(); date.setTime(date.getTime() + (minutes * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; document.cookie = name + "=" + value + expires + "; path=/"; } function eraseCookie(name) { createCookie(name, "", -1); } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; } (function() {
    if (typeof jQueryCustom != "undefined") var _jQueryCustom = jQueryCustom; var jQueryCustom = window.jQueryCustom = function(a, c) { if (window == this || !this.init) return new jQueryCustom(a, c); return this.init(a, c); }; var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/; ; jQueryCustom.fn = jQueryCustom.prototype = { init: function(a, c) { a = a || document; if (typeof a == "string") { var m = quickExpr.exec(a); if (m && (m[1] || !c)) { if (m[1]) a = jQueryCustom.clean([m[1]], c); else { var tmp = document.getElementById(m[3]); if (tmp) if (tmp.id != m[3]) return jQueryCustom().find(a); else { this[0] = tmp; this.length = 1; return this; } else a = []; }; } else return new jQueryCustom(c).find(a); } else if (jQueryCustom.isFunction(a)) return new jQueryCustom(document)[jQueryCustom.fn.ready ? "ready" : "load"](a); return this.setArray(a.constructor == Array && a || (a.jquery || a.length && a != window && !a.nodeType && a[0] != undefined && a[0].nodeType) && jQueryCustom.makeArray(a) || [a]); }, setArray: function(a) { this.length = 0; Array.prototype.push.apply(this, a); return this; }, each: function(fn, args) { return jQueryCustom.each(this, fn, args); }, attr: function(key, value, type) { var obj = key; alert('---'); if (key.constructor == String) if (value == undefined) return this.length && jQueryCustom[type || "attr"](this[0], key) || undefined; else { obj = {}; obj[key] = value; }; return this.each(function(index) { for (var prop in obj) jQueryCustom.attr(type ? this.style : this, prop, jQueryCustom.prop(this, obj[prop], type, index, prop)); }); }, find: function(t) { var data = jQueryCustom.map(this, function(a) { return jQueryCustom.find(t, a); }); return this.pushStack(/[^+>] [^+>]/.test(t) || t.indexOf("..") > -1 ? jQueryCustom.unique(data) : data); }, pushStack: function(a) { var ret = jQueryCustom(a); ret.prevObject = this; return ret; }, filter: function(t) { return this.pushStack(jQueryCustom.isFunction(t) && jQueryCustom.grep(this, function(el, index) { return t.apply(el, [index]); }) || jQueryCustom.multiFilter(t, this)); }, is: function(expr) { return expr ? jQueryCustom.multiFilter(expr, this).length > 0 : false; } }; jQueryCustom.extend = jQueryCustom.fn.extend = function() { var target = arguments[0] || {}, a = 1, al = arguments.length, deep = false; if (target.constructor == Boolean) { deep = target; target = arguments[1] || {}; } if (al == 1) { target = this; a = 0; } var prop; for (; a < al; a++) if ((prop = arguments[a]) != null) for (var i in prop) { if (target == prop[i]) continue; if (deep && typeof prop[i] == 'object' && target[i]) jQueryCustom.extend(target[i], prop[i]); else if (prop[i] != undefined) target[i] = prop[i]; } return target; }; var expando = "jQueryCustom" + (new Date()).getTime(), uuid = 0, win = {}; jQueryCustom.extend({ noConflict: function(deep) { if (deep) window.jQueryCustom = _jQueryCustom; return jQueryCustom; }, isXMLDoc: function(elem) { return elem.documentElement && !elem.body || elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; }, isFunction: function(fn) { return !!fn && typeof fn != "string" && !fn.nodeName && fn.constructor != Array && /function/i.test(fn + ""); }, globalEval: function(data) { data = jQueryCustom.trim(data); if (data) { if (window.execScript) window.execScript(data); else if (jQueryCustom.browser.safari) window.setTimeout(data, 0); else eval.call(window, data); } }, nodeName: function(elem, name) { return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); }, cache: {}, data: function(elem, name, data) { elem = elem == window ? win : elem; var id = elem[expando]; if (!id) id = elem[expando] = ++uuid; if (name && !jQueryCustom.cache[id]) jQueryCustom.cache[id] = {}; if (data != undefined) jQueryCustom.cache[id][name] = data; return name ? jQueryCustom.cache[id][name] : id; }, each: function(obj, fn, args) { if (args) { if (obj.length == undefined) for (var i in obj) fn.apply(obj[i], args); else for (var i = 0, ol = obj.length; i < ol; i++) if (fn.apply(obj[i], args) === false) break; } else { if (obj.length == undefined) for (var i in obj) fn.call(obj[i], i, obj[i]); else for (var i = 0, ol = obj.length, val = obj[0]; i < ol && fn.call(val, i, val) !== false; val = obj[++i]) { } }; return obj; }, attr: function(elem, name, value) { var fix = jQueryCustom.isXMLDoc(elem) ? {} : jQueryCustom.props; if (name == "selected" && jQueryCustom.browser.safari) elem.parentNode.selectedIndex; if (fix[name]) { if (value != undefined) elem[fix[name]] = value; return elem[fix[name]]; } else if (jQueryCustom.browser.msie && name == "style") return jQueryCustom.attr(elem.style, "cssText", value); else if (value == undefined && jQueryCustom.browser.msie && jQueryCustom.nodeName(elem, "form") && (name == "action" || name == "method")) return elem.getAttributeNode(name).nodeValue; else if (elem.tagName) { if (value != undefined) { if (name == "type" && jQueryCustom.nodeName(elem, "input") && elem.parentNode) throw "type property can't be changed"; elem.setAttribute(name, value); } if (jQueryCustom.browser.msie && /href|src/.test(name) && !jQueryCustom.isXMLDoc(elem)) return elem.getAttribute(name, 2); return elem.getAttribute(name); } else { if (name == "opacity" && jQueryCustom.browser.msie) { if (value != undefined) { elem.zoom = 1; elem.filter = (elem.filter || "").replace(/alpha\([^)]*\)/, "") + (parseFloat(value).toString() == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")"); } return elem.filter ? (parseFloat(elem.filter.match(/opacity=([^)]*)/)[1]) / 100).toString() : ""; } name = name.replace(/-([a-z])/ig, function(z, b) { return b.toUpperCase(); }); if (value != undefined) elem[name] = value; return elem[name]; } }, prop: function(elem, value, type, index, prop) { if (jQueryCustom.isFunction(value)) value = value.call(elem, [index]); var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; return value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) ? value + "px" : value; }, css: function(e, p) { if (p == "height" || p == "width") { var old = {}, oHeight, oWidth, d = ["Top", "Bottom", "Right", "Left"]; jQueryCustom.each(d, function() { old["padding" + this] = 0; old["border" + this + "Width"] = 0; }); jQueryCustom.swap(e, old, function() { if (jQueryCustom(e).is(':visible')) { oHeight = e.offsetHeight; oWidth = e.offsetWidth; } else { e = jQueryCustom(e.cloneNode(true)).find(":radio").removeAttr("checked").end().css({ visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0" }).appendTo(e.parentNode)[0]; var parPos = jQueryCustom.css(e.parentNode, "position") || "static"; if (parPos == "static") e.parentNode.style.position = "relative"; oHeight = e.clientHeight; oWidth = e.clientWidth; if (parPos == "static") e.parentNode.style.position = "static"; e.parentNode.removeChild(e); } }); return p == "height" ? oHeight : oWidth; } return jQueryCustom.curCSS(e, p); }, curCSS: function(elem, prop, force) { var ret, stack = [], swap = []; function color(a) { if (!jQueryCustom.browser.safari) return false; var ret = document.defaultView.getComputedStyle(a, null); return !ret || ret.getPropertyValue("color") == ""; } if (prop == "opacity" && jQueryCustom.browser.msie) { ret = jQueryCustom.attr(elem.style, "opacity"); return ret == "" ? "1" : ret; } if (prop.match(/float/i)) prop = styleFloat; if (!force && elem.style[prop]) ret = elem.style[prop]; else if (document.defaultView && document.defaultView.getComputedStyle) { if (prop.match(/float/i)) prop = "float"; prop = prop.replace(/([A-Z])/g, "-$1").toLowerCase(); var cur = document.defaultView.getComputedStyle(elem, null); if (cur && !color(elem)) ret = cur.getPropertyValue(prop); else { for (var a = elem; a && color(a); a = a.parentNode) stack.unshift(a); for (a = 0; a < stack.length; a++) if (color(stack[a])) { swap[a] = stack[a].style.display; stack[a].style.display = "block"; } ret = prop == "display" && swap[stack.length - 1] != null ? "none" : document.defaultView.getComputedStyle(elem, null).getPropertyValue(prop) || ""; for (a = 0; a < swap.length; a++) if (swap[a] != null) stack[a].style.display = swap[a]; }; if (prop == "opacity" && ret == "") ret = "1"; } else if (elem.currentStyle) { var newProp = prop.replace(/\-(\w)/g, function(m, c) { return c.toUpperCase(); }); ret = elem.currentStyle[prop] || elem.currentStyle[newProp]; if (!/^\d+(px)?$/i.test(ret) && /^\d/.test(ret)) { var style = elem.style.left; var runtimeStyle = elem.runtimeStyle.left; elem.runtimeStyle.left = elem.currentStyle.left; elem.style.left = ret || 0; ret = elem.style.pixelLeft + "px"; elem.style.left = style; elem.runtimeStyle.left = runtimeStyle; } } return ret; }, merge: function(first, second) { if (jQueryCustom.browser.msie) { for (var i = 0; second[i]; i++) if (second[i].nodeType != 8) first.push(second[i]); } else for (var i = 0; second[i]; i++) first.push(second[i]); return first; }, unique: function(first) { var r = [], done = {}; try { for (var i = 0, fl = first.length; i < fl; i++) { var id = jQueryCustom.data(first[i]); if (!done[id]) { done[id] = true; r.push(first[i]); } } } catch (e) { r = first; } return r; }, grep: function(elems, fn, inv) { if (typeof fn == "string") fn = eval("false||function(a,i){return " + fn + "}"); var result = []; for (var i = 0, el = elems.length; i < el; i++) if (!inv && fn(elems[i], i) || inv && !fn(elems[i], i)) result.push(elems[i]); return result; } }); var userAgent = navigator.userAgent.toLowerCase(); jQueryCustom.browser = { version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1], safari: /webkit/.test(userAgent), opera: /opera/.test(userAgent), msie: /msie/.test(userAgent) && !/opera/.test(userAgent), mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent) }; var styleFloat = jQueryCustom.browser.msie ? "styleFloat" : "cssFloat"; jQueryCustom.extend({ boxModel: !jQueryCustom.browser.msie || document.compatMode == "CSS1Compat", styleFloat: jQueryCustom.browser.msie ? "styleFloat" : "cssFloat", props: { "for": "htmlFor", "class": "className", "float": styleFloat, cssFloat: styleFloat, styleFloat: styleFloat, innerHTML: "innerHTML", className: "className", value: "value", disabled: "disabled", checked: "checked", readonly: "readOnly", selected: "selected", maxlength: "maxLength"} }); jQueryCustom.each(["Height", "Width"], function(i, name) { var n = name.toLowerCase(); jQueryCustom.fn[n] = function(h) { return this[0] == window ? jQueryCustom.browser.safari && self["inner" + name] || jQueryCustom.boxModel && Math.max(document.documentElement["client" + name], document.body["client" + name]) || document.body["client" + name] : this[0] == document ? Math.max(document.body["scroll" + name], document.body["offset" + name]) : h == undefined ? (this.length ? jQueryCustom.css(this[0], n) : null) : this.css(n, h.constructor == String ? h : h + "px"); }; }); var chars = jQueryCustom.browser.safari && parseInt(jQueryCustom.browser.version) < 417 ? "(?:[\\w*_-]|\\\\.)" : "(?:[\\w\u0128-\uFFFF*_-]|\\\\.)", quickChild = new RegExp("^>\\s*(" + chars + "+)"), quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"), quickClass = new RegExp("^([#.]?)(" + chars + "*)"); jQueryCustom.extend({ expr: { ":": { animated: "jQueryCustom.grep(jQueryCustom.timers,function(fn){return a==fn.elem;}).length"} }, parse: [/^(\[)*@?([\w-]+)*([!*$^~=]*)*('?"?)(.*?)\4 *\]/,
/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];while(expr&&expr!=old){old=expr;var f=jQueryCustom.filter(expr,elems,not);expr=f.t.replace(/^\s*,\s*/,"");cur=not?elems=f.r:jQueryCustom.merge(cur,f.r);}return cur;}, classFilter:function(r,m,not){m=" "+m+" ";var tmp=[];for(var i=0;r[i];i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;if(!not&&pass||not&&!pass)tmp.push(r[i]);}return tmp;},filter:function(t,r,not){var last;while(t&&t!=last){last=t;var p=jQueryCustom.parse,m;for(var i=0;p[i];i++){m=p[i].exec(t);if(m){t=t.substring(m[0].length);m[2]=m[2].replace(/\\/g, "");
;break;}}if(!m)break;if(m[1]==":"&&m[2]=="not")r=jQueryCustom.filter(m[3],r,true).r;else if(m[1]==".")r=jQueryCustom.classFilter(r,m[2],not);else if(m[1]=="["){var tmp=[],type=m[3];for(var i=0,rl=r.length;i<rl;i++){var a=r[i],z=a[jQueryCustom.props[m[2]]||m[2]];if(z==null||/href|src|selected/.test(m[2]))z=jQueryCustom.attr(a,m[2])||'';if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not)tmp.push(a);}r=tmp;}else if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(\d*)n\+?(\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"n+"+m[3]||m[3]),first=(test[1]||1)-0,last=test[2]-0;for(var i=0,rl=r.length;i<rl;i++){var node=r[i],parentNode=node.parentNode,id=jQueryCustom.data(parentNode);if(!merge[id]){var c=1;for(var n=parentNode.firstChild;n;n=n.nextSibling)if(n.nodeType==1)n.nodeIndex=c++;merge[id]=true;}var add=false;if(first==1){if(last==0||node.nodeIndex==last)add=true;}else if((node.nodeIndex+last)%first==0)add=true;if(add^not)tmp.push(node);}r=tmp;}else{var f=jQueryCustom.expr[m[1]];if(typeof f!="string")f=jQueryCustom.expr[m[1]][m[2]];f=eval("false||function(a,i){return "+f+"}");r=jQueryCustom.grep(r,f,not);}};return{r:r,t:t};}});var readyBound=false;function bindReady(){if(readyBound)return;readyBound=true;if(jQueryCustom.browser.mozilla||jQueryCustom.browser.opera)document.addEventListener("DOMContentLoaded",jQueryCustom.ready,false);else if(jQueryCustom.browser.msie){document.write("<scr"+"ipt id=__ie_init defer=true "+"src=//:><\/script>");var script=document.getElementById("__ie_init");if(script)script.onreadystatechange=function(){if(this.readyState!="complete")return;jQueryCustom.ready();};script=null;}else if(jQueryCustom.browser.safari)jQueryCustom.safariTimer=setInterval(function(){if(document.readyState=="loaded"||document.readyState=="complete"){clearInterval(jQueryCustom.safariTimer);jQueryCustom.safariTimer=null;jQueryCustom.ready();}},10);jQueryCustom.event.add(window,"load",jQueryCustom.ready);}var jsc=(new Date).getTime();jQueryCustom.fn.extend({fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);},animate:function(prop,speed,easing,callback){var opt=jQueryCustom.speed(speed,easing,callback);return this[opt.queue===false?"each":"queue"](function(){opt=jQueryCustom.extend({},opt);var hidden=jQueryCustom(this).is(":hidden"),self=this;for(var p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden)return jQueryCustom.isFunction(opt.complete)&&opt.complete.apply(this);if(p=="height"||p=="width"){opt.display=jQueryCustom.css(this,"display");opt.overflow=this.style.overflow;}}if(opt.overflow!=null)this.style.overflow="hidden";opt.curAnim=jQueryCustom.extend({},prop);jQueryCustom.each(prop,function(name,val){var e=new jQueryCustom.fx(self,opt,name);if(/toggle|show|hide/.test(val))e[val=="toggle"?hidden?"show":"hide":val](prop);else{var parts=val.toString().match(/^([+-]?)([\d.]+)(.*)$/),start=e.cur(true)||0;if(parts){end=parseFloat(parts[2]),unit=parts[3]||"px";if(unit!="px"){self.style[name]=end+unit;start=(end/e.cur(true))*start;self.style[name]=start+unit;}if(parts[1])end=((parts[1]=="-"?-1:1)*end)+start;e.custom(start,end,unit);}else e.custom(start,val,"");}});return true;});},queue:function(type,fn){if(!fn){fn=type;type="fx";}if(!arguments.length)return queue(this[0],type);return this.each(function(){if(fn.constructor==Array)queue(this,type,fn);else{queue(this,type).push(fn);if(queue(this,type).length==1)fn.apply(this);}});},stop:function(){var timers=jQueryCustom.timers;return this.each(function(){for(var i=0;i<timers.length;i++)if(timers[i].elem==this)timers.splice(i--,1);}).dequeue();}});var queue=function(elem,type,array){if(!elem)return;var q=jQueryCustom.data(elem,type+"queue");if(!q||array)q=jQueryCustom.data(elem,type+"queue",array?jQueryCustom.makeArray(array):[]);return q;};jQueryCustom.fn.dequeue=function(type){type=type||"fx";return this.each(function(){var q=queue(this,type);q.shift();if(q.length)q[0].apply(this);});};jQueryCustom.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQueryCustom.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:{slow:600,fast:200}[opt.duration])||400;opt.old=opt.complete;opt.complete=function(){jQueryCustom(this).dequeue();if(jQueryCustom.isFunction(opt.old))opt.old.apply(this);};return opt;},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;}},timers:[],fx:function(elem,options,prop){this.options=options;this.elem=elem;this.prop=prop;if(!options.orig)options.orig={};}});jQueryCustom.fx.prototype={update:function(){if(this.options.step)this.options.step.apply(this.elem,[this.now,this]);(jQueryCustom.fx.step[this.prop]||jQueryCustom.fx.step._default)(this);if(this.prop=="height"||this.prop=="width")this.elem.style.display="block";},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null)return this.elem[this.prop];var r=parseFloat(jQueryCustom.curCSS(this.elem,this.prop,force));return r&&r>-10000?r:parseFloat(jQueryCustom.css(this.elem,this.prop))||0;},custom:function(from,to,unit){this.startTime=(new Date()).getTime();this.start=from;this.end=to;this.unit=unit||this.unit||"px";this.now=this.start;this.pos=this.state=0;this.update();var self=this;function t(){return self.step();}t.elem=this.elem;jQueryCustom.timers.push(t);if(jQueryCustom.timers.length==1){var timer=setInterval(function(){var timers=jQueryCustom.timers;for(var i=0;i<timers.length;i++)if(!timers[i]())timers.splice(i--,1);if(!timers.length)clearInterval(timer);},13);}},show:function(){this.options.orig[this.prop]=jQueryCustom.attr(this.elem.style,this.prop);this.options.show=true;this.custom(0,this.cur());if(this.prop=="width"||this.prop=="height")this.elem.style[this.prop]="1px";jQueryCustom(this.elem).show();},hide:function(){this.options.orig[this.prop]=jQueryCustom.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0);},step:function(){var t=(new Date()).getTime();if(t>this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var done=true;for(var i in this.options.curAnim)if(this.options.curAnim[i]!==true)done=false;if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(jQueryCustom.css(this.elem,"display")=="none")this.elem.style.display="block";}if(this.options.hide)this.elem.style.display="none";if(this.options.hide||this.options.show)for(var p in this.options.curAnim)jQueryCustom.attr(this.elem.style,p,this.options.orig[p]);}if(done&&jQueryCustom.isFunction(this.options.complete))this.options.complete.apply(this.elem);return false;}else{var n=t-this.startTime;this.state=n/this.options.duration;this.pos=jQueryCustom.easing[this.options.easing||(jQueryCustom.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update();};return true;}};jQueryCustom.fx.step={scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;},scrollTop:function(fx){fx.elem.scrollTop=fx.now;},opacity:function(fx){jQueryCustom.attr(fx.elem.style,"opacity",fx.now);},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;}};})();

