// Copyright 2007, Kaboodle, Inc. /* grab_xlib.js compiled from X 4.0 with XC 0.27b. Distributed by GNU LGPL. For copyrights, license, documentation and more visit Cross-Browser.com */ var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf('opera');if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7;}}else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf('msie 4')!=-1;xIE5=xUA.indexOf('msie 5')!=-1;}else if(document.layers){xNN4=true;}xMac=xUA.indexOf('mac')!=-1;function xCardinalPosition(e, cp, margin, outside){if(!(e=xGetElementById(e))) return;if (typeof(cp)!='string'){window.status='xCardinalPosition error: cp=' + cp + ', id=' + e.id; return;}var x=xLeft(e), y=xTop(e), w=xWidth(e), h=xHeight(e);var pw,ph,p = xParent(e);if (p == document || p.nodeName.toLowerCase() == 'html') {pw = xClientWidth(); ph = xClientHeight();}else {pw=xWidth(p); ph=xHeight(p);}var sx=xScrollLeft(p), sy=xScrollTop(p);var right=sx + pw, bottom=sy + ph;var cenLeft=sx + Math.floor((pw-w)/2), cenTop=sy + Math.floor((ph-h)/2);if (!margin) margin=0;else{if (outside) margin=-margin;sx +=margin; sy +=margin; right -=margin; bottom -=margin;}switch (cp.toLowerCase()){case 'n': x=cenLeft; if (outside) y=sy - h; else y=sy; break;case 'ne': if (outside){x=right; y=sy - h;}else{x=right - w; y=sy;}break;case 'e': y=cenTop; if (outside) x=right; else x=right - w; break;case 'se': if (outside){x=right; y=bottom;}else{x=right - w; y=bottom - h}break;case 's': x=cenLeft; if (outside) y=sy - h; else y=bottom - h; break;case 'sw': if (outside){x=sx - w; y=bottom;}else{x=sx; y=bottom - h;}break;case 'w': y=cenTop; if (outside) x=sx - w; else x=sx; break;case 'nw': if (outside){x=sx - w; y=sy - h;}else{x=sx; y=sy;}break;case 'cen': x=cenLeft; y=cenTop; break;case 'cenh': x=cenLeft; break;case 'cenv': y=cenTop; break;}var o = new Object();o.x = x; o.y = y;return o;}function xClientHeight(){var h=0;if(xOp6Dn) h=window.innerHeight;else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientHeight)h=document.documentElement.clientHeight;else if(document.body && document.body.clientHeight)h=document.body.clientHeight;else if(xDef(window.innerWidth,window.innerHeight,document.width)) {h=window.innerHeight;if(document.width>window.innerWidth) h-=16;}return h;}function xClientWidth(){var w=0;if(xOp6Dn) w=window.innerWidth;else if(document.compatMode == 'CSS1Compat' && !window.opera && document.documentElement && document.documentElement.clientWidth)w=document.documentElement.clientWidth;else if(document.body && document.body.clientWidth)w=document.body.clientWidth;else if(xDef(window.innerWidth,window.innerHeight,document.height)) {w=window.innerWidth;if(document.height>window.innerHeight) w-=16;}return w;}function xDef(){for(var i=0; i=0) {var pt=0,pb=0,bt=0,bb=0;if (document.compatMode=='CSS1Compat') {var gcs = xGetComputedStyle;pt=gcs(e,'padding-top',1);if (pt !== null) {pb=gcs(e,'padding-bottom',1);bt=gcs(e,'border-top-width',1);bb=gcs(e,'border-bottom-width',1);}else if(xDef(e.offsetHeight,e.style.height)){e.style.height=h+'px';pt=e.offsetHeight-h;}}h-=(pt+pb+bt+bb);if(isNaN(h)||h<0) return;else e.style.height=h+'px';}h=e.offsetHeight;}else if(css && xDef(e.style.pixelHeight)) {if(h>=0) e.style.pixelHeight=h;h=e.style.pixelHeight;}return h;}function xLeft(e, iX){if(!(e=xGetElementById(e))) return 0;var css=xDef(e.style);if (css && xStr(e.style.left)) {if(xNum(iX)) e.style.left=iX+'px';else {iX=parseInt(e.style.left);if(isNaN(iX)) iX=0;}}else if(css && xDef(e.style.pixelLeft)) {if(xNum(iX)) e.style.pixelLeft=iX;else iX=e.style.pixelLeft;}return iX;}function xMoveTo(e,x,y){xLeft(e,x);xTop(e,y);}function xNum(){for(var i=0; i=0) {var pl=0,pr=0,bl=0,br=0;if (document.compatMode=='CSS1Compat') {var gcs = xGetComputedStyle;pl=gcs(e,'padding-left',1);if (pl !== null) {pr=gcs(e,'padding-right',1);bl=gcs(e,'border-left-width',1);br=gcs(e,'border-right-width',1);}else if(xDef(e.offsetWidth,e.style.width)){e.style.width=w+'px';pl=e.offsetWidth-w;}}w-=(pl+pr+bl+br);if(isNaN(w)||w<0) return;else e.style.width=w+'px';}w=e.offsetWidth;}else if(css && xDef(e.style.pixelWidth)) {if(w>=0) e.style.pixelWidth=w;w=e.style.pixelWidth;}return w;}function KaboodleAddItemCommon(_baseUrl, _libs, _version) { // If true, exceptions are shown in alert box. this.DEBUG = false; this.retries = 0; this.baseUrl = _baseUrl; this.version = _version; this.libs = _libs; this.caught = function(e) { if (this.DEBUG) window.alert('Caught Exception: ' + e.message); } this.addDependentLibraries = function(callback) { var obj = this; if (this.retries == 0) { var doc = window.document; var head = doc.getElementsByTagName('head')[0]; for (key in this.libs) { if (typeof this.libs[key] == 'string') { if (this.DEBUG) window.alert('Adding library ' + key + ' from ' + this.baseUrl + this.libs[key] + '?v=' + this.version); var element = this.createElement(doc, 'script'); element.type = 'text/javascript'; element.src = this.baseUrl + this.libs[key] + '?v=' + this.version; element.id = key; head.insertBefore(element, head.firstChild); } } this.retries++; setTimeout(function(){obj.addDependentLibraries(callback)}, 10); } else if(self.xDef && self.KaboodleExtractor) { if (this.DEBUG) window.alert('Libraries added after ' + (this.retries - 1) + ' retries.'); callback.call(); } else { if(this.retries == 100) { // 100 * 100 ms = 10 seconds if (this.DEBUG) window.alert('Error: Timed out waiting for the application to load.'); return; } else if(this.retries > 100) { return; } else { this.retries++; setTimeout(function(){obj.addDependentLibraries(callback)}, 100); } } } this.removeDependentLibraries = function() { var doc = window.document; var head = doc.getElementsByTagName('head')[0]; for(key in this.libs) { var element = doc.getElementById(key); if (element) { if (this.DEBUG) window.alert('Removing library ' + key); head.removeChild(element); } } } this.getVersion = function(){ var theVer = ''; try { theVer = _mg56v; } catch (e) { this.caught(e); } return theVer; } this.createElement = function(doc, type) { try { var elem = doc.standardCreateElement(type); if (typeof(elem)=='object') return elem; } catch(e) {} return doc.createElement(type); } }function KaboodleAddItemShell(_common, _window, _document, _body, _url, _formTarget, _overlayMode) { // If true, exceptions are shown in alert box. this.DEBUG = false; // If true, set testing mode, else production mode, where // testing mode = open text area with content // production mode = submit content to server this.TESTING = false; this.FORM_POST_URL=_url; this.FORM_TARGET = typeof _formTarget == 'undefined' ? null : _formTarget; this.overlayMode = typeof _overlayMode == 'undefined' ? false : _overlayMode; this.FORM_ID = 'KaboodleAddItemForm'; this.BANNER_ID='KaboodleAddItemBanner'; this.common = _common; this.window = _window; this.document = _document; this.body = _body; this.isTestingMode = function() { return self.K_TESTING != null ? self.K_TESTING : this.TESTING; } this.run = function(title, bgColor, color, params) { var banner = this.showBanner(title, bgColor, color); try { var obj = this; if (window.addEventListener) window.addEventListener("unload", function(){obj.hideBanner(banner)}, false); else if (window.attachEvent) window.attachEvent("unload", function(){obj.hideBanner(banner)}); } catch(e) { if (this.DEBUG) this.window.alert('Ignoring Exception: ' + e.message); } var extractor = new KaboodleExtractor(this.window, this.document, this.body); var charset = this.getCharset(); var content = extractor.extract(); if (params == null) params = new Array(); params['title'] = this.document.title; params['url'] = window.location.href; params['type'] = extractor.type; var htmlContent; var asin; if (/^http(s)?:\/\/.*disneystore.*\/.*/ig.test(window.location.href)){ if(document.getElementById("productDetails") && document.getElementById("productDetails").innerHTML){ params['type'] = 'rendered_html'; htmlContent = '' + document.getElementById("productDetails").innerHTML + ''; } }else if(/^http(s)?:\/\/(www\.)?gap.com\/.*/ig.test(window.location.href)){ if(document.getElementById("mainContent") && document.getElementById("mainContent").innerHTML){ params['type'] = 'rendered_html'; htmlContent = '' + document.getElementById("mainContent").innerHTML + ''; } }else if(/^http(s)?:\/\/(www\.)?endless.com\/.*/ig.test(window.location.href)){ if(document.getElementById("detailPage") && document.getElementById("detailPage").innerHTML){ params['type'] = 'rendered_html'; htmlContent = '' + document.getElementById("detailPage").innerHTML + ''; } }else if(/^http(s)?:\/\/(www\.)?bestbuy.com\/.*/ig.test(window.location.href)){ if(document.getElementById("content") && document.getElementById("content").innerHTML){ params['type'] = 'rendered_html'; htmlContent = '' + document.getElementById("content").innerHTML + ''; } }else if(/^http(s)?:\/\/(www\.)?nastygal.com\/.*/ig.test(window.location.href)){ if(document.getElementById("content") && document.getElementById("content").innerHTML){ params['type'] = 'rendered_html'; htmlContent = '' + document.getElementById("content").innerHTML + ''; } }else if(/^http(s)?:\/\/(www\.)?madamebridal.com\/.*/ig.test(window.location.href)){ if(document.getElementById("contentMainWrapper") && document.getElementById("contentMainWrapper").innerHTML){ params['type'] = 'rendered_html'; htmlContent = '' + document.getElementById("contentMainWrapper").innerHTML + ''; } }else if(/^http(s)?:\/\/(www\.)?abercrombie.com\/.*/ig.test(window.location.href)){ if(document.getElementById("product-content") && document.getElementById("product-content").innerHTML){ params['type'] = 'rendered_html'; htmlContent = '' + document.getElementById("product-content").innerHTML + ''; } }else if(/^http(s)?:\/\/(www\.)?abercrombiekids.com\/.*/ig.test(window.location.href)){ if(document.getElementById("product-content") && document.getElementById("product-content").innerHTML){ params['type'] = 'rendered_html'; htmlContent = '' + document.getElementById("product-content").innerHTML + ''; } }else if(/^http(s)?:\/\/(www\.)?alexandermcqueen.*\/.*/ig.test(window.location.href)){ if(document.body.innerHTML){ params['type'] = 'rendered_html'; htmlContent = '' + document.body.innerHTML + ''; } }else if(/^http(s)?:\/\/(www\.)?target.com\/.*/ig.test(window.location.href)){ if(document.getElementById("Main") && document.getElementById("Main").innerHTML){ params['type'] = 'rendered_html'; htmlContent = '' + document.getElementById("Main").innerHTML + ''; } }else if(/^http(s)?:\/\/(www\.)?amazon.com\/.*/ig.test(window.location.href)){ if(document.getElementById("divsinglecolumnminwidth") && document.getElementById("divsinglecolumnminwidth").innerHTML){ var image_content = ""; if(document.getElementById("original-main-image")){ image_content = document.getElementById("original-main-image").innerHTML +""; }else if(document.getElementById("main-image")){ image_content = document.getElementById("main-image").innerHTML +""; } //product-description-iframe var frameObj = document.getElementById('product-description-iframe'); var frameContent = ""; if(frameObj){ frameContent = frameObj.contentWindow.document.body.innerHTML; frameContent = '' + frameContent + ''; //alert("frame content : "+frameContent); } params['type'] = 'rendered_html'; htmlContent = '' + frameContent + document.getElementById("divsinglecolumnminwidth").innerHTML + ''; } } this.send(charset, content ,params,htmlContent,asin); return true; if (this.isTestingMode()) { this.showTextArea(charset, content, params); this.hideBanner(banner); this.common.removeDependentLibraries(); } else { this.send(charset, content, params); this.common.removeDependentLibraries(); } } this.getCharset = function() { if (this.document.getElementById && xDef(this.document.characterSet)) return this.document.characterSet; else if (xDef(this.document.charset)) return this.document.charset; else return 'ISO-8859-1'; } this.showBanner = function(title, bgColor, color) { if(this.overlayMode){ return null; } try { var element = this.common.createElement(this.document, 'DIV'); element.id = this.BANNER_ID; var style = 'font-family: Arial; font-size: 12pt; font-weight: bolder; ' + 'text-align: center; ' + 'height: 1em; position: absolute; ' + 'color: '+ color + '; background-color:'+ bgColor + '; ' + 'border: 1px solid black; ' + 'visibility: hidden; ' + 'top:0px; left:0px; z-index: 99999; ' + 'padding: 0.5em 0 0 0; ' + 'width: 100%; height: 2em; ' + 'filter:alpha(opacity=85); ' + '-moz-opacity:0.85; ' + 'opacity: 0.85; '; element.style.cssText = style; element.innerHTML = '  ' + title + '  '; this.body.appendChild(element); var pos = xCardinalPosition(element, 'n'); xMoveTo(element, pos.x, pos.y); element.style.visibility = 'visible'; return element; } catch(e) { if (this.DEBUG) this.window.alert('Caught Exception: ' + e.message); } return null; } this.hideBanner = function(element) { try { if (element) { this.body.removeChild(element); } } catch(e) { if (this.DEBUG) this.window.alert('Caught Exception: ' + e.message); } } this.send = function(charset, content, params, htmlContent, asin) { var form = this.common.createElement(this.document, 'form'); form.method = 'post'; form.action = this.FORM_POST_URL; form.enctype = 'multipart/form-data'; form.encoding = 'multipart/form-data'; form.id=this.FORM_ID; form.name=this.FORM_ID; form.style.visibility = 'hidden'; if(this.FORM_TARGET != null){ form.target = this.FORM_TARGET; } if(this.overlayMode){ this.addInput(this.document, form, 'hidden', 'overlay', true); } for (var param in params) { this.addInput(this.document, form, 'hidden', param, params[param]); } this.addInput(this.document, form, 'hidden', 'charset', charset); this.addInput(this.document, form, 'hidden', 'content', content); this.addInput(this.document, form, 'submit', 'button', 'submit'); if(htmlContent){ this.addInput(this.document, form, 'hidden', 'htmlContent', htmlContent); } if(asin){ this.addInput(this.document, form, 'hidden', 'asin', asin); } this.body.appendChild(form); form.submit(); this.body.removeChild(form); }; this.showTextArea = function(charset, content, params) { var form = this.body.insertBefore(this.common.createElement(this.document, 'form'), this.body.firstChild); form.method='post'; form.enctype='multipart/form-data'; form.id=this.FORM_ID; form.name=this.FORM_ID; var textarea=form.appendChild(this.common.createElement(this.document, 'textarea')); textarea.setAttribute('rows','30'); textarea.setAttribute('cols','100'); var text = new Array(); for (var param in params) { var value = params[param]; if (typeof value == 'string') text.push(param + '=' + params[param]); } text.push('charset=' + charset); text.push(content); textarea.value = text.join('\n'); form.appendChild(this.common.createElement(this.document, 'br')); var submit=this.common.createElement(this.document, 'input'); submit.setAttribute('type','submit'); submit.setAttribute('onclick', 'javascript:window.document.getElementsByTagName(\'body\')[0].removeChild(window.document.getElementById(\'' + this.FORM_ID + '\')); return false;'); submit.value = 'Discard'; form.appendChild(submit); }; this.addInput = function(doc, form, type, name, value) { var e = this.common.createElement(doc, 'input'); e.type = type; e.name = name; e.value = value; form.appendChild(e); } this.addQueryStringParam = function(name, value) { return '&' + name + '=' + encodeURIComponent(value); } }function KaboodleExtractor(_window, _document, _body) { // If true, exceptions are shown in alert box. this.DEBUG = false; this.CSS_FONT_SIZE_LITERALS = new Array(); this.CSS_FONT_SIZE_LITERALS['xx-small'] = 10; this.CSS_FONT_SIZE_LITERALS['x-small'] = 13; this.CSS_FONT_SIZE_LITERALS['small'] = 16; this.CSS_FONT_SIZE_LITERALS['medium'] = 18; this.CSS_FONT_SIZE_LITERALS['large'] = 24; this.CSS_FONT_SIZE_LITERALS['x-large'] = 32; this.CSS_FONT_SIZE_LITERALS['xx-large'] = 48; this.CSS_FONT_SIZE_LITERALS['1'] = 10; this.CSS_FONT_SIZE_LITERALS['2'] = 13; this.CSS_FONT_SIZE_LITERALS['3'] = 18; this.CSS_FONT_SIZE_LITERALS['4'] = 24; this.CSS_FONT_SIZE_LITERALS['5'] = 32; this.CSS_FONT_SIZE_LITERALS['6'] = 48; this.CSS_FONT_SIZE_LITERALS['7'] = 64; this.microformat = null; this.type = 'custom'; this.window = _window; this.document = _document; this.body = _body; this.view = _document.defaultView; this.timestamp = null; this.nonws = /\S/; this.quote = /([\"\\])/g; this.reservedChars = /([#@\\\{\}\[\]])/g; this.breakingTags = /^(P|DIV|H[R1-6]|TABLE|TR)$/i; this.ignoreTags = /^(BUTTON|TEXTAREA)$/i; this.headerTags = /^(H[1-6])$/i; this.imageTags = /^(IMG|V:IMAGEDATA|EMBED|OBJECT)$/i; this.fontWeights = /\d+/i; this.fontSizes = /^\d+(\.\d+)?(pc|pt|px|em|ex|%)$/i; this.http = /^http(s)?:\/\//ig; this.hex = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); this.imageArray = new Array('', '', '', ''); this.positionArray = new Array('', ''); this.fontArray = new Array('', '', '', '',''); this.currentStyle = null; this.structures = null; this.states = null; this.breaks = 0; this.href = false; this.header = false; this.id = 0; this.start = function(msg) { this.window.alert(msg); this.timestamp = new Date().getTime(); } this.split = function(msg) { var split = new Date().getTime(); this.window.alert(msg + ": " + (split - this.timestamp) + "ms"); this.timestamp = new Date().getTime(); } this.extract = function() { this.microformat = this.getMicroformat(window.location); if (this.DEBUG) this.start("Extracting using " + this.type); var content = new Array(); content.push('!HTML' + this.printAttributeNodes(this.document.documentElement)); content.push('!TITLE ' + this.document.title); var base = this.document.getElementsByTagName("base"); if (base && base.length > 0) { content.push('!BASE' + this.printAttributeNodes(base[0])); } else if (this.window != window) { content.push('!BASE href="' + this.window.location + '"'); } var meta = this.document.getElementsByTagName("meta"); if (meta) { for (var i = 0; i < meta.length; ++i) { content.push('!META' + this.printAttributeNodes(meta[i])); } } var link = this.document.getElementsByTagName("link"); if (link) { for (var i = 0; i < link.length; ++i) { if (link[i].getAttribute("rel") == "image_src") { content.push('!LINK' + this.printAttributeNodes(link[i])); } } } var text = new Array(); var images = new Array(); try { this.extractNode(text, images, this.body); } catch (e) { if (this.DEBUG) throw e; } for (var src in images) { var href = false; var image = images[src]; if (typeof image == 'object') { var params = new Array(); params.push(this.printAttribute('src', src)); for (var param in image) { switch (param) { case 'x': case 'y': case 'width': case 'height': case 'structure': break; case 'href': href = image[param]; break; default: var value = image[param]; if (typeof value == 'string') params.push(this.printAttribute(param, value)); } } var str = new Array(); str.push(this.toHex(image['x'])); str.push(':'); str.push(this.toHex(image['y'])); str.push(':'); str.push(this.toHex(image['width'])); str.push(':'); str.push(this.toHex(image['height'])); str.push('['); str.push(this.toHex(image['id'])); str.push(']'); if (href) str.push('@'); str.push(' '); str.push(params.join(' ').replace(/\s+/g, ' ')); content.push(str.join('')); } } for (var i = 0; i < text.length; ++i) { content.push(text[i]); } if (this.DEBUG) this.split("Time to extract"); return content.join('\n'); } this.extractNode = function(content, images, node, offsets, frameSrc) { this.structures = new Array(); this.states = new Array(); this.breaks = 0; this.href = false; this.header = false; var length = 0; if (node) { var text = null; var small = false; var backup = false; var ids = new Array(); var parents = new Array(); node = node.firstChild; while (node && length < 15360) { if (backup) { if (parents.length == 0) break; node = parents.pop(); var tag = node.tagName; if (tag) tag = tag.toLowerCase(); if (tag == 'a') { this.href = false; } else if (tag == 'table' || tag == 'ol' || tag == 'ul' || tag == 'dl') { if (this.states.pop() > 0) { if (!text) content.push(content.pop() + '}'); else text.push('}'); } this.structures.pop(); } else if (tag == 'tr') { this.breaks &= ~2; } else if (tag == 'td' || tag == 'th') { this.breaks &= ~4; } else if (tag == 'li' || tag == 'dt') { this.breaks &= ~8; } else if (tag == 'small') { small = false; } else if (tag == 'input') { this.breaks &= ~16; } else if (this.headerTags.test(tag)) { this.header = false; } if ((node.id && this.microformat["#" + node.id]) || (node.className && this.microformat["." + node.className])) { if (this.states.pop() > 0) { if (!text) content.push(content.pop() + '}'); else text.push('}'); } this.structures.pop(); } if (text) { if (this.breakingTags.test(tag)) { var str = text.join('').replace(/\s+/g, ' '); content.push(str); length += str.length; text = null; this.breaks = 0; } } if (node.nextSibling) { node = node.nextSibling; backup = false; } } else if (node.nodeType == 1) { var tag = node.tagName; if (tag) tag = tag.toLowerCase(); var style; var hidden; var block; if (this.view && this.view.getComputedStyle) { style = this.view.getComputedStyle(node, ''); if (style) { hidden = style.getPropertyValue("visibility") == "hidden" || style.getPropertyValue("display") == "none"; } else { hidden = true; } block = style.getPropertyValue("display") == "block"; } else if (node.currentStyle) { hidden = node.currentStyle["visibility"] == "hidden" || node.currentStyle["display"] == "none" block = node.currentStyle["display"] == "block"; } if (hidden || this.ignoreTags.test(tag) || (node.id && node.id.substr && node.id.substr(0, 8)== 'Kaboodle')) { if (node.nextSibling) node = node.nextSibling; else backup = true; } else if (this.imageTags.test(tag)) { var image = this.extractImage(images, node, offsets, frameSrc); if (image) { if (!text) { text = new Array(); text.push(this.getNodePosition(node.parentNode, offsets)); } this.appendImage(text, image); } if (node.nextSibling) node = node.nextSibling; else backup = true; } else if (tag == 'iframe') { this.extractFrame(content, images, node, offsets); if (node.nextSibling) node = node.nextSibling; else backup = true; } else if (tag == 'select') { var value = node.options[node.selectedIndex].text; if (value) { if (!text) { text = new Array(); text.push(this.getNodePosition(node, offsets)); } this.append(text, value, this.getFontInfo(node, small)); } if (node.nextSibling) node = node.nextSibling; else backup = true; } else if (tag == 'input') { var type = node.getAttribute('type'); var value = node.getAttribute('value'); if (type == 'text' && value) { if (!text) { text = new Array(); text.push(this.getNodePosition(node, offsets)); } this.breaks |= 16; this.append(text, value, this.getFontInfo(node, small)); } if (node.nextSibling) node = node.nextSibling; else backup = true; } else { if (text) { if (this.breakingTags.test(tag)) { var str = text.join('').replace(/\s+/g, ' '); content.push(str); length += str.length; text = null; this.breaks = 0; } } if (text && (tag == 'br' || block)) { this.breaks |= 1; } if (node.firstChild) { if (node.id && this.microformat["#" + node.id]) { this.structures.push(this.microformat["#" + node.id]); this.states.push(0); } else if (node.className && this.microformat["." + node.className]) { this.structures.push(this.microformat["." + node.className]); this.states.push(0); } else if (node.className && this.microformat["?" + node.className]) { if (this.microformat["?" + node.className] == "br") { this.breaks |= 16; } } if (tag == 'a') { this.href = true; } else if (tag == 'table') { this.structures.push('t'); this.states.push(0); } else if (tag == 'ol' || tag == 'ul' || tag == 'dl') { this.structures.push('l'); this.states.push(0); } else if (tag == 'tr') { this.breaks |= 2; } else if (tag == 'td' || tag == 'th') { this.breaks |= 4; } else if (tag == 'li' || tag == 'dt') { this.breaks |= 8; } else if (tag == 'small') { small = true; } else if (this.headerTags.test(tag)) { this.header = true; } parents.push(node); node = node.firstChild; } else if (node.nextSibling) node = node.nextSibling; else backup = true; } } else if (node.nodeType == 3) { if (this.nonws.test(node.nodeValue)) { if (!text) { text = new Array(); text.push(this.getNodePosition(node.parentNode, offsets)); } this.append(text, node.nodeValue, this.getFontInfo(node.parentNode, small)); } else if (text && text.length > 0) { text.push(' '); } if (node.nextSibling) node = node.nextSibling; else backup = true; } else if (node.nextSibling) node = node.nextSibling; else backup = true; } if (text) { var str = text.join('').replace(/\s+/g, ' '); content.push(str); length += str.length; text = null; } } } this.append = function(text, value, style) { var prefix = ''; var structure = ''; for (var i = this.states.length - 1; i >= 0 && this.states[i] == 0; --i) { structure = this.structures[i] + structure; this.states[i] = 1; } if (structure.length > 0) prefix += '{' + structure; if (this.breaks != 0) { prefix += '@' + this.toHex(this.breaks); this.breaks = 0; } if (style != this.currentStyle) { prefix += '#' + style; this.currentStyle = style; } if (prefix.length > 0) text.push(text.pop() + prefix + ';'); else if (text.length == 1) text.push(text.pop() + ' '); // Need double escaped quotes since when included in JSP the text.push(value.replace(this.reservedChars, '\\\$&')); } this.appendImage = function(text, image) { var prefix = ''; var structure = ''; for (var i = this.states.length - 1; i >= 0 && this.states[i] == 0; --i) { structure = this.structures[i] + structure; this.states[i] = 1; } if (structure.length > 0) prefix += '{' + structure; if (this.breaks != 0) { prefix += '@' + this.toHex(this.breaks); this.breaks = 0; } if (prefix.length > 0) text.push(text.pop() + prefix + ';'); else if (text.length == 1) text.push(text.pop() + ' '); text.push('[' + this.toHex(image['id']) + ']'); } this.extractImage = function(images, node, offsets, frameSrc) { var src = null; var attrs = new Array(); this.findNodePosition(node, attrs, 10, offsets); attrs['width'] = xWidth(node); attrs['height'] = xHeight(node); if (node.nodeName.toLowerCase() == 'object') { src = node.getAttribute('data'); //attrs['width'] = node.getAttribute('width'); //attrs['height'] = node.getAttribute('height'); attrs['type'] = 'application/x-shockwave-flash'; attrs['flashvars'] = this.customFlashVars(node); for (var child = node.firstChild; child != null; child = child.nextSibling) { if (child.nodeType == 1) { var tag = child.tagName.toLowerCase(); if (tag == 'param') { var name = child.getAttribute('name'); if (name) { name = name.toLowerCase(); var value = child.getAttribute('value'); if (name == 'movie') { src = value; } else if (name == 'base' || name == 'flashvars') { attrs[name] = value; } } } else if (tag == 'embed' && !xIE4Up) { this.findNodePosition(child, attrs, 10, offsets); attrs['width'] = xWidth(child); attrs['height'] = xHeight(child); } } } } else if (node.nodeName.toLowerCase() == 'embed') { if (node.getAttribute('type') == 'application/x-shockwave-flash') { src = node.getAttribute('src'); attrs['type'] = 'application/x-shockwave-flash'; attrs['flashvars'] = this.customFlashVars(node); if (node.getAttribute('base')) attrs['base'] = node.getAttribute('base'); if (node.getAttribute('flashvars')) attrs['flashvars'] = node.getAttribute('flashvars'); } } else { src = node.getAttribute('src'); if(!src){ return false; } } var image = images[src]; if ((image != null && attrs['width'] * attrs['height'] > image['width'] * image['height']) || (image == null && attrs['width'] >= 50 && attrs['height'] >= 50)) { if (node.getAttribute('alt')) attrs['alt'] = node.getAttribute('alt'); if (!this.http.test(src) && frameSrc) attrs['frame'] = frameSrc; attrs['href'] = this.href; if (image) attrs['id'] = image['id']; else attrs['id'] = this.id++; images[src] = attrs; return attrs; } return image; } this.extractFrame = function(content, images, frame, offsets) { if (this.DEBUG) window.alert('Extracting iframe: ' + frame.src); if (frame.src != 'about:blank') { var frameDocument = null; var frameBody = null try { frameDocument = frame.contentWindow ? frame.contentWindow.document : frame.contentDocument; frameBody = frameDocument.body ? frameDocument.body : frameDocument.getElementsByTagName('body')[0]; } catch (e) {} if (frameBody != null) { var frameOffsets = new Array(); this.findNodePosition(frame, frameOffsets, 10, offsets); this.extractNode(content, images, frameBody, frameOffsets, frame.src); } } } this.getNodePosition = function(node, offsets) { this.findNodePosition(node, this.positionArray, 10, offsets); return this.toHex(this.positionArray['x']) + ':' + this.toHex(this.positionArray['y']); } this.getFontInfo = function(node, small) { // The format expects the ':' separator even if there is // no value, don't change the order of the values either // as they are expected in this order by the server-side. if (this.view && this.view.getComputedStyle) { var style = this.view.getComputedStyle(node, ''); if (style != null) { this.fontArray[0] = this.toHex(this.getFontSize(node, style.getPropertyValue("font-size"))); this.fontArray[1] = this.getFontWeight(style.getPropertyValue("font-weight")); this.fontArray[2] = this.getFontStyle(style.getPropertyValue("font-style")); this.fontArray[3] = this.getTextDecoration(style.getPropertyValue("text-decoration")); } } else if (node.currentStyle) { this.fontArray[0] = this.toHex(this.getFontSize(node, node.currentStyle["fontSize"])); this.fontArray[1] = this.getFontWeight(node.currentStyle["fontWeight"]); this.fontArray[2] = this.getFontStyle(node.currentStyle["fontStyle"]); this.fontArray[3] = this.getTextDecoration(node.currentStyle["textDecoration"]); if (small) { this.fontArray[0] *= 3 / 4; } } var style = 0; if (this.header) style |= 1; if (this.href) style |= 2; this.fontArray[4] = style != 0 ? style : ''; return this.fontArray.join(':'); } this.getFontWeight = function(style) { if (style) { if (this.fontWeights.test(style)) { if (parseInt(style) > 400) { return 'b'; } } else { style = style.toLowerCase ? style.toLowerCase() : style; switch (style) { case 'bold': case 'bolder': return 'b'; } } } return ''; } this.getFontStyle = function(style) { if (style) { style = style.toLowerCase(); if (style != 'normal') { return style.charAt(0); } } return ''; } this.getTextDecoration = function(style) { if (style) { style = style.toLowerCase(); if (style != 'none') { return style.charAt(0); } } return ''; } this.getFontSize = function(node, style) { if (style) { style = style.toLowerCase ? style.toLowerCase() : style; if (this.fontSizes.test(style)) { var postfix; var size; if (style.charAt(style.length - 1) == '%') { postfix = '%'; size = parseInt(style.substr(0, style.length - 1)); } else { postfix = style.substr(style.length - 2); size = parseInt(style.substr(0, style.length - 2)); } switch (postfix) { case 'pt': return size * 4.0 / 3.0; case 'pc': return size * 16; case 'px': return size; case 'em': case 'ex': case '%': var parentStyle; if (this.view && this.view.getComputedStyle) { parentStyle = this.view.getComputedStyle(node, '').getPropertyValue("font-size"); } else if (node.currentStyle) { parentStyle = node.currentStyle["fontSize"]; } if (postfix == '%') { return this.getFontSize(node.parentNode, parentStyle) * size / 100.0; } else if (postfix == 'ex') { return this.getFontSize(node.parentNode, parentStyle) * size / 5.0 * 8.0; } else { return this.getFontSize(node.parentNode, parentStyle) * size; } default: return size * 4.0 / 3.0; } } else { var size = this.CSS_FONT_SIZE_LITERALS[style]; if (size) { return size; } else { var parentStyle; if (this.view && this.view.getComputedStyle) { parentStyle = this.view.getComputedStyle(node, '').getPropertyValue("font-size"); } else if (node.currentStyle) { parentStyle = node.currentStyle["fontSize"]; } if ('smaller' == style) { return this.getFontSize(node.parentNode, parentStyle) * 4.0 / 5.0; } else if ('larger' == style) { return this.getFontSize(node.parentNode, parentStyle) * 5.0 / 4.0; } else if (style.charAt(0) == '-') { size = this.getFontSize(node.parentNode, parentStyle); for (var i = -parseInt(style); i > 0; --i) { size *= 4.0 / 5.0; } return size; } else if (style.charAt(0) == '+') { var max = this.CSS_FONT_SIZE_LITERALS['7']; size = this.getFontSize(node.parentNode, parentStyle); for (var i = parseInt(style); i > 0 && size < max; --i) { size *= 5.0 / 4.0; } return size < max ? size : max; } } } } return 16; } this.findNodePosition = function(obj, pos, scale, offsets) { var x = 0; var y = 0; if(obj.offsetParent) { while(obj.offsetParent) { x += obj.offsetLeft; y += obj.offsetTop; obj = obj.offsetParent; } } else { if (obj.x) x += obj.x; if (obj.y) y += obj.y; } if (offsets) { pos['x'] = offsets['x'] + parseInt(x / scale); pos['y'] = offsets['y'] + parseInt(y / scale); } else { pos['x'] = parseInt(x / scale); pos['y'] = parseInt(y / scale); } } this.printAttribute = function(name, value) { // Need double escaped quotes since when included in JSP the return name + '="' + value.replace(/[\n]/g, ' ').replace(/[\r]/g, '').replace(this.quote, '\\\$&') + '"'; }; this.printAttributeNodes = function(n) { if (n.attributes) { var attrs = n.attributes; var attr; var ret = new Array(); for(var i=0; i < attrs.length; i++) { attr = attrs[i]; if(attr.value != '' && attr.value != 'null') { if(attr.name.toLowerCase() == 'src') { if(xDef(n.src)) { // if node itself has a src value, use that ret.push(' ' + this.printAttribute(attr.name, n.src)); } else { ret.push(' ' + this.printAttribute(attr.name, attr.value)); } } else { ret.push(' ' + this.printAttribute(attr.name, attr.value)); } } } return ret.join(''); } return ''; } this.toHex = function(num) { var value = this.hex[num & 15]; while(num > 15) { num >>= 4; value = this.hex[num & 15] + value; } return value; } this.customFlashVars = function(node) { if (typeof(MACYS) != 'undefined' && typeof(MACYS.pdp) != 'undefined' && typeof(MACYS.pdp.defaultProdImgLarge) != 'undefined') return "altUrl=" + MACYS.pdp.defaultProdImgLarge; return ""; } this.getMicroformat = function(url) { var microformat = new Array(); if (/^http(s)?:\/\/.*amazon..*\/.*/ig.test(url)) { microformat['#btAsinTitle'] = 'T'; microformat['#productDescription'] = 'D'; microformat['#priceBlock'] = 'P'; microformat['#prodImageCell'] = 'I'; } else if (/^http(s)?:\/\/.*ae.com\/.*/ig.test(url)) { microformat['#prod_equity'] = 'T'; microformat['#product_price'] = 'P'; microformat['#product_description'] = 'D'; } else if (/^http(s)?:\/\/.*anthropologie.com\/.*/ig.test(url)) { microformat['.price'] = 'P'; } else if (/^http(s)?:\/\/.*bestbuy.com\/.*/ig.test(url)) { microformat['#priceblock'] = 'P'; } else if (/^http(s)?:\/\/.*ebay.com\/.*/ig.test(url)) { microformat['#EBdescription'] = 'D'; } else if (/^http(s)?:\/\/.*endless.com\/.*/ig.test(url)) { microformat['#prodTitle'] = 'T'; microformat['#prodDescription'] = 'D'; microformat['#prodBullets'] = 'D'; microformat['#prodAbout'] = 'D'; microformat['#ddmp'] = 'P'; } else if (/^http(s)?:\/\/.*forever21.com\/.*/ig.test(url)) { microformat['.items_name'] = 'T'; } else if (/^http(s)?:\/\/.*karmaloop.com\/.*/ig.test(url)) { microformat['?text-med'] = 'br'; } else if (/^http(s)?:\/\/.*macys.com\/.*/ig.test(url)) { microformat['.productDetailLong'] = 'D'; } else if (/^http(s)?:\/\/.*zappos.com\/.*/ig.test(url)) { microformat['#prDesc'] = 'D'; } else if (/^http(s)?:\/\/.*neimanmarcus.com\/.*/ig.test(url)) { microformat['.lineItemInfo'] = 'P'; } if (this.DEBUG) this.window.alert("microformat=[" + this.map(microformat) + "]"); return microformat; } this.map = function(obj) { var params = new Array(); for (var param in obj) { var value = obj[param]; if (typeof value == 'string') params.push(this.printAttribute(param, value)); } return params.join(','); } }if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={}}YAHOO.namespace=function(){var a=arguments,b=null,d,e,c;for(d=0;d0)?f.dump(o[m],j-1):g)}else{h.push(o[m])}h.push(i)}if(h.length>1){h.pop()}h.push("]")}else{h.push("{");for(m in o){if(f.hasOwnProperty(o,m)){h.push(m+l);if(f.isObject(o[m])){h.push((j>0)?f.dump(o[m],j-1):g)}else{h.push(o[m])}h.push(i)}}if(h.length>1){h.pop()}h.push("}")}return h.join("")},substitute:function(g,u,n){var q,r,s,k,j,h,l=[],t,p="dump",m=" ",v="{",i="}",o;for(;;){q=g.lastIndexOf(v);if(q<0){break}r=g.indexOf(i,q);if(q+1>=r){break}t=g.substring(q+1,r);k=t;h=null;s=k.indexOf(m);if(s>-1){h=k.substring(s+1);k=k.substring(0,s)}j=u[k];if(n){j=n(k,j,h)}if(f.isObject(j)){if(f.isArray(j)){j=f.dump(j,parseInt(h,10))}else{h=h||"";o=h.indexOf(p);if(o>-1){h=h.substring(4)}if(j.toString===a.toString||o>-1){j=f.dump(j,parseInt(h,10))}else{j=j.toString()}}}else{if(!f.isString(j)&&!f.isNumber(j)){j="~-"+l.length+"-~";l[l.length]=t}}g=g.substring(0,q)+j+g.substring(r+1)}for(q=l.length-1;q>=0;q=q-1){g=g.replace(new RegExp("~-"+q+"-~"),"{"+l[q]+"}","g")}return g},trim:function(h){try{return h.replace(/^\s+|\s+$/g,"")}catch(g){return h}},merge:function(){var g={},i=arguments,j=i.length,h;for(h=0;h519)?true:false);while((b=b[aw])){e[0]+=b[aP];e[1]+=b[ae];if(c){e=ao.Dom._calcBorders(b,e)}}if(ao.Dom._getStyle(h,aB)!==aL){b=h;while((b=b[x])&&b[aq]){f=b[aI];d=b[af];if(am&&(ao.Dom._getStyle(b,"overflow")!=="visible")){e=ao.Dom._calcBorders(b,e)}if(f||d){e[0]-=d;e[1]-=f}}e[0]+=a;e[1]+=g}else{if(ap){e[0]-=a;e[1]-=g}else{if(al||am){e[0]+=a;e[1]+=g}}}e[0]=Math.floor(e[0]);e[1]=Math.floor(e[1])}else{}return e}}}(),getX:function(a){var b=function(c){return ao.Dom.getXY(c)[0]};return ao.Dom.batch(a,b,ao.Dom,true)},getY:function(a){var b=function(c){return ao.Dom.getXY(c)[1]};return ao.Dom.batch(a,b,ao.Dom,true)},setXY:function(b,a,c){ao.Dom.batch(b,ao.Dom._setXY,{pos:a,noRetry:c})},_setXY:function(i,f){var e=ao.Dom._getStyle(i,aB),g=ao.Dom.setStyle,b=f.pos,a=f.noRetry,d=[parseInt(ao.Dom.getComputedStyle(i,aH),10),parseInt(ao.Dom.getComputedStyle(i,aC),10)],c,h;if(e=="static"){e=G;g(i,aB,e)}c=ao.Dom._getXY(i);if(!b||c===false){return false}if(isNaN(d[0])){d[0]=(e==G)?0:i[aP]}if(isNaN(d[1])){d[1]=(e==G)?0:i[ae]}if(b[0]!==null){g(i,aH,b[0]-c[0]+d[0]+"px")}if(b[1]!==null){g(i,aC,b[1]-c[1]+d[1]+"px")}if(!a){h=ao.Dom._getXY(i);if((b[0]!==null&&h[0]!=b[0])||(b[1]!==null&&h[1]!=b[1])){ao.Dom._setXY(i,{pos:b,noRetry:true})}}},setX:function(b,a){ao.Dom.setXY(b,[a,null])},setY:function(a,b){ao.Dom.setXY(a,[null,b])},getRegion:function(a){var b=function(c){var d=false;if(ao.Dom._canPosition(c)){d=ao.Region.getRegion(c)}else{}return d};return ao.Dom.batch(a,b,ao.Dom,true)},getClientWidth:function(){return ao.Dom.getViewportWidth()},getClientHeight:function(){return ao.Dom.getViewportHeight()},getElementsByClassName:function(f,b,e,c,j,d){f=ai.trim(f);b=b||"*";e=(e)?ao.Dom.get(e):null||aj;if(!e){return[]}var a=[],k=e.getElementsByTagName(b),h=ao.Dom.hasClass;for(var i=0,g=k.length;i-1}}else{}return b},addClass:function(b,a){return ao.Dom.batch(b,ao.Dom._addClass,a)},_addClass:function(a,c){var b=false,d;if(a&&c){d=ao.Dom.getAttribute(a,an)||ak;if(!ao.Dom._hasClass(a,c)){ao.Dom.setAttribute(a,an,at(d+ar+c));b=true}}else{}return b},removeClass:function(b,a){return ao.Dom.batch(b,ao.Dom._removeClass,a)},_removeClass:function(f,a){var e=false,d,c,b;if(f&&a){d=ao.Dom.getAttribute(f,an)||ak;ao.Dom.setAttribute(f,an,d.replace(ao.Dom._getClassRegex(a),ak));c=ao.Dom.getAttribute(f,an);if(d!==c){ao.Dom.setAttribute(f,an,at(c));e=true;if(ao.Dom.getAttribute(f,an)===""){b=(f.hasAttribute&&f.hasAttribute(aK))?aK:an;f.removeAttribute(b)}}}else{}return e},replaceClass:function(a,c,b){return ao.Dom.batch(a,ao.Dom._replaceClass,{from:c,to:b})},_replaceClass:function(g,a){var f,c,e,b=false,d;if(g&&a){c=a.from;e=a.to;if(!e){b=false}else{if(!c){b=ao.Dom._addClass(g,a.to)}else{if(c!==e){d=ao.Dom.getAttribute(g,an)||ak;f=(ar+d.replace(ao.Dom._getClassRegex(c),ar+e)).split(ao.Dom._getClassRegex(e));f.splice(1,0,ar+e);ao.Dom.setAttribute(g,an,at(f.join(ak)));b=true}}}}else{}return b},generateId:function(b,a){a=a||"yui-gen";var c=function(e){if(e&&e.id){return e.id}var d=a+YAHOO.env._id_counter++;if(e){if(e[aM].getElementById(d)){return ao.Dom.generateId(e,d+a)}e.id=d}return d};return ao.Dom.batch(b,c,ao.Dom,true)||c.apply(ao.Dom,arguments)},isAncestor:function(c,a){c=ao.Dom.get(c);a=ao.Dom.get(a);var b=false;if((c&&a)&&(c[aF]&&a[aF])){if(c.contains&&c!==a){b=c.contains(a)}else{if(c.compareDocumentPosition){b=!!(c.compareDocumentPosition(a)&16)}}}else{}return b},inDocument:function(a,b){return ao.Dom._inDoc(ao.Dom.get(a),b)},_inDoc:function(c,a){var b=false;if(c&&c[aq]){a=a||c[aM];b=ao.Dom.isAncestor(a[av],c)}else{}return b},getElementsBy:function(a,b,f,d,i,e,c){b=b||"*";f=(f)?ao.Dom.get(f):null||aj;if(!f){return[]}var j=[],k=f.getElementsByTagName(b);for(var h=0,g=k.length;h=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom)};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left))};YAHOO.util.Region.prototype.intersect=function(b){var d=Math.max(this.top,b.top),c=Math.min(this.right,b.right),a=Math.min(this.bottom,b.bottom),e=Math.max(this.left,b.left);if(a>=d&&c>=e){return new YAHOO.util.Region(d,c,a,e)}else{return null}};YAHOO.util.Region.prototype.union=function(b){var d=Math.min(this.top,b.top),c=Math.max(this.right,b.right),a=Math.max(this.bottom,b.bottom),e=Math.min(this.left,b.left);return new YAHOO.util.Region(d,c,a,e)};YAHOO.util.Region.prototype.toString=function(){return("Region {top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+", height: "+this.height+", width: "+this.width+"}")};YAHOO.util.Region.getRegion=function(d){var b=YAHOO.util.Dom.getXY(d),e=b[1],c=b[0]+d.offsetWidth,a=b[1]+d.offsetHeight,f=b[0];return new YAHOO.util.Region(e,c,a,f)};YAHOO.util.Point=function(a,b){if(YAHOO.lang.isArray(a)){b=a[1];a=a[0]}YAHOO.util.Point.superclass.constructor.call(this,b,a,b,a)};YAHOO.extend(YAHOO.util.Point,YAHOO.util.Region);(function(){var v=YAHOO.util,w="clientTop",r="clientLeft",n="parentNode",m="right",a="hasLayout",o="px",c="opacity",l="auto",t="borderLeftWidth",q="borderTopWidth",h="borderRightWidth",b="borderBottomWidth",e="visible",g="transparent",j="height",s="width",p="style",d="currentStyle",f=/^width|height$/,i=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,k={get:function(A,y){var z="",x=A[d][y];if(y===c){z=v.Dom.getStyle(A,c)}else{if(!x||(x.indexOf&&x.indexOf(o)>-1)){z=x}else{if(v.Dom.IE_COMPUTED[y]){z=v.Dom.IE_COMPUTED[y](A,y)}else{if(i.test(x)){z=v.Dom.IE.ComputedStyle.getPixel(A,y)}else{z=x}}}}return z},getOffset:function(A,z){var x=A[d][z],E=z.charAt(0).toUpperCase()+z.substr(1),D="offset"+E,C="pixel"+E,y="",B;if(x==l){B=A[D];if(B===undefined){y=0}y=B;if(f.test(z)){A[p][z]=B;if(A[D]>B){y=B-(A[D]-B)}A[p][z]=l}}else{if(!A[p][C]&&!A[p][z]){A[p][z]=x}y=A[p][C]}return y+o},getBorderWidth:function(z,x){var y=null;if(!z[d][a]){z[p].zoom=1}switch(x){case q:y=z[w];break;case b:y=z.offsetHeight-z.clientHeight-z[w];break;case t:y=z[r];break;case h:y=z.offsetWidth-z.clientWidth-z[r];break}return y+o},getPixel:function(A,B){var y=null,x=A[d][m],z=A[d][B];A[p][m]=z;y=A[p].pixelRight;A[p][m]=x;return y+o},getMargin:function(y,z){var x;if(y[d][z]==l){x=0+o}else{x=v.Dom.IE.ComputedStyle.getPixel(y,z)}return x},getVisibility:function(y,z){var x;while((x=y[d])&&x[z]=="inherit"){y=y[n]}return(x)?x[z]:e},getColor:function(x,y){return v.Dom.Color.toRGB(x[d][y])||g},getBorderColor:function(z,A){var y=z[d],x=y[A]||y.color;return v.Dom.Color.toRGB(v.Dom.Color.toHex(x))}},u={};u.top=u.right=u.bottom=u.left=u[s]=u[j]=k.getOffset;u.color=k.getColor;u[q]=u[h]=u[b]=u[t]=k.getBorderWidth;u.marginTop=u.marginRight=u.marginBottom=u.marginLeft=k.getMargin;u.visibility=k.getVisibility;u.borderColor=u.borderTopColor=u.borderRightColor=u.borderBottomColor=u.borderLeftColor=k.getBorderColor;v.Dom.IE_COMPUTED=u;v.Dom.IE_ComputedStyle=k})();(function(){var c="toString",a=parseInt,d=RegExp,b=YAHOO.util;b.Dom.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(e){if(!b.Dom.Color.re_RGB.test(e)){e=b.Dom.Color.toHex(e)}if(b.Dom.Color.re_hex.exec(e)){e="rgb("+[a(d.$1,16),a(d.$2,16),a(d.$3,16)].join(", ")+")"}return e},toHex:function(e){e=b.Dom.Color.KEYWORDS[e]||e;if(b.Dom.Color.re_RGB.exec(e)){var f=(d.$1.length===1)?"0"+d.$1:Number(d.$1),g=(d.$2.length===1)?"0"+d.$2:Number(d.$2),h=(d.$3.length===1)?"0"+d.$3:Number(d.$3);e=[f[c](16),g[c](16),h[c](16)].join("")}if(e.length<6){e=e.replace(b.Dom.Color.re_hex3,"$1$1")}if(e!=="transparent"&&e.indexOf("#")<0){e="#"+e}return e.toLowerCase()}}}());YAHOO.register("dom",YAHOO.util.Dom,{version:"2.7.0",build:"1796"});YAHOO.util.CustomEvent=function(c,d,e,a){this.type=c;this.scope=d||window;this.silent=e;this.signature=a||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var b="_YUICEOnSubscribe";if(c!==b){this.subscribeEvent=new YAHOO.util.CustomEvent(b,this,true)}this.lastError=null};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(a,c,b){if(!a){throw new Error("Invalid callback for subscriber to '"+this.type+"'")}if(this.subscribeEvent){this.subscribeEvent.fire(a,c,b)}this.subscribers.push(new YAHOO.util.Subscriber(a,c,b))},unsubscribe:function(d,b){if(!d){return this.unsubscribeAll()}var c=false;for(var f=0,a=this.subscribers.length;f0){c=i[0]}try{k=e.fn.call(f,c,e.obj)}catch(l){this.lastError=l;if(d){throw l}}}else{try{k=e.fn.call(f,this.type,i,e.obj)}catch(j){this.lastError=j;if(d){throw j}}}if(false===k){if(!this.silent){}break}}}return(k!==false)},unsubscribeAll:function(){var a=this.subscribers.length,b;for(b=a-1;b>-1;b--){this._delete(b)}this.subscribers=[];return a},_delete:function(a){var b=this.subscribers[a];if(b){delete b.fn;delete b.obj}this.subscribers.splice(a,1)},toString:function(){return"CustomEvent: '"+this.type+"', context: "+this.scope}};YAHOO.util.Subscriber=function(a,c,b){this.fn=a;this.obj=YAHOO.lang.isUndefined(c)?null:c;this.overrideContext=b};YAHOO.util.Subscriber.prototype.getScope=function(a){if(this.overrideContext){if(this.overrideContext===true){return this.obj}else{return this.overrideContext}}return a};YAHOO.util.Subscriber.prototype.contains=function(a,b){if(b){return(this.fn==a&&this.obj==b)}else{return(this.fn==a)}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", overrideContext: "+(this.overrideContext||"no")+" }"};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var i=false;var h=[];var g=[];var j=[];var l=[];var b=0;var k=[];var c=[];var d=0;var a={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var f=YAHOO.env.ua.ie?"focusin":"focus";var e=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var n=this;var m=function(){n._tryPreloadAttach()};this._interval=setInterval(m,this.POLL_INTERVAL)}},onAvailable:function(m,q,o,n,p){var s=(YAHOO.lang.isString(m))?[m]:m;for(var r=0;r-1;t--){n=(this.removeListener(w[t],x,o)&&n)}return n}}if(!o||!o.call){return this.purgeElement(w,false,x)}if("unload"==x){for(t=g.length-1;t>-1;t--){m=g[t];if(m&&m[0]==w&&m[1]==x&&m[2]==o){g.splice(t,1);return true}}return false}var s=null;var r=arguments[3];if("undefined"===typeof r){r=this._getCacheIndex(w,x,o)}if(r>=0){s=h[r]}if(!w||!s){return false}if(this.useLegacyEvent(w,x)){var u=this.getLegacyIndex(w,x);var v=l[u];if(v){for(t=0,q=v.length;t0&&k.length>0)}var o=[];var m=function(v,u){var w=v;if(u.overrideContext){if(u.overrideContext===true){w=u.obj}else{w=u.overrideContext}}u.fn.call(w,u.obj)};var s,t,p,q,r=[];for(s=0,t=k.length;s-1;s--){p=k[s];if(!p||!p.id){k.splice(s,1)}}this.startInterval()}else{if(this._interval){clearInterval(this._interval);this._interval=null}}this.locked=false},purgeElement:function(p,o,m){var r=(YAHOO.lang.isString(p))?this.getEl(p):p;var n=this.getListeners(r,m),q,t;if(n){for(q=n.length-1;q>-1;q--){var s=n[q];this.removeListener(r,s.type,s.fn)}}if(o&&r&&r.childNodes){for(q=0,t=r.childNodes.length;q-1;r--){s=h[r];if(s){t.removeListener(s[t.EL],s[t.TYPE],s[t.FN],r)}}s=null}j=null;t._simpleRemove(window,"unload",t._unload)},_getScrollLeft:function(){return this._getScroll()[1]},_getScrollTop:function(){return this._getScroll()[0]},_getScroll:function(){var n=document.documentElement,m=document.body;if(n&&(n.scrollTop||n.scrollLeft)){return[n.scrollTop,n.scrollLeft]}else{if(m){return[m.scrollTop,m.scrollLeft]}else{return[0,0]}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(n,m,o,p){n.addEventListener(m,o,(p))}}else{if(window.attachEvent){return function(n,m,o,p){n.attachEvent("on"+m,o)}}else{return function(){}}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(n,m,o,p){n.removeEventListener(m,o,(p))}}else{if(window.detachEvent){return function(n,m,o){n.detachEvent("on"+m,o)}}else{return function(){}}}}()}}();(function(){var a=YAHOO.util.Event;a.on=a.addListener;a.onFocus=a.addFocusListener;a.onBlur=a.addBlurListener;if(a.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var b=document.createElement("p");a._dri=setInterval(function(){try{b.doScroll("left");clearInterval(a._dri);a._dri=null;a._ready();b=null}catch(c){}},a.POLL_INTERVAL)}else{if(a.webkit&&a.webkit<525){a._dri=setInterval(function(){var c=document.readyState;if("loaded"==c||"complete"==c){clearInterval(a._dri);a._dri=null;a._ready()}},a.POLL_INTERVAL)}else{a._simpleAdd(document,"DOMContentLoaded",a._ready)}}a._simpleAdd(window,"load",a._load);a._simpleAdd(window,"unload",a._unload);a._tryPreloadAttach()})()}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(a,e,b,c){this.__yui_events=this.__yui_events||{};var d=this.__yui_events[a];if(d){d.subscribe(e,b,c)}else{this.__yui_subscribers=this.__yui_subscribers||{};var f=this.__yui_subscribers;if(!f[a]){f[a]=[]}f[a].push({fn:e,obj:b,overrideContext:c})}},unsubscribe:function(f,d,b){this.__yui_events=this.__yui_events||{};var a=this.__yui_events;if(f){var c=a[f];if(c){return c.unsubscribe(d,b)}}else{var g=true;for(var e in a){if(YAHOO.lang.hasOwnProperty(a,e)){g=g&&a[e].unsubscribe(d,b)}}return g}return false},unsubscribeAll:function(a){return this.unsubscribe(a)},createEvent:function(g,a){this.__yui_events=this.__yui_events||{};var d=a||{};var e=this.__yui_events;if(e[g]){}else{var f=d.scope||this;var i=(d.silent);var c=new YAHOO.util.CustomEvent(g,f,i,YAHOO.util.CustomEvent.FLAT);e[g]=c;if(d.onSubscribeCallback){c.subscribeEvent.subscribe(d.onSubscribeCallback)}this.__yui_subscribers=this.__yui_subscribers||{};var h=this.__yui_subscribers[g];if(h){for(var b=0;bthis.clickPixelThresh||e>this.clickPixelThresh){this.startDrag(this.startX,this.startY)}}if(this.dragThreshMet){if(f&&f.events.b4Drag){f.b4Drag(c);f.fireEvent("b4DragEvent",{e:c})}if(f&&f.events.drag){f.onDrag(c);f.fireEvent("dragEvent",{e:c})}if(f){this.fireEvents(c,false)}}this.stopEvent(c)}},fireEvents:function(i,s){var ac=this.dragCurrent;if(!ac||ac.isLocked()||ac.dragOnly){return}var q=YAHOO.util.Event.getPageX(i),r=YAHOO.util.Event.getPageY(i),o=new YAHOO.util.Point(q,r),t=ac.getTargetCoord(o.x,o.y),y=ac.getDragEl(),z=["out","over","drop","enter"],j=new YAHOO.util.Region(t.y,t.x+y.offsetWidth,t.y+y.offsetHeight,t.x),v=[],A={},n=[],ab={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var l in this.dragOvers){var aa=this.dragOvers[l];if(!this.isTypeOfDD(aa)){continue}if(!this.isOverTarget(o,aa,this.mode,j)){ab.outEvts.push(aa)}v[l]=true;delete this.dragOvers[l]}for(var m in ac.groups){if("string"!=typeof m){continue}for(l in this.ids[m]){var x=this.ids[m][l];if(!this.isTypeOfDD(x)){continue}if(x.isTarget&&!x.isLocked()&&x!=ac){if(this.isOverTarget(o,x,this.mode,j)){A[m]=true;if(s){ab.dropEvts.push(x)}else{if(!v[x.id]){ab.enterEvts.push(x)}else{ab.overEvts.push(x)}this.dragOvers[x.id]=x}}}}}this.interactionInfo={out:ab.outEvts,enter:ab.enterEvts,over:ab.overEvts,drop:ab.dropEvts,point:o,draggedRegion:j,sourceRegion:this.locationCache[ac.id],validDrop:s};for(var B in A){n.push(B)}if(s&&!ab.dropEvts.length){this.interactionInfo.validDrop=false;if(ac.events.invalidDrop){ac.onInvalidDrop(i);ac.fireEvent("invalidDropEvent",{e:i})}}for(l=0;l2000){}else{setTimeout(c._addListeners,10);if(document&&document.body){c._timeoutCount+=1}}}},handleWasClicked:function(e,c){if(this.isHandle(c,e.id)){return true}else{var d=e.parentNode;while(d){if(this.isHandle(c,d.id)){return true}else{d=d.parentNode}}}return false}}}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners()}(function(){var a=YAHOO.util.Event;var b=YAHOO.util.Dom;YAHOO.util.DragDrop=function(c,e,d){if(c){this.init(c,e,d)}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments)},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true},unlock:function(){this.locked=false},isTarget:true,padding:null,dragOnly:false,useShim:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(d,c){},startDrag:function(d,c){},b4Drag:function(c){},onDrag:function(c){},onDragEnter:function(d,c){},b4DragOver:function(c){},onDragOver:function(d,c){},b4DragOut:function(c){},onDragOut:function(d,c){},b4DragDrop:function(c){},onDragDrop:function(d,c){},onInvalidDrop:function(c){},b4EndDrag:function(c){},endDrag:function(c){},b4MouseDown:function(c){},onMouseDown:function(c){},onMouseUp:function(c){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=b.get(this.id)}return this._domRef},getDragEl:function(){return b.get(this.dragElId)},init:function(c,f,e){this.initTarget(c,f,e);a.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var d in this.events){this.createEvent(d+"Event")}},initTarget:function(c,e,d){this.config=d||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof c!=="string"){this._domRef=c;c=b.generateId(c)}this.id=c;this.addToGroup((e)?e:"default");this.handleElId=c;a.onAvailable(c,this.handleOnAvailable,this,true);this.setDragElId(c);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig()},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var c in this.config.events){if(this.config.events[c]===false){this.events[c]=false}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);this.useShim=((this.config.useShim===true)?true:false)},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable()},setPadding:function(d,f,c,e){if(!f&&0!==f){this.padding=[d,d,d,d]}else{if(!c&&0!==c){this.padding=[d,f,d,f]}else{this.padding=[d,f,c,e]}}},setInitPosition:function(e,f){var d=this.getEl();if(!this.DDM.verifyEl(d)){if(d&&d.style&&(d.style.display=="none")){}else{}return}var g=e||0;var h=f||0;var c=b.getXY(d);this.initPageX=c[0]-g;this.initPageY=c[1]-h;this.lastPageX=c[0];this.lastPageY=c[1];this.setStartPosition(c)},setStartPosition:function(c){var d=c||b.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=d[0];this.startPageY=d[1]},addToGroup:function(c){this.groups[c]=true;this.DDM.regDragDrop(this,c)},removeFromGroup:function(c){if(this.groups[c]){delete this.groups[c]}this.DDM.removeDDFromGroup(this,c)},setDragElId:function(c){this.dragElId=c},setHandleElId:function(c){if(typeof c!=="string"){c=b.generateId(c)}this.handleElId=c;this.DDM.regHandle(this.id,c)},setOuterHandleElId:function(c){if(typeof c!=="string"){c=b.generateId(c)}a.on(c,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(c);this.hasOuterHandles=true},unreg:function(){a.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this)},isLocked:function(){return(this.DDM.isLocked()||this.locked)},handleMouseDown:function(c,d){var i=c.which||c.button;if(this.primaryButtonOnly&&i>1){return}if(this.isLocked()){return}var j=this.b4MouseDown(c),g=true;if(this.events.b4MouseDown){g=this.fireEvent("b4MouseDownEvent",c)}var h=this.onMouseDown(c),e=true;if(this.events.mouseDown){e=this.fireEvent("mouseDownEvent",c)}if((j===false)||(h===false)||(g===false)||(e===false)){return}this.DDM.refreshCache(this.groups);var f=new YAHOO.util.Point(a.getPageX(c),a.getPageY(c));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(f,this)){}else{if(this.clickValidator(c)){this.setStartPosition();this.DDM.handleMouseDown(c,this);this.DDM.stopEvent(c)}else{}}},clickValidator:function(c){var d=YAHOO.util.Event.getTarget(c);return(this.isValidHandleChild(d)&&(this.id==this.handleElId||this.DDM.handleWasClicked(d,this.id)))},getTargetCoord:function(d,e){var f=d-this.deltaX;var c=e-this.deltaY;if(this.constrainX){if(fthis.maxX){f=this.maxX}}if(this.constrainY){if(cthis.maxY){c=this.maxY}}f=this.getTick(f,this.xTicks);c=this.getTick(c,this.yTicks);return{x:f,y:c}},addInvalidHandleType:function(d){var c=d.toUpperCase();this.invalidHandleTypes[c]=c},addInvalidHandleId:function(c){if(typeof c!=="string"){c=b.generateId(c)}this.invalidHandleIds[c]=c},addInvalidHandleClass:function(c){this.invalidHandleClasses.push(c)},removeInvalidHandleType:function(d){var c=d.toUpperCase();delete this.invalidHandleTypes[c]},removeInvalidHandleId:function(c){if(typeof c!=="string"){c=b.generateId(c)}delete this.invalidHandleIds[c]},removeInvalidHandleClass:function(d){for(var c=0,e=this.invalidHandleClasses.length;c=this.minX;e=e-f){if(!d[e]){this.xTicks[this.xTicks.length]=e;d[e]=true}}for(e=this.initPageX;e<=this.maxX;e=e+f){if(!d[e]){this.xTicks[this.xTicks.length]=e;d[e]=true}}this.xTicks.sort(this.DDM.numericSort)},setYTicks:function(c,f){this.yTicks=[];this.yTickSize=f;var d={};for(var e=this.initPageY;e>=this.minY;e=e-f){if(!d[e]){this.yTicks[this.yTicks.length]=e;d[e]=true}}for(e=this.initPageY;e<=this.maxY;e=e+f){if(!d[e]){this.yTicks[this.yTicks.length]=e;d[e]=true}}this.yTicks.sort(this.DDM.numericSort)},setXConstraint:function(c,d,e){this.leftConstraint=parseInt(c,10);this.rightConstraint=parseInt(d,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(e){this.setXTicks(this.initPageX,e)}this.constrainX=true},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks()},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0},setYConstraint:function(e,c,d){this.topConstraint=parseInt(e,10);this.bottomConstraint=parseInt(c,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(d){this.setYTicks(this.initPageY,d)}this.constrainY=true},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var c=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var d=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(c,d)}else{this.setInitPosition()}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize)}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize)}},getTick:function(c,f){if(!f){return c}else{if(f[0]>=c){return f[0]}else{for(var h=0,i=f.length;h=c){var d=c-f[h];var e=f[g]-c;return(e>d)?f[h]:f[g]}}return f[f.length-1]}}},toString:function(){return("DragDrop "+this.id)}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider)})();YAHOO.util.DD=function(b,a,c){if(b){this.init(b,a,c)}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(c,d){var a=c-this.startPageX;var b=d-this.startPageY;this.setDelta(a,b)},setDelta:function(b,a){this.deltaX=b;this.deltaY=a},setDragElPos:function(b,c){var a=this.getDragEl();this.alignElWithMouse(a,b,c)},alignElWithMouse:function(g,c,d){var e=this.getTargetCoord(c,d);if(!this.deltaSetXY){var b=[e.x,e.y];YAHOO.util.Dom.setXY(g,b);var f=parseInt(YAHOO.util.Dom.getStyle(g,"left"),10);var h=parseInt(YAHOO.util.Dom.getStyle(g,"top"),10);this.deltaSetXY=[f-e.x,h-e.y]}else{YAHOO.util.Dom.setStyle(g,"left",(e.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(g,"top",(e.y+this.deltaSetXY[1])+"px")}this.cachePosition(e.x,e.y);var a=this;setTimeout(function(){a.autoScroll.call(a,e.x,e.y,g.offsetHeight,g.offsetWidth)},0)},cachePosition:function(c,a){if(c){this.lastPageX=c;this.lastPageY=a}else{var b=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=b[0];this.lastPageY=b[1]}},autoScroll:function(i,j,n,h){if(this.scroll){var g=this.DDM.getClientHeight();var c=this.DDM.getClientWidth();var e=this.DDM.getScrollTop();var a=this.DDM.getScrollLeft();var k=n+j;var f=h+i;var l=(g+e-j-this.deltaY);var m=(c+a-i-this.deltaX);var b=40; var d=(document.all)?80:30;if(k>g&&l0&&j-ec&&m0&&i-a'); }else{ iframeELe = this.common.createElement(this.document, 'IFRAME'); } iframeELe.id = this.K_IFRAME_ID; iframeELe.name = this.K_IFRAME_ID; iframeELe.scrolling = 'no'; var style = 'border: 0px; width:100%; height:310px; background-color: #FFF; display:block;'; iframeELe.style.cssText = style; dragWindow.appendChild(iframeELe); this.body.appendChild(dragWindow); var ddWidget = new YAHOO.util.DD(this.K_DRAG_WINDOW_ID); ddWidget.setHandleElId(this.K_DRAG_WINDOW_HANDLE_ID); this.ddWidget = ddWidget; this.dragWindow = dragWindow; var region = YAHOO.util.Dom.getRegion(this.body); if(!region){ var dom = YAHOO.util.Dom; dom.setStyle(dragWindow, 'top', '0px'); dom.setStyle(dragWindow, 'left', '700px'); ddWidget.setXConstraint(700, 0); ddWidget.setYConstraint(0, 1000); }else{ xMoveTo(dragWindow, region.right - region.left - this.FRAME_WIDTH, region.top); setPopupDragConstraint(); } dragWindow.style.visibility = 'visible'; clearOldPollForKabIframeChanges(); } this.removeDraggableWindow = function(){ this.window.clearTimeout(this.pollForKabIframeTimeout); var dragWindow = this.document.getElementById(this.K_DRAG_WINDOW_ID); if(dragWindow){ this.body.removeChild(dragWindow); } } this.hasFrames = function(_window) { try { if (this.DEBUG) window.alert('Checking ' + _window.document.body.nodeName + ' for frames'); return _window.document.body.nodeName == 'FRAMESET'; } catch(e) { return false; } } }; var kaboodleAddItemRuntime = new KaboodleAddItemRuntime(); try { //If the custom addtokaboodle is defined and the current document domain is same as the button target then use the override if(typeof customAddToKaboodle == "function" && document.domain == "www.kaboodle.com"){ customAddToKaboodle(); } else{ kaboodleAddItemRuntime.run(); } } catch(e) { if (kaboodleAddItemRuntime.DEBUG) { window.alert('Caught Exception: ' + e); } else { var url = 'http://www.kaboodle.com/za/additem' + '?get=1'; url = url.concat('&title=' + encodeURIComponent(document.title)); url = url.concat('&url=' + encodeURIComponent(window.location.href)); if(typeof _mg56v != 'undefined'){ url = url.concat('&version=' + encodeURIComponent(_mg56v)); } window.location = url; } } kaboodleAddItemRuntime.window.onresize = function(event) { setPopupDragConstraint(); } function setPopupDragConstraint(){ var ddWidget = kaboodleAddItemRuntime.ddWidget; var dragWindow = kaboodleAddItemRuntime.dragWindow; var dom = YAHOO.util.Dom; var region = dom.getRegion(kaboodleAddItemRuntime.body); var xy = dom.getXY(dragWindow); ddWidget.setXConstraint(xy[0] - region.left, region.right - xy[0] - parseInt(dom.getStyle(dragWindow, 'width'))); var bottomCons = region.bottom - xy[1] - parseInt(dom.getStyle(dragWindow, 'height')); ddWidget.setYConstraint(xy[1] - region.top, bottomCons > 1000 ? bottomCons : 1000); } function pollForKabIframeChanges(){ var kabIframeURL = kaboodleAddItemRuntime.window.location.href; var startIndex = kabIframeURL.indexOf('#kab:'); if(startIndex != -1){ var originalUrl = kabIframeURL.substring(0, startIndex); if(originalUrl.indexOf('#') == -1){ originalUrl += '#'; } var endIndex = kabIframeURL.indexOf(':kab', startIndex); var kStr = kabIframeURL.substring(startIndex + 5, endIndex); var kStrArray = kStr.split(':'); if(kStrArray[0] == 'close' && kStrArray[1]){ kaboodleAddItemRuntime.removeDraggableWindow(); kaboodleAddItemRuntime.window.location.replace(originalUrl); return; }else if(kStrArray[0] == 'pret'){ kaboodleAddItemRuntime.removeDraggableWindow(); kaboodleAddItemRuntime.window.location = 'http://www.kaboodle.com' + kStrArray[1]; return; }else if(kStrArray[0] == 'height'){ var kabIframeEle = kaboodleAddItemRuntime.document.getElementById(kaboodleAddItemRuntime.K_IFRAME_ID); kabIframeEle.style.height = kStrArray[1] + "px"; kaboodleAddItemRuntime.window.location.replace(originalUrl); }else if(kStrArray[0] == 'highlight'){ kabHighlightString(decodeURIComponent(kStrArray[1])); kaboodleAddItemRuntime.window.location.replace(originalUrl); } kaboodleAddItemRuntime.pollForKabIframeTimeout = kaboodleAddItemRuntime.window.setTimeout('pollForKabIframeChanges()', 1000); }else{ kaboodleAddItemRuntime.pollForKabIframeTimeout = kaboodleAddItemRuntime.window.setTimeout('pollForKabIframeChanges()', 1000); } } function clearOldPollForKabIframeChanges(){ var kabIframeURL = kaboodleAddItemRuntime.window.location.href; var startIndex = kabIframeURL.indexOf('#kab:'); if(startIndex != -1){ var originalUrl = kabIframeURL.substring(0, startIndex); if(originalUrl.indexOf('#') == -1){ originalUrl += '#'; } kaboodleAddItemRuntime.window.location.replace(originalUrl); } kaboodleAddItemRuntime.pollForKabIframeTimeout = this.window.setTimeout('pollForKabIframeChanges()', 1000); } var kabTRange = null; function kabHighlightString (str) { if(str == "")return; var currWindow = kaboodleAddItemRuntime.window; var strFound; if (currWindow.find) { // CODE FOR BROWSERS THAT SUPPORT window.find strFound = currWindow.find(str); if (strFound && currWindow.getSelection && !currWindow.getSelection().anchorNode) { strFound = currWindow.find(str); } if (!strFound) { strFound = currWindow.find(str,0,1); while (currWindow.find(str,0,1)) continue; } } else if (currWindow.navigator.appName.indexOf("Microsoft")!=-1) { // EXPLORER-SPECIFIC CODE if (kabTRange != null) { kabTRange.collapse(false); strFound = kabTRange.findText(str); if (strFound) kabTRange.select() } if (kabTRange == null || strFound == 0) { kabTRange = currWindow.document.body.createTextRange(); strFound = kabTRange.findText(str); if (strFound) kabTRange.select(); } } }