/* rounded_corners_lite.inc.js */
/****************************************************************
*                                                              *
*  curvyCorners                                                *
*  ------------                                                *
*                                                              *
*  This script generates rounded corners for your divs.        *
*                                                              *
*  Version 1.2.9                                               *
*  Copyright (c) 2006 Cameron Cooke                            *
*  By: Cameron Cooke and Tim Hutchison.                        *
*                                                              *
*                                                              *
*  Website: http://www.curvycorners.net                        *
*  Email:   info@totalinfinity.com                             *
*  Forum:   http://www.curvycorners.net/forum/                 *
*                                                              *
*                                                              *
*  This library is free software; you can redistribute         *
*  it and/or modify it under the terms of the GNU              *
*  Lesser General Public License as published by the           *
*  Free Software Foundation; either version 2.1 of the         *
*  License, or (at your option) any later version.             *
*                                                              *
*  This library is distributed in the hope that it will        *
*  be useful, but WITHOUT ANY WARRANTY; without even the       *
*  implied warranty of MERCHANTABILITY or FITNESS FOR A        *
*  PARTICULAR PURPOSE. See the GNU Lesser General Public       *
*  License for more details.                                   *
*                                                              *
*  You should have received a copy of the GNU Lesser           *
*  General Public License along with this library;             *
*  Inc., 59 Temple Place, Suite 330, Boston,                   *
*  MA 02111-1307 USA                                           *
*                                                              *
****************************************************************/
var isIE = navigator.userAgent.toLowerCase().indexOf("msie") > -1; var isMoz = document.implementation && document.implementation.createDocument; var isSafari = ((navigator.userAgent.toLowerCase().indexOf('safari')!=-1)&&(navigator.userAgent.toLowerCase().indexOf('mac')!=-1))?true:false; function curvyCorners()
{ if(typeof(arguments[0]) != "object") throw newCurvyError("First parameter of curvyCorners() must be an object."); if(typeof(arguments[1]) != "object" && typeof(arguments[1]) != "string") throw newCurvyError("Second parameter of curvyCorners() must be an object or a class name."); if(typeof(arguments[1]) == "string")
{ var startIndex = 0; var boxCol = getElementsByClass(arguments[1]);}
else
{ var startIndex = 1; var boxCol = arguments;}
var curvyCornersCol = new Array(); if(arguments[0].validTags)
var validElements = arguments[0].validTags; else
var validElements = ["div"]; for(var i = startIndex, j = boxCol.length; i < j; i++)
{ var currentTag = boxCol[i].tagName.toLowerCase(); if(inArray(validElements, currentTag) !== false)
{ curvyCornersCol[curvyCornersCol.length] = new curvyObject(arguments[0], boxCol[i]);}
}
this.objects = curvyCornersCol; this.applyCornersToAll = function()
{ for(var x = 0, k = this.objects.length; x < k; x++)
{ this.objects[x].applyCorners();}
}
}
function curvyObject()
{ this.box = arguments[1]; this.settings = arguments[0]; this.topContainer = null; this.bottomContainer = null; this.masterCorners = new Array(); this.contentDIV = null; var boxHeight = get_style(this.box, "height", "height"); var boxWidth = get_style(this.box, "width", "width"); var borderWidth = get_style(this.box, "borderTopWidth", "border-top-width"); var borderColour = get_style(this.box, "borderTopColor", "border-top-color"); var boxColour = get_style(this.box, "backgroundColor", "background-color"); var backgroundImage = get_style(this.box, "backgroundImage", "background-image"); var boxPosition = get_style(this.box, "position", "position"); var boxPadding = get_style(this.box, "paddingTop", "padding-top"); this.boxHeight = parseInt(((boxHeight != "" && boxHeight != "auto" && boxHeight.indexOf("%") == -1)? boxHeight.substring(0, boxHeight.indexOf("px")) : this.box.scrollHeight)); this.boxWidth = parseInt(((boxWidth != "" && boxWidth != "auto" && boxWidth.indexOf("%") == -1)? boxWidth.substring(0, boxWidth.indexOf("px")) : this.box.scrollWidth)); this.borderWidth = parseInt(((borderWidth != "" && borderWidth.indexOf("px") !== -1)? borderWidth.slice(0, borderWidth.indexOf("px")) : 0)); this.boxColour = format_colour(boxColour); this.boxPadding = parseInt(((boxPadding != "" && boxPadding.indexOf("px") !== -1)? boxPadding.slice(0, boxPadding.indexOf("px")) : 0)); this.borderColour = format_colour(borderColour); this.borderString = this.borderWidth + "px" + " solid " + this.borderColour; this.backgroundImage = ((backgroundImage != "none")? backgroundImage : ""); this.boxContent = this.box.innerHTML; if(boxPosition != "absolute") this.box.style.position = "relative"; this.box.style.padding = "0px"; if(isIE && boxWidth == "auto" && boxHeight == "auto") this.box.style.width = "100%"; if(this.settings.autoPad == true && this.boxPadding > 0)
this.box.innerHTML = ""; this.applyCorners = function()
{ for(var t = 0; t < 2; t++)
{ switch(t)
{ case 0:
if(this.settings.tl || this.settings.tr)
{ var newMainContainer = document.createElement("DIV"); newMainContainer.style.width = "100%"; newMainContainer.style.fontSize = "1px"; newMainContainer.style.overflow = "hidden"; newMainContainer.style.position = "absolute"; newMainContainer.style.paddingLeft = this.borderWidth + "px"; newMainContainer.style.paddingRight = this.borderWidth + "px"; var topMaxRadius = Math.max(this.settings.tl ? this.settings.tl.radius : 0, this.settings.tr ? this.settings.tr.radius : 0); newMainContainer.style.height = topMaxRadius + "px"; newMainContainer.style.top = 0 - topMaxRadius + "px"; newMainContainer.style.left = 0 - this.borderWidth + "px"; this.topContainer = this.box.appendChild(newMainContainer);}
break; case 1:
if(this.settings.bl || this.settings.br)
{ var newMainContainer = document.createElement("DIV"); newMainContainer.style.width = "100%"; newMainContainer.style.fontSize = "1px"; newMainContainer.style.overflow = "hidden"; newMainContainer.style.position = "absolute"; newMainContainer.style.paddingLeft = this.borderWidth + "px"; newMainContainer.style.paddingRight = this.borderWidth + "px"; var botMaxRadius = Math.max(this.settings.bl ? this.settings.bl.radius : 0, this.settings.br ? this.settings.br.radius : 0); newMainContainer.style.height = botMaxRadius + "px"; newMainContainer.style.bottom = 0 - botMaxRadius + "px"; newMainContainer.style.left = 0 - this.borderWidth + "px"; this.bottomContainer = this.box.appendChild(newMainContainer);}
break;}
}
if(this.topContainer) this.box.style.borderTopWidth = "0px"; if(this.bottomContainer) this.box.style.borderBottomWidth = "0px"; var corners = ["tr", "tl", "br", "bl"]; for(var i in corners)
{ if(i > -1 < 4)
{ var cc = corners[i]; if(!this.settings[cc])
{ if(((cc == "tr" || cc == "tl") && this.topContainer != null) || ((cc == "br" || cc == "bl") && this.bottomContainer != null))
{ var newCorner = document.createElement("DIV"); newCorner.style.position = "relative"; newCorner.style.fontSize = "1px"; newCorner.style.overflow = "hidden"; if(this.backgroundImage == "")
newCorner.style.backgroundColor = this.boxColour; else
newCorner.style.backgroundImage = this.backgroundImage; switch(cc)
{ case "tl":
newCorner.style.height = topMaxRadius - this.borderWidth + "px"; newCorner.style.marginRight = this.settings.tr.radius - (this.borderWidth*2) + "px"; newCorner.style.borderLeft = this.borderString; newCorner.style.borderTop = this.borderString; newCorner.style.left = -this.borderWidth + "px"; break; case "tr":
newCorner.style.height = topMaxRadius - this.borderWidth + "px"; newCorner.style.marginLeft = this.settings.tl.radius - (this.borderWidth*2) + "px"; newCorner.style.borderRight = this.borderString; newCorner.style.borderTop = this.borderString; newCorner.style.backgroundPosition = "-" + (topMaxRadius + this.borderWidth) + "px 0px"; newCorner.style.left = this.borderWidth + "px"; break; case "bl":
newCorner.style.height = botMaxRadius - this.borderWidth + "px"; newCorner.style.marginRight = this.settings.br.radius - (this.borderWidth*2) + "px"; newCorner.style.borderLeft = this.borderString; newCorner.style.borderBottom = this.borderString; newCorner.style.left = -this.borderWidth + "px"; newCorner.style.backgroundPosition = "-" + (this.borderWidth) + "px -" + (this.boxHeight + (botMaxRadius + this.borderWidth)) + "px"; break; case "br":
newCorner.style.height = botMaxRadius - this.borderWidth + "px"; newCorner.style.marginLeft = this.settings.bl.radius - (this.borderWidth*2) + "px"; newCorner.style.borderRight = this.borderString; newCorner.style.borderBottom = this.borderString; newCorner.style.left = this.borderWidth + "px"
newCorner.style.backgroundPosition = "-" + (botMaxRadius + this.borderWidth) + "px -" + (this.boxHeight + (botMaxRadius + this.borderWidth)) + "px"; break;}
}
}
else
{ if(this.masterCorners[this.settings[cc].radius])
{ var newCorner = this.masterCorners[this.settings[cc].radius].cloneNode(true);}
else
{ var newCorner = document.createElement("DIV"); newCorner.style.height = this.settings[cc].radius + "px"; newCorner.style.width = this.settings[cc].radius + "px"; newCorner.style.position = "absolute"; newCorner.style.fontSize = "1px"; newCorner.style.overflow = "hidden"; var borderRadius = parseInt(this.settings[cc].radius - this.borderWidth); for(var intx = 0, j = this.settings[cc].radius; intx < j; intx++)
{ if((intx +1) >= borderRadius)
var y1 = -1; else
var y1 = (Math.floor(Math.sqrt(Math.pow(borderRadius, 2) - Math.pow((intx+1), 2))) - 1); if(borderRadius != j)
{ if((intx) >= borderRadius)
var y2 = -1; else
var y2 = Math.ceil(Math.sqrt(Math.pow(borderRadius,2) - Math.pow(intx, 2))); if((intx+1) >= j)
var y3 = -1; else
var y3 = (Math.floor(Math.sqrt(Math.pow(j ,2) - Math.pow((intx+1), 2))) - 1);}
if((intx) >= j)
var y4 = -1; else
var y4 = Math.ceil(Math.sqrt(Math.pow(j ,2) - Math.pow(intx, 2))); if(y1 > -1) this.drawPixel(intx, 0, this.boxColour, 100, (y1+1), newCorner, -1, this.settings[cc].radius); if(borderRadius != j)
{ for(var inty = (y1 + 1); inty < y2; inty++)
{ if(this.settings.antiAlias)
{ if(this.backgroundImage != "")
{ var borderFract = (pixelFraction(intx, inty, borderRadius) * 100); if(borderFract < 30)
{ this.drawPixel(intx, inty, this.borderColour, 100, 1, newCorner, 0, this.settings[cc].radius);}
else
{ this.drawPixel(intx, inty, this.borderColour, 100, 1, newCorner, -1, this.settings[cc].radius);}
}
else
{ var pixelcolour = BlendColour(this.boxColour, this.borderColour, pixelFraction(intx, inty, borderRadius)); this.drawPixel(intx, inty, pixelcolour, 100, 1, newCorner, 0, this.settings[cc].radius, cc);}
}
}
if(this.settings.antiAlias)
{ if(y3 >= y2)
{ if (y2 == -1) y2 = 0; this.drawPixel(intx, y2, this.borderColour, 100, (y3 - y2 + 1), newCorner, 0, 0);}
}
else
{ if(y3 >= y1)
{ this.drawPixel(intx, (y1 + 1), this.borderColour, 100, (y3 - y1), newCorner, 0, 0);}
}
var outsideColour = this.borderColour;}
else
{ var outsideColour = this.boxColour; var y3 = y1;}
if(this.settings.antiAlias)
{ for(var inty = (y3 + 1); inty < y4; inty++)
{ this.drawPixel(intx, inty, outsideColour, (pixelFraction(intx, inty , j) * 100), 1, newCorner, ((this.borderWidth > 0)? 0 : -1), this.settings[cc].radius);}
}
}
this.masterCorners[this.settings[cc].radius] = newCorner.cloneNode(true);}
if(cc != "br")
{ for(var t = 0, k = newCorner.childNodes.length; t < k; t++)
{ var pixelBar = newCorner.childNodes[t]; var pixelBarTop = parseInt(pixelBar.style.top.substring(0, pixelBar.style.top.indexOf("px"))); var pixelBarLeft = parseInt(pixelBar.style.left.substring(0, pixelBar.style.left.indexOf("px"))); var pixelBarHeight = parseInt(pixelBar.style.height.substring(0, pixelBar.style.height.indexOf("px"))); if(cc == "tl" || cc == "bl"){ pixelBar.style.left = this.settings[cc].radius -pixelBarLeft -1 + "px";}
if(cc == "tr" || cc == "tl"){ pixelBar.style.top = this.settings[cc].radius -pixelBarHeight -pixelBarTop + "px";}
switch(cc)
{ case "tr":
pixelBar.style.backgroundPosition = "-" + Math.abs((this.boxWidth - this.settings[cc].radius + this.borderWidth) + pixelBarLeft) + "px -" + Math.abs(this.settings[cc].radius -pixelBarHeight -pixelBarTop - this.borderWidth) + "px"; break; case "tl":
pixelBar.style.backgroundPosition = "-" + Math.abs((this.settings[cc].radius -pixelBarLeft -1) - this.borderWidth) + "px -" + Math.abs(this.settings[cc].radius -pixelBarHeight -pixelBarTop - this.borderWidth) + "px"; break; case "bl":
pixelBar.style.backgroundPosition = "-" + Math.abs((this.settings[cc].radius -pixelBarLeft -1) - this.borderWidth) + "px -" + Math.abs((this.boxHeight + this.settings[cc].radius + pixelBarTop) -this.borderWidth) + "px"; break;}
}
}
}
if(newCorner)
{ switch(cc)
{ case "tl":
if(newCorner.style.position == "absolute") newCorner.style.top = "0px"; if(newCorner.style.position == "absolute") newCorner.style.left = "0px"; if(this.topContainer) this.topContainer.appendChild(newCorner); break; case "tr":
if(newCorner.style.position == "absolute") newCorner.style.top = "0px"; if(newCorner.style.position == "absolute") newCorner.style.right = "0px"; if(this.topContainer) this.topContainer.appendChild(newCorner); break; case "bl":
if(newCorner.style.position == "absolute") newCorner.style.bottom = "0px"; if(newCorner.style.position == "absolute") newCorner.style.left = "0px"; if(this.bottomContainer) this.bottomContainer.appendChild(newCorner); break; case "br":
if(newCorner.style.position == "absolute") newCorner.style.bottom = "0px"; if(newCorner.style.position == "absolute") newCorner.style.right = "0px"; if(this.bottomContainer) this.bottomContainer.appendChild(newCorner); break;}
}
}
}
var radiusDiff = new Array(); radiusDiff["t"] = Math.abs(this.settings.tl.radius - this.settings.tr.radius)
radiusDiff["b"] = Math.abs(this.settings.bl.radius - this.settings.br.radius); for(z in radiusDiff)
{ if(z == "t" || z == "b")
{ if(radiusDiff[z])
{ var smallerCornerType = ((this.settings[z + "l"].radius < this.settings[z + "r"].radius)? z +"l" : z +"r"); var newFiller = document.createElement("DIV"); newFiller.style.height = radiusDiff[z] + "px"; newFiller.style.width = this.settings[smallerCornerType].radius+ "px"
newFiller.style.position = "absolute"; newFiller.style.fontSize = "1px"; newFiller.style.overflow = "hidden"; newFiller.style.backgroundColor = this.boxColour; switch(smallerCornerType)
{ case "tl":
newFiller.style.bottom = "0px"; newFiller.style.left = "0px"; newFiller.style.borderLeft = this.borderString; this.topContainer.appendChild(newFiller); break; case "tr":
newFiller.style.bottom = "0px"; newFiller.style.right = "0px"; newFiller.style.borderRight = this.borderString; this.topContainer.appendChild(newFiller); break; case "bl":
newFiller.style.top = "0px"; newFiller.style.left = "0px"; newFiller.style.borderLeft = this.borderString; this.bottomContainer.appendChild(newFiller); break; case "br":
newFiller.style.top = "0px"; newFiller.style.right = "0px"; newFiller.style.borderRight = this.borderString; this.bottomContainer.appendChild(newFiller); break;}
}
var newFillerBar = document.createElement("DIV"); newFillerBar.style.position = "relative"; newFillerBar.style.fontSize = "1px"; newFillerBar.style.overflow = "hidden"; newFillerBar.style.backgroundColor = this.boxColour; newFillerBar.style.backgroundImage = this.backgroundImage; switch(z)
{ case "t":
if(this.topContainer)
{ if(this.settings.tl.radius && this.settings.tr.radius)
{ newFillerBar.style.height = topMaxRadius - this.borderWidth + "px"; newFillerBar.style.marginLeft = this.settings.tl.radius - this.borderWidth + "px"; newFillerBar.style.marginRight = this.settings.tr.radius - this.borderWidth + "px"; newFillerBar.style.borderTop = this.borderString; if(this.backgroundImage != "")
newFillerBar.style.backgroundPosition = "-" + (topMaxRadius + this.borderWidth) + "px 0px"; this.topContainer.appendChild(newFillerBar);}
this.box.style.backgroundPosition = "0px -" + (topMaxRadius - this.borderWidth) + "px";}
break; case "b":
if(this.bottomContainer)
{ if(this.settings.bl.radius && this.settings.br.radius)
{ newFillerBar.style.height = botMaxRadius - this.borderWidth + "px"; newFillerBar.style.marginLeft = this.settings.bl.radius - this.borderWidth + "px"; newFillerBar.style.marginRight = this.settings.br.radius - this.borderWidth + "px"; newFillerBar.style.borderBottom = this.borderString; if(this.backgroundImage != "")
newFillerBar.style.backgroundPosition = "-" + (botMaxRadius + this.borderWidth) + "px -" + (this.boxHeight + (topMaxRadius + this.borderWidth)) + "px"; this.bottomContainer.appendChild(newFillerBar);}
}
break;}
}
}
if(this.settings.autoPad == true && this.boxPadding > 0)
{ var contentContainer = document.createElement("DIV"); contentContainer.style.position = "relative"; contentContainer.innerHTML = this.boxContent; contentContainer.className = "autoPadDiv"; var topPadding = Math.abs(topMaxRadius - this.boxPadding); var botPadding = Math.abs(botMaxRadius - this.boxPadding); if(topMaxRadius < this.boxPadding)
contentContainer.style.paddingTop = topPadding + "px"; if(botMaxRadius < this.boxPadding)
contentContainer.style.paddingBottom = botMaxRadius + "px"; contentContainer.style.paddingLeft = this.boxPadding + "px"; contentContainer.style.paddingRight = this.boxPadding + "px"; this.contentDIV = this.box.appendChild(contentContainer);}
}
this.drawPixel = function(intx, inty, colour, transAmount, height, newCorner, image, cornerRadius)
{ var pixel = document.createElement("DIV"); pixel.style.height = height + "px"; pixel.style.width = "1px"; pixel.style.position = "absolute"; pixel.style.fontSize = "1px"; pixel.style.overflow = "hidden"; var topMaxRadius = Math.max(this.settings["tr"].radius, this.settings["tl"].radius); if(image == -1 && this.backgroundImage != "")
{ pixel.style.backgroundImage = this.backgroundImage; pixel.style.backgroundPosition = "-" + (this.boxWidth - (cornerRadius - intx) + this.borderWidth) + "px -" + ((this.boxHeight + topMaxRadius + inty) -this.borderWidth) + "px";}
else
{ pixel.style.backgroundColor = colour;}
if (transAmount != 100)
setOpacity(pixel, transAmount); pixel.style.top = inty + "px"; pixel.style.left = intx + "px"; newCorner.appendChild(pixel);}
}
function insertAfter(parent, node, referenceNode)
{ parent.insertBefore(node, referenceNode.nextSibling);}
function BlendColour(Col1, Col2, Col1Fraction)
{ var red1 = parseInt(Col1.substr(1,2),16); var green1 = parseInt(Col1.substr(3,2),16); var blue1 = parseInt(Col1.substr(5,2),16); var red2 = parseInt(Col2.substr(1,2),16); var green2 = parseInt(Col2.substr(3,2),16); var blue2 = parseInt(Col2.substr(5,2),16); if(Col1Fraction > 1 || Col1Fraction < 0) Col1Fraction = 1; var endRed = Math.round((red1 * Col1Fraction) + (red2 * (1 - Col1Fraction))); if(endRed > 255) endRed = 255; if(endRed < 0) endRed = 0; var endGreen = Math.round((green1 * Col1Fraction) + (green2 * (1 - Col1Fraction))); if(endGreen > 255) endGreen = 255; if(endGreen < 0) endGreen = 0; var endBlue = Math.round((blue1 * Col1Fraction) + (blue2 * (1 - Col1Fraction))); if(endBlue > 255) endBlue = 255; if(endBlue < 0) endBlue = 0; return "#" + IntToHex(endRed)+ IntToHex(endGreen)+ IntToHex(endBlue);}
function IntToHex(strNum)
{ base = strNum / 16; rem = strNum % 16; base = base - (rem / 16); baseS = MakeHex(base); remS = MakeHex(rem); return baseS + '' + remS;}
function MakeHex(x)
{ if((x >= 0) && (x <= 9))
{ return x;}
else
{ switch(x)
{ case 10: return "A"; case 11: return "B"; case 12: return "C"; case 13: return "D"; case 14: return "E"; case 15: return "F";}
}
}
function pixelFraction(x, y, r)
{ var pixelfraction = 0; var xvalues = new Array(1); var yvalues = new Array(1); var point = 0; var whatsides = ""; var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(x,2))); if ((intersect >= y) && (intersect < (y+1)))
{ whatsides = "Left"; xvalues[point] = 0; yvalues[point] = intersect - y; point = point + 1;}
var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(y+1,2))); if ((intersect >= x) && (intersect < (x+1)))
{ whatsides = whatsides + "Top"; xvalues[point] = intersect - x; yvalues[point] = 1; point = point + 1;}
var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(x+1,2))); if ((intersect >= y) && (intersect < (y+1)))
{ whatsides = whatsides + "Right"; xvalues[point] = 1; yvalues[point] = intersect - y; point = point + 1;}
var intersect = Math.sqrt((Math.pow(r,2) - Math.pow(y,2))); if ((intersect >= x) && (intersect < (x+1)))
{ whatsides = whatsides + "Bottom"; xvalues[point] = intersect - x; yvalues[point] = 0;}
switch (whatsides)
{ case "LeftRight":
pixelfraction = Math.min(yvalues[0],yvalues[1]) + ((Math.max(yvalues[0],yvalues[1]) - Math.min(yvalues[0],yvalues[1]))/2); break; case "TopRight":
pixelfraction = 1-(((1-xvalues[0])*(1-yvalues[1]))/2); break; case "TopBottom":
pixelfraction = Math.min(xvalues[0],xvalues[1]) + ((Math.max(xvalues[0],xvalues[1]) - Math.min(xvalues[0],xvalues[1]))/2); break; case "LeftBottom":
pixelfraction = (yvalues[0]*xvalues[1])/2; break; default:
pixelfraction = 1;}
return pixelfraction;}
function rgb2Hex(rgbColour)
{ try{ var rgbArray = rgb2Array(rgbColour); var red = parseInt(rgbArray[0]); var green = parseInt(rgbArray[1]); var blue = parseInt(rgbArray[2]); var hexColour = "#" + IntToHex(red) + IntToHex(green) + IntToHex(blue);}
catch(e){ alert("There was an error converting the RGB value to Hexadecimal in function rgb2Hex");}
return hexColour;}
function rgb2Array(rgbColour)
{ var rgbValues = rgbColour.substring(4, rgbColour.indexOf(")")); var rgbArray = rgbValues.split(", "); return rgbArray;}
function setOpacity(obj, opacity)
{ opacity = (opacity == 100)?99.999:opacity; if(isSafari && obj.tagName != "IFRAME")
{ var rgbArray = rgb2Array(obj.style.backgroundColor); var red = parseInt(rgbArray[0]); var green = parseInt(rgbArray[1]); var blue = parseInt(rgbArray[2]); obj.style.backgroundColor = "rgba(" + red + ", " + green + ", " + blue + ", " + opacity/100 + ")";}
else if(typeof(obj.style.opacity) != "undefined")
{ obj.style.opacity = opacity/100;}
else if(typeof(obj.style.MozOpacity) != "undefined")
{ obj.style.MozOpacity = opacity/100;}
else if(typeof(obj.style.filter) != "undefined")
{ obj.style.filter = "alpha(opacity:" + opacity + ")";}
else if(typeof(obj.style.KHTMLOpacity) != "undefined")
{ obj.style.KHTMLOpacity = opacity/100;}
}
function inArray(array, value)
{ for(var i = 0; i < array.length; i++){ if (array[i] === value) return i;}
return false;}
function inArrayKey(array, value)
{ for(key in array){ if(key === value) return true;}
return false;}
function addEvent(elm, evType, fn, useCapture) { if (elm.addEventListener) { elm.addEventListener(evType, fn, useCapture); return true;}
else if (elm.attachEvent) { var r = elm.attachEvent('on' + evType, fn); return r;}
else { elm['on' + evType] = fn;}
}
function removeEvent(obj, evType, fn, useCapture){ if (obj.removeEventListener){ obj.removeEventListener(evType, fn, useCapture); return true;} else if (obj.detachEvent){ var r = obj.detachEvent("on"+evType, fn); return r;}
}
function format_colour(colour)
{ var returnColour = "#ffffff"; if(colour != "" && colour != "transparent")
{ if(colour.substr(0, 3) == "rgb")
{ returnColour = rgb2Hex(colour);}
else if(colour.length == 4)
{ returnColour = "#" + colour.substring(1, 2) + colour.substring(1, 2) + colour.substring(2, 3) + colour.substring(2, 3) + colour.substring(3, 4) + colour.substring(3, 4);}
else
{ returnColour = colour;}
}
return returnColour;}
function get_style(obj, property, propertyNS)
{ try
{ if(obj.currentStyle)
{ var returnVal = eval("obj.currentStyle." + property);}
else
{ if(isSafari && obj.style.display == "none")
{ obj.style.display = ""; var wasHidden = true;}
var returnVal = document.defaultView.getComputedStyle(obj, '').getPropertyValue(propertyNS); if(isSafari && wasHidden)
{ obj.style.display = "none";}
}
}
catch(e)
{ }
return returnVal;}
function getElementsByClass(searchClass, node, tag)
{ var classElements = new Array(); if(node == null)
node = document; if(tag == null)
tag = '*'; var els = node.getElementsByTagName(tag); var elsLen = els.length; var pattern = new RegExp("(^|\s)"+searchClass+"(\s|$)"); for (i = 0, j = 0; i < elsLen; i++)
{ if(pattern.test(els[i].className))
{ classElements[j] = els[i]; j++;}
}
return classElements;}
function newCurvyError(errorMessage)
{ return new Error("curvyCorners Error:\n" + errorMessage)
}
/* mootools.js */
//MooTools, My Object Oriented Javascript Tools. Copyright (c) 2006-2007 Valerio Proietti, <http://mad4milk.net>, MIT Style License.
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('o 95={8Z:\'1.11\'};k $4Y(Q){h(Q!=6W)};k $B(Q){m(!$4Y(Q))h 14;m(Q.3d)h\'1b\';o B=4D Q;m(B==\'2h\'&&Q.90){1L(Q.5r){P 1:h\'1b\';P 3:h(/\\S/).28(Q.7r)?\'91\':\'93\'}}m(B==\'2h\'||B==\'k\'){1L(Q.6T){P 1U:h\'1g\';P 5Q:h\'3P\';P 1i:h\'58\'}m(4D Q.O==\'43\'){m(Q.2n)h\'9c\';m(Q.70)h\'15\'}}h B};k $2p(){o 3B={};J(o i=0;i<15.O;i++){J(o F 1j 15[i]){o ap=15[i][F];o 54=3B[F];m(54&&$B(ap)==\'2h\'&&$B(54)==\'2h\')3B[F]=$2p(54,ap);17 3B[F]=ap}}h 3B};o $N=k(){o 18=15;m(!18[1])18=[c,18[0]];J(o F 1j 18[1])18[0][F]=18[1][F];h 18[0]};o $3p=k(){J(o i=0,l=15.O;i<l;i++){15[i].N=k(1s){J(o 1y 1j 1s){m(!c.1p[1y])c.1p[1y]=1s[1y];m(!c[1y])c[1y]=$3p.4S(1y)}}}};$3p.4S=k(1y){h k(U){h c.1p[1y].3q(U,1U.1p.74.1R(15,1))}};$3p(5w,1U,4q,71);k $3U(Q){h!!(Q||Q===0)};k $3y(Q,6X){h $4Y(Q)?Q:6X};k $5F(2X,2J){h 1e.8y(1e.5F()*(2J-2X+1)+2X)};k $2x(){h Y 8l().8k()};k $6n(1W){8R(1W);8Q(1W);h 1d};o 2E=k(Q){Q=Q||{};Q.N=$N;h Q};o 8S=Y 2E(L);o 8T=Y 2E(M);M.6Y=M.2c(\'6Y\')[0];L.2O=!!(M.5a);m(L.88)L.1V=L[L.4O?\'8P\':\'6V\']=1h;17 m(M.77&&!M.8O&&!8J.8I)L.2Y=L[L.2O?\'8K\':\'57\']=1h;17 m(M.8N!=1d)L.68=1h;L.9e=L.2Y;5x.N=$N;m(4D 3K==\'6W\'){o 3K=k(){};m(L.2Y)M.6S("a2");3K.1p=(L.2Y)?L["[[a9.1p]]"]:{}}3K.1p.3d=k(){};m(L.6V)3b{M.ac("ag",14,1h)}3m(e){};o 1i=k(2k){o 3E=k(){h(15[0]!==1d&&c.1F&&$B(c.1F)==\'k\')?c.1F.3q(c,15):c};$N(3E,c);3E.1p=2k;3E.6T=1i;h 3E};1i.1M=k(){};1i.1p={N:k(2k){o 52=Y c(1d);J(o F 1j 2k){o 6U=52[F];52[F]=1i.6Z(6U,2k[F])}h Y 1i(52)},5I:k(){J(o i=0,l=15.O;i<l;i++)$N(c.1p,15[i])}};1i.6Z=k(2P,1B){m(2P&&2P!=1B){o B=$B(1B);m(B!=$B(2P))h 1B;1L(B){P\'k\':o 5o=k(){c.1J=15.70.1J;h 1B.3q(c,15)};5o.1J=2P;h 5o;P\'2h\':h $2p(2P,1B)}}h 1B};o 6k=Y 1i({9H:k(K){c.36=c.36||[];c.36.1a(K);h c},6r:k(){m(c.36&&c.36.O)c.36.7e().1O(10,c)},9J:k(){c.36=[]}});o 2e=Y 1i({2G:k(B,K){m(K!=1i.1M){c.$V=c.$V||{};c.$V[B]=c.$V[B]||[];c.$V[B].5E(K)}h c},1N:k(B,18,1O){m(c.$V&&c.$V[B]){c.$V[B].1A(k(K){K.2b({\'U\':c,\'1O\':1O,\'15\':18})()},c)}h c},5p:k(B,K){m(c.$V&&c.$V[B])c.$V[B].2W(K);h c}});o 6j=Y 1i({4M:k(){c.C=$2p.3q(1d,[c.C].N(15));m(c.2G){J(o 2C 1j c.C){m($B(c.C[2C]==\'k\')&&(/^6b[A-Z]/).28(2C))c.2G(2C,c.C[2C])}}h c}});1U.N({4L:k(K,U){J(o i=0,j=c.O;i<j;i++)K.1R(U,c[i],i,c)},2t:k(K,U){o 3e=[];J(o i=0,j=c.O;i<j;i++){m(K.1R(U,c[i],i,c))3e.1a(c[i])}h 3e},25:k(K,U){o 3e=[];J(o i=0,j=c.O;i<j;i++)3e[i]=K.1R(U,c[i],i,c);h 3e},4U:k(K,U){J(o i=0,j=c.O;i<j;i++){m(!K.1R(U,c[i],i,c))h 14}h 1h},9L:k(K,U){J(o i=0,j=c.O;i<j;i++){m(K.1R(U,c[i],i,c))h 1h}h 14},3h:k(2n,T){o 3a=c.O;J(o i=(T<0)?1e.2J(0,3a+T):T||0;i<3a;i++){m(c[i]===2n)h i}h-1},75:k(1H,O){1H=1H||0;m(1H<0)1H=c.O+1H;O=O||(c.O-1H);o 5y=[];J(o i=0;i<O;i++)5y[i]=c[1H++];h 5y},2W:k(2n){o i=0;o 3a=c.O;4C(i<3a){m(c[i]===2n){c.4i(i,1);3a--}17{i++}}h c},19:k(2n,T){h c.3h(2n,T)!=-1},9K:k(1z){o Q={},O=1e.2X(c.O,1z.O);J(o i=0;i<O;i++)Q[1z[i]]=c[i];h Q},N:k(1g){J(o i=0,j=1g.O;i<j;i++)c.1a(1g[i]);h c},2p:k(1g){J(o i=0,l=1g.O;i<l;i++)c.5E(1g[i]);h c},5E:k(2n){m(!c.19(2n))c.1a(2n);h c},9I:k(){h c[$5F(0,c.O-1)]||1d},76:k(){h c[c.O-1]||1d}});1U.1p.1A=1U.1p.4L;1U.1A=1U.4L;k $A(1g){h 1U.75(1g)};k $1A(2N,K,U){m(2N&&4D 2N.O==\'43\'&&$B(2N)!=\'2h\'){1U.4L(2N,K,U)}17{J(o 1m 1j 2N)K.1R(U||2N,2N[1m],1m)}};1U.1p.28=1U.1p.19;4q.N({28:k(4R,1Z){h(($B(4R)==\'1G\')?Y 5Q(4R,1Z):4R).28(c)},4P:k(){h 3I(c,10)},72:k(){h 3V(c)},5L:k(){h c.2A(/-\\D/g,k(2d){h 2d.5b(1).6t()})},6L:k(){h c.2A(/\\w[A-Z]/g,k(2d){h(2d.5b(0)+\'-\'+2d.5b(1).3Z())})},6C:k(){h c.2A(/\\b[a-z]/g,k(2d){h 2d.6t()})},5N:k(){h c.2A(/^\\s+|\\s+$/g,\'\')},5R:k(){h c.2A(/\\s{2,}/g,\' \').5N()},51:k(1g){o 22=c.2d(/\\d{1,3}/g);h(22)?22.51(1g):14},4p:k(1g){o 30=c.2d(/^#?(\\w{1,2})(\\w{1,2})(\\w{1,2})$/);h(30)?30.74(1).4p(1g):14},19:k(1G,s){h(s)?(s+c+s).3h(s+1G+s)>-1:c.3h(1G)>-1},8p:k(){h c.2A(/([.*+?^${}()|[\\]\\/\\\\])/g,\'\\\\$1\')}});1U.N({51:k(1g){m(c.O<3)h 14;m(c.O==4&&c[3]==0&&!1g)h\'9P\';o 30=[];J(o i=0;i<3;i++){o 3g=(c[i]-0).3A(16);30.1a((3g.O==1)?\'0\'+3g:3g)}h 1g?30:\'#\'+30.1w(\'\')},4p:k(1g){m(c.O!=3)h 14;o 22=[];J(o i=0;i<3;i++){22.1a(3I((c[i].O==1)?c[i]+c[i]:c[i],16))}h 1g?22:\'22(\'+22.1w(\',\')+\')\'}});5w.N({2b:k(C){o K=c;C=$2p({\'U\':K,\'H\':14,\'15\':1d,\'1O\':14,\'2T\':14,\'4F\':14},C);m($3U(C.15)&&$B(C.15)!=\'1g\')C.15=[C.15];h k(H){o 18;m(C.H){H=H||L.H;18=[(C.H===1h)?H:Y C.H(H)];m(C.15)18.N(C.15)}17 18=C.15||15;o 2y=k(){h K.3q($3y(C.U,K),18)};m(C.1O)h 7O(2y,C.1O);m(C.2T)h 9Q(2y,C.2T);m(C.4F)3b{h 2y()}3m(9G){h 14};h 2y()}},9F:k(18,U){h c.2b({\'15\':18,\'U\':U})},4F:k(18,U){h c.2b({\'15\':18,\'U\':U,\'4F\':1h})()},U:k(U,18){h c.2b({\'U\':U,\'15\':18})},9x:k(U,18){h c.2b({\'U\':U,\'H\':1h,\'15\':18})},1O:k(1O,U,18){h c.2b({\'1O\':1O,\'U\':U,\'15\':18})()},2T:k(73,U,18){h c.2b({\'2T\':73,\'U\':U,\'15\':18})()}});71.N({4P:k(){h 3I(c)},72:k(){h 3V(c)},9s:k(2X,2J){h 1e.2X(2J,1e.2J(2X,c))},3j:k(3W){3W=1e.2U(10,3W||0);h 1e.3j(c*3W)/3W},9z:k(K){J(o i=0;i<c;i++)K(i)}});o I=Y 1i({1F:k(q,1s){m($B(q)==\'1G\'){m(L.1V&&1s&&(1s.1m||1s.B)){o 1m=(1s.1m)?\' 1m="\'+1s.1m+\'"\':\'\';o B=(1s.B)?\' B="\'+1s.B+\'"\':\'\';5D 1s.1m;5D 1s.B;q=\'<\'+q+1m+B+\'>\'}q=M.6S(q)}q=$(q);h(!1s||!q)?q:q.2s(1s)}});o 1C=Y 1i({1F:k(R){h(R)?$N(R,c):c}});1C.N=k(1s){J(o 1y 1j 1s){c.1p[1y]=1s[1y];c[1y]=$3p.4S(1y)}};k $(q){m(!q)h 1d;m(q.3d)h 1Q.3r(q);m([L,M].19(q))h q;o B=$B(q);m(B==\'1G\'){q=M.4y(q);B=(q)?\'1b\':14}m(B!=\'1b\')h 1d;m(q.3d)h 1Q.3r(q);m([\'2h\',\'9E\'].19(q.4G.3Z()))h q;$N(q,I.1p);q.3d=k(){};h 1Q.3r(q)};M.4X=M.2c;k $$(){o R=[];J(o i=0,j=15.O;i<j;i++){o 1q=15[i];1L($B(1q)){P\'1b\':R.1a(1q);P\'9D\':1r;P 14:1r;P\'1G\':1q=M.4X(1q,1h);6p:R.N(1q)}}h $$.3F(R)};$$.3F=k(1g){o R=[];J(o i=0,l=1g.O;i<l;i++){m(1g[i].$4N)78;o 1b=$(1g[i]);m(1b&&!1b.$4N){1b.$4N=1h;R.1a(1b)}}J(o n=0,d=R.O;n<d;n++)R[n].$4N=1d;h Y 1C(R)};1C.4o=k(F){h k(){o 18=15;o 1f=[];o R=1h;J(o i=0,j=c.O,2y;i<j;i++){2y=c[i][F].3q(c[i],18);m($B(2y)!=\'1b\')R=14;1f.1a(2y)};h(R)?$$.3F(1f):1f}};I.N=k(2k){J(o F 1j 2k){3K.1p[F]=2k[F];I.1p[F]=2k[F];I[F]=$3p.4S(F);o 6R=(1U.1p[F])?F+\'1C\':F;1C.1p[6R]=1C.4o(F)}};I.N({2s:k(1s){J(o 1y 1j 1s){o 33=1s[1y];1L(1y){P\'af\':c.6K(33);1r;P\'V\':m(c.5g)c.5g(33);1r;P\'2k\':c.7s(33);1r;6p:c.4Z(1y,33)}}h c},3n:k(q,6H){q=$(q);1L(6H){P\'6I\':q.2m.6u(c,q);1r;P\'6G\':o 3v=q.6M();m(!3v)q.2m.69(c);17 q.2m.6u(c,3v);1r;P\'2w\':o 6o=q.62;m(6o){q.6u(c,6o);1r}6p:q.69(c)}h c},ai:k(q){h c.3n(q,\'6I\')},am:k(q){h c.3n(q,\'6G\')},aj:k(q){h c.3n(q,\'5v\')},ak:k(q){h c.3n(q,\'2w\')},aa:k(){o R=[];$1A(15,k(6F){R=R.61(6F)});$$(R).3n(c);h c},2W:k(){h c.2m.7q(c)},a1:k(6D){o q=$(c.9Z(6D!==14));m(!q.$V)h q;q.$V={};J(o B 1j c.$V)q.$V[B]={\'1z\':$A(c.$V[B].1z),\'29\':$A(c.$V[B].29)};h q.4g()},9W:k(q){q=$(q);c.2m.9X(q,c);h q},7p:k(1t){c.69(M.a3(1t));h c},5S:k(1n){h c.1n.19(1n,\' \')},6J:k(1n){m(!c.5S(1n))c.1n=(c.1n+\' \'+1n).5R();h c},6E:k(1n){c.1n=c.1n.2A(Y 5Q(\'(^|\\\\s)\'+1n+\'(?:\\\\s|$)\'),\'$1\').5R();h c},a7:k(1n){h c.5S(1n)?c.6E(1n):c.6J(1n)},45:k(F,G){1L(F){P\'1P\':h c.6P(3V(G));P\'ao\':F=(L.1V)?\'8M\':\'8L\'}F=F.5L();1L($B(G)){P\'43\':m(![\'8U\',\'6O\'].19(F))G+=\'41\';1r;P\'1g\':G=\'22(\'+G.1w(\',\')+\')\'}c.1k[F]=G;h c},6K:k(2i){1L($B(2i)){P\'2h\':I.4h(c,\'45\',2i);1r;P\'1G\':c.1k.5W=2i}h c},6P:k(1P){m(1P==0){m(c.1k.4J!="5q")c.1k.4J="5q"}17{m(c.1k.4J!="6Q")c.1k.4J="6Q"}m(!c.55||!c.55.8F)c.1k.6O=1;m(L.1V)c.1k.2t=(1P==1)?\'\':"8x(1P="+1P*8w+")";c.1k.1P=c.$2Q.1P=1P;h c},2H:k(F){F=F.5L();o 1l=c.1k[F];m(!$3U(1l)){m(F==\'1P\')h c.$2Q.1P;1l=[];J(o 1k 1j I.2K){m(F==1k){I.2K[1k].1A(k(s){o 1k=c.2H(s);1l.1a(3I(1k)?1k:\'7y\')},c);m(F==\'2F\'){o 4U=1l.4U(k(3g){h(3g==1l[0])});h(4U)?1l[0]:14}h 1l.1w(\' \')}}m(F.19(\'2F\')){m(I.2K.2F.19(F)){h[\'7z\',\'5V\',\'5K\'].25(k(p){h c.2H(F+p)},c).1w(\' \')}17 m(I.7d.19(F)){h[\'7v\',\'7w\',\'7m\',\'7l\'].25(k(p){h c.2H(\'2F\'+p+F.2A(\'2F\',\'\'))},c).1w(\' \')}}m(M.6N)1l=M.6N.8E(c,1d).8B(F.6L());17 m(c.55)1l=c.55[F]}m(L.1V)1l=I.7u(F,1l,c);m(1l&&F.28(/4s/i)&&1l.19(\'22\')){h 1l.4n(\'22\').4i(1,4).25(k(4s){h 4s.51()}).1w(\' \')}h 1l},8A:k(){h I.6l(c,\'2H\',15)},3L:k(4A,1H){4A+=\'9q\';o q=(1H)?c[1H]:c[4A];4C(q&&$B(q)!=\'1b\')q=q[4A];h $(q)},8X:k(){h c.3L(\'2P\')},6M:k(){h c.3L(\'3v\')},9g:k(){h c.3L(\'3v\',\'62\')},76:k(){h c.3L(\'2P\',\'9f\')},9d:k(){h $(c.2m)},9j:k(){h $$(c.77)},65:k(q){h!!$A(c.2c(\'*\')).19(q)},3z:k(F){o 2v=I.4u[F];m(2v)h c[2v];o 66=I.7b[F]||0;m(!L.1V||66)h c.9k(F,66);o 67=c.9o[F];h(67)?67.7r:1d},92:k(F){o 2v=I.4u[F];m(2v)c[2v]=\'\';17 c.8Y(F);h c},94:k(){h I.6l(c,\'3z\',15)},4Z:k(F,G){o 2v=I.4u[F];m(2v)c[2v]=G;17 c.9a(F,G);h c},7s:k(2i){h I.4h(c,\'4Z\',2i)},5f:k(){c.7o=$A(15).1w(\'\');h c},96:k(1t){o 2r=c.3t();m([\'1k\',\'21\'].19(2r)){m(L.1V){m(2r==\'1k\')c.7n.5W=1t;17 m(2r==\'21\')c.4Z(\'1t\',1t);h c}17{c.7q(c.62);h c.7p(1t)}}c[$4Y(c.5Z)?\'5Z\':\'7t\']=1t;h c},8G:k(){o 2r=c.3t();m([\'1k\',\'21\'].19(2r)){m(L.1V){m(2r==\'1k\')h c.7n.5W;17 m(2r==\'21\')h c.3z(\'1t\')}17{h c.7o}}h($3y(c.5Z,c.7t))},3t:k(){h c.4G.3Z()},1M:k(){1Q.4v(c.2c(\'*\'));h c.5f(\'\')}});I.7u=k(F,1l,1b){m($3U(3I(1l)))h 1l;m([\'5t\',\'3C\'].19(F)){o 29=(F==\'3C\')?[\'2D\',\'5B\']:[\'2w\',\'5v\'];o 3J=0;29.1A(k(G){3J+=1b.2H(\'2F-\'+G+\'-3C\').4P()+1b.2H(\'5P-\'+G).4P()});h 1b[\'bQ\'+F.6C()]-3J+\'41\'}17 m(F.28(/2F(.+)7z|7x|5P/)){h\'7y\'}h 1l};I.2K={\'2F\':[],\'5P\':[],\'7x\':[]};[\'7v\',\'7w\',\'7m\',\'7l\'].1A(k(7c){J(o 1k 1j I.2K)I.2K[1k].1a(1k+7c)});I.7d=[\'bY\',\'bW\',\'bX\'];I.6l=k(q,1E,1z){o 1l={};$1A(1z,k(1v){1l[1v]=q[1E](1v)});h 1l};I.4h=k(q,1E,6e){J(o 1v 1j 6e)q[1E](1v,6e[1v]);h q};I.4u=Y 2E({\'58\':\'1n\',\'J\':\'bM\',\'bD\':\'bE\',\'bC\':\'bB\',\'bz\':\'bA\',\'bF\':\'bG\',\'bL\':\'c2\',\'bK\':\'bJ\',\'bH\':\'bI\',\'G\':\'G\',\'5h\':\'5h\',\'5A\':\'5A\',\'5m\':\'5m\',\'6g\':\'6g\'});I.7b={\'c1\':2,\'49\':2};I.2g={48:{34:k(B,K){m(c.5z)c.5z(B,K,14);17 c.ci(\'6b\'+B,K);h c},7A:k(B,K){m(c.7a)c.7a(B,K,14);17 c.c8(\'6b\'+B,K);h c}}};L.N(I.2g.48);M.N(I.2g.48);I.N(I.2g.48);o 1Q={R:[],3r:k(q){m(!q.$2Q){1Q.R.1a(q);q.$2Q={\'1P\':1}}h q},4v:k(R){J(o i=0,j=R.O,q;i<j;i++){m(!(q=R[i])||!q.$2Q)78;m(q.$V)q.1N(\'4v\').4g();J(o p 1j q.$2Q)q.$2Q[p]=1d;J(o d 1j I.1p)q[d]=1d;1Q.R[1Q.R.3h(q)]=1d;q.3d=q.$2Q=q=1d}1Q.R.2W(1d)},1M:k(){1Q.3r(L);1Q.3r(M);1Q.4v(1Q.R)}};L.34(\'6w\',k(){L.34(\'5i\',1Q.1M);m(L.1V)L.34(\'5i\',c9)});o 26=Y 1i({1F:k(H){m(H&&H.$79)h H;c.$79=1h;H=H||L.H;c.H=H;c.B=H.B;c.3l=H.3l||H.cj;m(c.3l.5r==3)c.3l=c.3l.2m;c.7e=H.c7;c.c6=H.c3;c.c4=H.c5;c.ca=H.cb;m([\'6s\',\'4B\'].19(c.B)){c.cg=(H.7f)?H.7f/cf:-(H.ce||0)/3}17 m(c.B.19(\'1v\')){c.4b=H.7i||H.cc;J(o 1m 1j 26.1z){m(26.1z[1m]==c.4b){c.1v=1m;1r}}m(c.B==\'6A\'){o 4c=c.4b-cd;m(4c>0&&4c<13)c.1v=\'f\'+4c}c.1v=c.1v||4q.bx(c.4b).3Z()}17 m(c.B.28(/(6v|aP|aN)/)){c.aM={\'x\':H.5H||H.7k+M.23.3Y,\'y\':H.5C||H.7j+M.23.3H};c.aJ={\'x\':H.5H?H.5H-L.8b:H.7k,\'y\':H.5C?H.5C-L.8a:H.7j};c.aQ=(H.7i==3)||(H.aW==2);1L(c.B){P\'6m\':c.1D=H.1D||H.aX;1r;P\'6h\':c.1D=H.1D||H.aV}c.7g()}h c},3R:k(){h c.4a().4e()},4a:k(){m(c.H.4a)c.H.4a();17 c.H.aS=1h;h c},4e:k(){m(c.H.4e)c.H.4e();17 c.H.aI=14;h c}});26.4k={1D:k(){m(c.1D&&c.1D.5r==3)c.1D=c.1D.2m},7h:k(){3b{26.4k.1D.1R(c)}3m(e){c.1D=c.3l}}};26.1p.7g=(L.68)?26.4k.7h:26.4k.1D;26.1z=Y 2E({\'ar\':13,\'as\':38,\'at\':40,\'2D\':37,\'5B\':39,\'ay\':27,\'az\':32,\'aF\':8,\'aG\':9,\'5D\':46});I.2g.2e={2G:k(B,K){c.$V=c.$V||{};c.$V[B]=c.$V[B]||{\'1z\':[],\'29\':[]};m(c.$V[B].1z.19(K))h c;c.$V[B].1z.1a(K);o 4j=B;o 1K=I.2e[B];m(1K){m(1K.5s)1K.5s.1R(c,K);m(1K.25)K=1K.25;m(1K.B)4j=1K.B}m(!c.5z)K=K.2b({\'U\':c,\'H\':1h});c.$V[B].29.1a(K);h(I.6q.19(4j))?c.34(4j,K):c},5p:k(B,K){m(!c.$V||!c.$V[B])h c;o 1Y=c.$V[B].1z.3h(K);m(1Y==-1)h c;o 1v=c.$V[B].1z.4i(1Y,1)[0];o G=c.$V[B].29.4i(1Y,1)[0];o 1K=I.2e[B];m(1K){m(1K.2W)1K.2W.1R(c,K);m(1K.B)B=1K.B}h(I.6q.19(B))?c.7A(B,G):c},5g:k(2i){h I.4h(c,\'2G\',2i)},4g:k(B){m(!c.$V)h c;m(!B){J(o 4x 1j c.$V)c.4g(4x);c.$V=1d}17 m(c.$V[B]){c.$V[B].1z.1A(k(K){c.5p(B,K)},c);c.$V[B]=1d}h c},1N:k(B,18,1O){m(c.$V&&c.$V[B]){c.$V[B].1z.1A(k(K){K.2b({\'U\':c,\'1O\':1O,\'15\':18})()},c)}h c},6x:k(T,B){m(!T.$V)h c;m(!B){J(o 4x 1j T.$V)c.6x(T,4x)}17 m(T.$V[B]){T.$V[B].1z.1A(k(K){c.2G(B,K)},c)}h c}};L.N(I.2g.2e);M.N(I.2g.2e);I.N(I.2g.2e);I.2e=Y 2E({\'6B\':{B:\'6m\',25:k(H){H=Y 26(H);m(H.1D!=c&&!c.65(H.1D))c.1N(\'6B\',H)}},\'6z\':{B:\'6h\',25:k(H){H=Y 26(H);m(H.1D!=c&&!c.65(H.1D))c.1N(\'6z\',H)}},\'4B\':{B:(L.68)?\'6s\':\'4B\'}});I.6q=[\'6v\',\'bk\',\'bp\',\'bq\',\'4B\',\'6s\',\'6m\',\'6h\',\'bw\',\'6A\',\'bu\',\'bt\',\'7H\',\'5i\',\'6w\',\'bs\',\'bh\',\'bg\',\'b5\',\'7Y\',\'b6\',\'b4\',\'2R\',\'b3\',\'7L\',\'b0\',\'6a\'];5w.N({b2:k(U,18){h c.2b({\'U\':U,\'15\':18,\'H\':26})}});1C.N({bf:k(2r){h Y 1C(c.2t(k(q){h(I.3t(q)==2r)}))},8r:k(1n,1T){o R=c.2t(k(q){h(q.1n&&q.1n.19(1n,\' \'))});h(1T)?R:Y 1C(R)},8n:k(2Z,1T){o R=c.2t(k(q){h(q.2Z==2Z)});h(1T)?R:Y 1C(R)},7B:k(1m,5n,G,1T){o R=c.2t(k(q){o 1B=I.3z(q,1m);m(!1B)h 14;m(!5n)h 1h;1L(5n){P\'=\':h(1B==G);P\'*=\':h(1B.19(G));P\'^=\':h(1B.6y(0,G.O)==G);P\'$=\':h(1B.6y(1B.O-G.O)==G);P\'!=\':h(1B!=G);P\'~=\':h 1B.19(G,\' \')}h 14});h(1T)?R:Y 1C(R)}});k $E(1q,2t){h($(2t)||M).8h(1q)};k $bb(1q,2t){h($(2t)||M).4X(1q)};$$.2z={\'3P\':/^(\\w*|\\*)(?:#([\\w-]+)|\\.([\\w-]+))?(?:\\[(\\w+)(?:([!*^$]?=)["\']?([^"\'\\]]*)["\']?)?])?$/,\'2O\':{64:k(1f,2f,W,i){o 1X=[2f.ba?\'5T:\':\'\',W[1]];m(W[2])1X.1a(\'[@2Z="\',W[2],\'"]\');m(W[3])1X.1a(\'[19(61(" ", @58, " "), " \',W[3],\' ")]\');m(W[4]){m(W[5]&&W[6]){1L(W[5]){P\'*=\':1X.1a(\'[19(@\',W[4],\', "\',W[6],\'")]\');1r;P\'^=\':1X.1a(\'[b9-bc(@\',W[4],\', "\',W[6],\'")]\');1r;P\'$=\':1X.1a(\'[bd(@\',W[4],\', 1G-O(@\',W[4],\') - \',W[6].O,\' + 1) = "\',W[6],\'"]\');1r;P\'=\':1X.1a(\'[@\',W[4],\'="\',W[6],\'"]\');1r;P\'!=\':1X.1a(\'[@\',W[4],\'!="\',W[6],\'"]\')}}17{1X.1a(\'[@\',W[4],\']\')}}1f.1a(1X.1w(\'\'));h 1f},63:k(1f,2f,1T){o R=[];o 2O=M.5a(\'.//\'+1f.1w(\'//\'),2f,$$.2z.8m,be.b7,1d);J(o i=0,j=2O.b1;i<j;i++)R.1a(2O.br(i));h(1T)?R:Y 1C(R.25($))}},\'8s\':{64:k(1f,2f,W,i){m(i==0){m(W[2]){o q=2f.4y(W[2]);m(!q||((W[1]!=\'*\')&&(I.3t(q)!=W[1])))h 14;1f=[q]}17{1f=$A(2f.2c(W[1]))}}17{1f=$$.2z.2c(1f,W[1]);m(W[2])1f=1C.8n(1f,W[2],1h)}m(W[3])1f=1C.8r(1f,W[3],1h);m(W[4])1f=1C.7B(1f,W[4],W[5],W[6],1h);h 1f},63:k(1f,2f,1T){h(1T)?1f:$$.3F(1f)}},8m:k(8j){h(8j==\'5T\')?\'bv://7J.bj.bi/bl/5T\':14},2c:k(2f,4G){o 5O=[];J(o i=0,j=2f.O;i<j;i++)5O.N(2f[i].2c(4G));h 5O}};$$.2z.1E=(L.2O)?\'2O\':\'8s\';I.2g.6d={4w:k(1q,1T){o 1f=[];1q=1q.5N().4n(\' \');J(o i=0,j=1q.O;i<j;i++){o 8t=1q[i];o W=8t.2d($$.2z.3P);m(!W)1r;W[1]=W[1]||\'*\';o 1X=$$.2z[$$.2z.1E].64(1f,c,W,i);m(!1X)1r;1f=1X}h $$.2z[$$.2z.1E].63(1f,c,1T)},8h:k(1q){h $(c.4w(1q,1h)[0]||14)},4X:k(1q,1T){o R=[];1q=1q.4n(\',\');J(o i=0,j=1q.O;i<j;i++)R=R.61(c.4w(1q[i],1h));h(1T)?R:$$.3F(R)}};I.N({4y:k(2Z){o q=M.4y(2Z);m(!q)h 14;J(o 1J=q.2m;1J!=c;1J=1J.2m){m(!1J)h 14}h q},bm:k(1n){h c.4w(\'.\'+1n)}});M.N(I.2g.6d);I.N(I.2g.6d);I.N({35:k(){1L(c.3t()){P\'2R\':o 29=[];$1A(c.C,k(2C){m(2C.6g)29.1a($3y(2C.G,2C.1t))});h(c.5m)?29:29[0];P\'7N\':m(!(c.5A&&[\'bo\',\'bn\'].19(c.B))&&![\'5q\',\'1t\',\'aZ\'].19(c.B))1r;P\'7R\':h c.G}h 14},7S:k(){h $$(c.2c(\'7N\'),c.2c(\'2R\'),c.2c(\'7R\'))},3w:k(){o 3k=[];c.7S().1A(k(q){o 1m=q.1m;o G=q.35();m(G===14||!1m||q.5h)h;o 5c=k(33){3k.1a(1m+\'=\'+4I(33))};m($B(G)==\'1g\')G.1A(5c);17 5c(G)});h 3k.1w(\'&\')}});I.N({aY:k(x,y){c.3Y=x;c.3H=y},89:k(){h{\'6a\':{\'x\':c.3Y,\'y\':c.3H},\'3J\':{\'x\':c.5k,\'y\':c.5e},\'8g\':{\'x\':c.4d,\'y\':c.4m}}},3D:k(2o){2o=2o||[];o q=c,2D=0,2w=0;aC{2D+=q.aB||0;2w+=q.aA||0;q=q.aD}4C(q);2o.1A(k(1b){2D-=1b.3Y||0;2w-=1b.3H||0});h{\'x\':2D,\'y\':2w}},aE:k(2o){h c.3D(2o).y},au:k(2o){h c.3D(2o).x},av:k(2o){o 5u=c.3D(2o);o Q={\'3C\':c.5k,\'5t\':c.5e,\'2D\':5u.x,\'2w\':5u.y};Q.5B=Q.2D+Q.3C;Q.5v=Q.2w+Q.5t;h Q}});I.2e.59={5s:k(K){m(L.4f){K.1R(c);h}o 3S=k(){m(L.4f)h;L.4f=1h;L.1W=$6n(L.1W);c.1N(\'59\')}.U(c);m(M.3M&&L.2Y){L.1W=k(){m([\'4f\',\'7G\'].19(M.3M))3S()}.2T(50)}17 m(M.3M&&L.1V){m(!$(\'5G\')){o 49=(L.ax.aw==\'aH:\')?\'://0\':\'7M:by(0)\';M.aU(\'<21 2Z="5G" aR 49="\'+49+\'"><\\/21>\');$(\'5G\').4T=k(){m(c.3M==\'7G\')3S()}}}17{L.34("7H",3S);M.34("aL",3S)}}};L.aK=k(K){h c.2G(\'59\',K)};L.N({8c:k(){m(c.57)h c.aO;m(c.7W)h M.4l.7K;h M.23.7K},8d:k(){m(c.57)h c.ch;m(c.7W)h M.4l.7X;h M.23.7X},8f:k(){m(c.1V)h 1e.2J(M.23.5k,M.23.4d);m(c.2Y)h M.4l.4d;h M.23.4d},8e:k(){m(c.1V)h 1e.2J(M.23.5e,M.23.4m);m(c.2Y)h M.4l.4m;h M.23.4m},87:k(){h c.8b||M.23.3Y},81:k(){h c.8a||M.23.3H},89:k(){h{\'3J\':{\'x\':c.8c(),\'y\':c.8d()},\'8g\':{\'x\':c.8f(),\'y\':c.8e()},\'6a\':{\'x\':c.87(),\'y\':c.81()}}},3D:k(){h{\'x\':0,\'y\':0}}});o 1c={};1c.4r=Y 1i({C:{86:1i.1M,3s:1i.1M,6f:1i.1M,1x:k(p){h-(1e.80(1e.5U*p)-1)/2},2M:bN,2j:\'41\',44:1h,83:50},1F:k(C){c.1b=c.1b||1d;c.4M(C);m(c.C.1F)c.C.1F.1R(c)},82:k(){o 2x=$2x();m(2x<c.2x+c.C.2M){c.7Z=c.C.1x((2x-c.2x)/c.C.2M);c.4z();c.47()}17{c.3R(1h);c.2s(c.12);c.1N(\'3s\',c.1b,10);c.6r()}},2s:k(12){c.1S=12;c.47();h c},4z:k(){c.1S=c.3G(c.T,c.12)},3G:k(T,12){h(12-T)*c.7Z+T},1H:k(T,12){m(!c.C.44)c.3R();17 m(c.1W)h c;c.T=T;c.12=12;c.7Y=c.12-c.T;c.2x=$2x();c.1W=c.82.2T(1e.3j(8o/c.C.83),c);c.1N(\'86\',c.1b);h c},3R:k(4t){m(!c.1W)h c;c.1W=$6n(c.1W);m(!4t)c.1N(\'6f\',c.1b);h c},1K:k(T,12){h c.1H(T,12)},c0:k(4t){h c.3R(4t)}});1c.4r.5I(Y 6k,Y 2e,Y 6j);1c.2L={2R:k(F,12){m(F.28(/4s/i))h c.5K;o B=$B(12);m((B==\'1g\')||(B==\'1G\'&&12.19(\' \')))h c.4o;h c.85},2l:k(q,F,3c){m(!3c.1a)3c=[3c];o T=3c[0],12=3c[1];m(!$3U(12)){12=T;T=q.2H(F)}o 1u=c.2R(F,12);h{\'T\':1u.2l(T),\'12\':1u.2l(12),\'1u\':1u}}};1c.2L.85={2l:k(G){h 3V(G)},3u:k(T,12,3f){h 3f.3G(T,12)},35:k(G,2j,F){m(2j==\'41\'&&F!=\'1P\')G=1e.3j(G);h G+2j}};1c.2L.4o={2l:k(G){h G.1a?G:G.4n(\' \').25(k(v){h 3V(v)})},3u:k(T,12,3f){o 1S=[];J(o i=0;i<T.O;i++)1S[i]=3f.3G(T[i],12[i]);h 1S},35:k(G,2j,F){m(2j==\'41\'&&F!=\'1P\')G=G.25(1e.3j);h G.1w(2j+\' \')+2j}};1c.2L.5K={2l:k(G){h G.1a?G:G.4p(1h)},3u:k(T,12,3f){o 1S=[];J(o i=0;i<T.O;i++)1S[i]=1e.3j(3f.3G(T[i],12[i]));h 1S},35:k(G){h\'22(\'+G.1w(\',\')+\')\'}};1c.5V=1c.4r.N({1F:k(q,F,C){c.1b=$(q);c.F=F;c.1J(C)},bV:k(){h c.2s(0)},4z:k(){c.1S=c.1u.3u(c.T,c.12,c)},2s:k(12){c.1u=1c.2L.2R(c.F,12);h c.1J(c.1u.2l(12))},1H:k(T,12){m(c.1W&&c.C.44)h c;o 2a=1c.2L.2l(c.1b,c.F,[T,12]);c.1u=2a.1u;h c.1J(2a.T,2a.12)},47:k(){c.1b.45(c.F,c.1u.35(c.1S,c.C.2j,c.F))}});I.N({bU:k(F,C){h Y 1c.5V(c,F,C)}});1c.2K=1c.4r.N({1F:k(q,C){c.1b=$(q);c.1J(C)},4z:k(){J(o p 1j c.T)c.1S[p]=c.1u[p].3u(c.T[p],c.12[p],c)},2s:k(12){o 2a={};c.1u={};J(o p 1j 12){c.1u[p]=1c.2L.2R(p,12[p]);2a[p]=c.1u[p].2l(12[p])}h c.1J(2a)},1H:k(Q){m(c.1W&&c.C.44)h c;c.1S={};c.1u={};o T={},12={};J(o p 1j Q){o 2a=1c.2L.2l(c.1b,p,Q[p]);T[p]=2a.T;12[p]=2a.12;c.1u[p]=2a.1u}h c.1J(T,12)},47:k(){J(o p 1j c.1S)c.1b.45(p,c.1u[p].35(c.1S[p],c.C.2j,p))}});I.N({bO:k(C){h Y 1c.2K(c,C)}});1c.5M=k(1x,1Z){1Z=1Z||[];m($B(1Z)!=\'1g\')1Z=[1Z];h $N(1x,{bR:k(1Y){h 1x(1Y,1Z)},bT:k(1Y){h 1-1x(1-1Y,1Z)},bS:k(1Y){h(1Y<=0.5)?1x(2*1Y,1Z)/2:(2-1x(2*(1-1Y),1Z))/2}})};1c.2q=Y 2E({aq:k(p){h p}});1c.2q.N=k(5Y){J(o 1x 1j 5Y){1c.2q[1x]=Y 1c.5M(5Y[1x]);1c.2q.5J(1x)}};1c.2q.5J=k(1x){[\'aT\',\'ad\',\'8D\'].1A(k(5X){1c.2q[1x.3Z()+5X]=1c.2q[1x][\'8W\'+5X]})};1c.2q.N({9b:k(p,x){h 1e.2U(p,x[0]||6)},99:k(p){h 1e.2U(2,8*(p-1))},9h:k(p){h 1-1e.84(1e.97(p))},98:k(p){h 1-1e.84((1-p)*1e.5U/2)},9l:k(p,x){x=x[0]||1.9n;h 1e.2U(p,2)*((x+1)*p-x)},9p:k(p){o G;J(o a=0,b=1;1;a+=b,b/=2){m(p>=(7-4*a)/11){G=-1e.2U((11-6*a-11*p)/4,2)+b*b;1r}}h G},9i:k(p,x){h 1e.2U(2,10*--p)*1e.80(20*p*1e.5U*(x[0]||1)/3)}});[\'8C\',\'8z\',\'8v\',\'8u\'].1A(k(1x,i){1c.2q[1x]=Y 1c.5M(k(p){h 1e.2U(p,[i+2])});1c.2q.5J(1x)});o 6i=Y 1i({C:{1E:\'3i\',7C:1h,7E:1i.1M,3x:1i.1M,4E:1i.1M,7I:1h,3N:\'8H-8\',8i:14,2V:{}},6c:k(){c.1I=(L.4O)?Y 4O():(L.1V?Y 88(\'a5.a4\'):14);h c},1F:k(C){c.6c().4M(C);c.C.3Q=c.C.3Q||c.3Q;c.2V={};m(c.C.7I&&c.C.1E==\'3i\'){o 3N=(c.C.3N)?\'; 9r=\'+c.C.3N:\'\';c.3X(\'7U-B\',\'7T/x-7J-9Y-a0\'+3N)}m(c.C.1F)c.C.1F.1R(c)},7D:k(){m(c.1I.3M!=4||!c.3o)h;c.3o=14;o 2S=0;3b{2S=c.1I.2S}3m(e){};m(c.C.3Q.1R(c,2S))c.3x();17 c.4E();c.1I.4T=1i.1M},3Q:k(2S){h((2S>=al)&&(2S<an))},3x:k(){c.2I={\'1t\':c.1I.ah,\'3O\':c.1I.ab};c.1N(\'3x\',[c.2I.1t,c.2I.3O]);c.6r()},4E:k(){c.1N(\'4E\',c.1I)},3X:k(1m,G){c.2V[1m]=G;h c},4V:k(2B,1o){m(c.C.8i)c.7F();17 m(c.3o)h c;c.3o=1h;m(1o&&c.C.1E==\'5l\'){2B=2B+(2B.19(\'?\')?\'&\':\'?\')+1o;1o=1d}c.1I.ae(c.C.1E.6t(),2B,c.C.7C);c.1I.4T=c.7D.U(c);m((c.C.1E==\'3i\')&&c.1I.9V)c.3X(\'9U\',\'9B\');$N(c.2V,c.C.2V);J(o B 1j c.2V)3b{c.1I.9A(B,c.2V[B])}3m(e){};c.1N(\'7E\');c.1I.4V($3y(1o,1d));h c},7F:k(){m(!c.3o)h c;c.3o=14;c.1I.7L();c.1I.4T=1i.1M;c.6c();c.1N(\'6f\');h c}});6i.5I(Y 6k,Y 2e,Y 6j);o 7Q=6i.N({C:{1o:1d,5j:1d,3s:1i.1M,4Q:14,5d:14},1F:k(2B,C){c.2G(\'3x\',c.3s);c.4M(C);c.C.1o=c.C.1o||c.C.9C;m(![\'3i\',\'5l\'].19(c.C.1E)){c.3T=\'3T=\'+c.C.1E;c.C.1E=\'3i\'}c.1J();c.3X(\'X-9y-9t\',\'4O\');c.3X(\'9u\',\'1t/7M, 1t/9v, 7T/3O, 1t/3O, */*\');c.2B=2B},3s:k(){m(c.C.5j)$(c.C.5j).1M().5f(c.2I.1t);m(c.C.4Q||c.C.5d)c.4Q();c.1N(\'3s\',[c.2I.1t,c.2I.3O],20)},8q:k(1o){1o=1o||c.C.1o;1L($B(1o)){P\'1b\':1o=$(1o).3w();1r;P\'2h\':1o=5x.3w(1o)}m(c.3T)1o=(1o)?[c.3T,1o].1w(\'&\'):c.3T;h c.4V(c.2B,1o)},4Q:k(){o 21,2u;m(c.C.5d||(/(9R|9S)21/).28(c.7P(\'7U-B\')))2u=c.2I.1t;17{2u=[];o 3P=/<21[^>]*>([\\s\\S]*?)<\\/21>/9T;4C((21=3P.9O(c.2I.1t)))2u.1a(21[1]);2u=2u.1w(\'\\n\')}m(2u)(L.7V)?L.7V(2u):L.7O(2u,0)},7P:k(1m){3b{h c.1I.9M(1m)}3m(e){};h 1d}});5x.3w=k(2i){o 3k=[];J(o F 1j 2i)3k.1a(4I(F)+\'=\'+4I(2i[F]));h 3k.1w(\'&\')};I.N({4V:k(C){h Y 7Q(c.3z(\'a8\'),$2p({1o:c.3w()},C,{1E:\'3i\'})).8q()}});o 9N=Y 2E({C:{4H:14,56:14,2M:14,42:14},2s:k(1v,G,C){C=$2p(c.C,C);G=4I(G);m(C.4H)G+=\'; 4H=\'+C.4H;m(C.56)G+=\'; 56=\'+C.56;m(C.2M){o 4W=Y 8l();4W.9w(4W.8k()+C.2M*24*60*60*8o);G+=\'; a6=\'+4W.8V()}m(C.42)G+=\'; 42\';M.31=1v+\'=\'+G;h $N(C,{\'1v\':1v,\'G\':G})},5l:k(1v){o G=M.31.2d(\'(?:^|;)\\\\s*\'+1v.8p()+\'=([^;]*)\');h G?9m(G[1]):14},2W:k(31,C){m($B(31)==\'2h\')c.2s(31.1v,\'\',$2p(31,{2M:-1}));17 c.2s(31,\'\',$2p(C,{2M:-1}))}});o 4K={3A:k(Q){1L($B(Q)){P\'1G\':h\'"\'+Q.2A(/(["\\\\])/g,\'\\\\$1\')+\'"\';P\'1g\':h\'[\'+Q.25(4K.3A).1w(\',\')+\']\';P\'2h\':o 1G=[];J(o F 1j Q)1G.1a(4K.3A(F)+\':\'+4K.3A(Q[F]));h\'{\'+1G.1w(\',\')+\'}\';P\'43\':m(bP(Q))1r;P 14:h\'1d\'}h 4q(Q)},5a:k(53,42){h(($B(53)!=\'1G\')||(42&&!53.28(/^("(\\\\.|[^"\\\\\\n\\r])*?"|[,:{}\\[\\]0-9.\\-+b8-u \\n\\r\\t])+?$/)))?1d:bZ(\'(\'+53+\')\')}};',62,764,'||||||||||||this|||||return|||function||if||var||el|||||||||||type|options|||property|value|event|Element|for|fn|window|document|extend|length|case|obj|elements||from|bind|events|param||new||||to||false|arguments||else|args|contains|push|element|Fx|null|Math|items|array|true|Class|in|style|result|name|className|data|prototype|selector|break|props|text|css|key|join|transition|prop|keys|each|current|Elements|relatedTarget|method|initialize|string|start|transport|parent|custom|switch|empty|fireEvent|delay|opacity|Garbage|call|now|nocash|Array|ie|timer|temp|pos|params||script|rgb|documentElement||map|Event||test|values|parsed|create|getElementsByTagName|match|Events|context|Methods|object|source|unit|properties|parse|parentNode|item|overflown|merge|Transitions|tag|set|filter|scripts|index|top|time|returns|shared|replace|url|option|left|Abstract|border|addEvent|getStyle|response|max|Styles|CSS|duration|iterable|xpath|previous|tmp|select|status|periodical|pow|headers|remove|min|webkit|id|hex|cookie||val|addListener|getValue|chains||||len|try|fromTo|htmlElement|results|fx|bit|indexOf|post|round|queryString|target|catch|inject|running|native|apply|collect|onComplete|getTag|getNow|next|toQueryString|onSuccess|pick|getProperty|toString|mix|width|getPosition|klass|unique|compute|scrollTop|parseInt|size|HTMLElement|walk|readyState|encoding|xml|regexp|isSuccess|stop|domReady|_method|chk|parseFloat|precision|setHeader|scrollLeft|toLowerCase||px|secure|number|wait|setStyle||increase|Listeners|src|stopPropagation|code|fKey|scrollWidth|preventDefault|loaded|removeEvents|setMany|splice|realType|fix|body|scrollHeight|split|Multi|hexToRgb|String|Base|color|end|Properties|trash|getElements|evType|getElementById|setNow|brother|mousewheel|while|typeof|onFailure|attempt|tagName|domain|encodeURIComponent|visibility|Json|forEach|setOptions|included|XMLHttpRequest|toInt|evalScripts|regex|generic|onreadystatechange|every|send|date|getElementsBySelector|defined|setProperty||rgbToHex|proto|str|mp|currentStyle|path|webkit419|class|domready|evaluate|charAt|qs|evalResponse|offsetHeight|setHTML|addEvents|disabled|unload|update|offsetWidth|get|multiple|operator|merged|removeEvent|hidden|nodeType|add|height|position|bottom|Function|Object|newArray|addEventListener|checked|right|pageY|delete|include|random|ie_ready|pageX|implement|compat|Color|camelCase|Transition|trim|found|padding|RegExp|clean|hasClass|xhtml|PI|Style|cssText|easeType|transitions|innerText||concat|firstChild|getItems|getParam|hasChild|flag|node|gecko|appendChild|scroll|on|setTransport|Dom|pairs|onCancel|selected|mouseout|XHR|Options|Chain|getMany|mouseover|clear|first|default|NativeEvents|callChain|DOMMouseScroll|toUpperCase|insertBefore|click|beforeunload|cloneEvents|substr|mouseleave|keydown|mouseenter|capitalize|contents|removeClass|argument|after|where|before|addClass|setStyles|hyphenate|getNext|defaultView|zoom|setOpacity|visible|elementsProperty|createElement|constructor|pp|ie6|undefined|picked|head|Merge|callee|Number|toFloat|interval|slice|copy|getLast|childNodes|continue|extended|removeEventListener|PropertiesIFlag|direction|borderShort|shift|wheelDelta|fixRelatedTarget|relatedTargetGecko|which|clientY|clientX|Left|Bottom|styleSheet|innerHTML|appendText|removeChild|nodeValue|setProperties|textContent|fixStyle|Top|Right|margin|0px|Width|removeListener|filterByAttribute|async|onStateChange|onRequest|cancel|complete|load|urlEncoded|www|clientWidth|abort|javascript|input|setTimeout|getHeader|Ajax|textarea|getFormElements|application|Content|execScript|opera|clientHeight|change|delta|cos|getScrollTop|step|fps|sin|Single|onStart|getScrollLeft|ActiveXObject|getSize|pageYOffset|pageXOffset|getWidth|getHeight|getScrollHeight|getScrollWidth|scrollSize|getElement|autoCancel|prefix|getTime|Date|resolver|filterById|1000|escapeRegExp|request|filterByClass|normal|sel|Quint|Quart|100|alpha|floor|Cubic|getStyles|getPropertyValue|Quad|InOut|getComputedStyle|hasLayout|getText|utf|taintEnabled|navigator|webkit420|cssFloat|styleFloat|getBoxObjectFor|all|ie7|clearInterval|clearTimeout|Window|Document|zIndex|toGMTString|ease|getPrevious|removeAttribute|version|nodeName|textnode|removeProperty|whitespace|getProperties|MooTools|setText|acos|Sine|Expo|setAttribute|Pow|collection|getParent|khtml|lastChild|getFirst|Circ|Elastic|getChildren|getAttribute|Back|decodeURIComponent|618|attributes|Bounce|Sibling|charset|limit|With|Accept|html|setTime|bindAsEventListener|Requested|times|setRequestHeader|close|postBody|boolean|embed|pass|err|chain|getRandom|clearChain|associate|some|getResponseHeader|Cookie|exec|transparent|setInterval|ecma|java|gi|Connection|overrideMimeType|replaceWith|replaceChild|form|cloneNode|urlencoded|clone|iframe|createTextNode|XMLHTTP|Microsoft|expires|toggleClass|action|DOMElement|adopt|responseXML|execCommand|Out|open|styles|BackgroundImageCache|responseText|injectBefore|injectInside|injectTop|200|injectAfter|300|float||linear|enter|up|down|getLeft|getCoordinates|protocol|location|esc|space|offsetTop|offsetLeft|do|offsetParent|getTop|backspace|tab|https|returnValue|client|onDomReady|DOMContentLoaded|page|menu|innerWidth|mouse|rightClick|defer|cancelBubble|In|write|toElement|button|fromElement|scrollTo|password|contextmenu|snapshotLength|bindWithEvent|error|reset|blur|submit|UNORDERED_NODE_SNAPSHOT_TYPE|Eaeflnr|starts|namespaceURI|ES|with|substring|XPathResult|filterByTag|focus|move|org|w3|dblclick|1999|getElementsByClassName|radio|checkbox|mouseup|mousedown|snapshotItem|resize|keyup|keypress|http|mousemove|fromCharCode|void|accesskey|accessKey|rowSpan|rowspan|colspan|colSpan|tabindex|tabIndex|frameborder|frameBorder|readOnly|readonly|maxlength|htmlFor|500|effects|isFinite|offset|easeIn|easeInOut|easeOut|effect|hide|borderStyle|borderColor|borderWidth|eval|clearTimer|href|maxLength|ctrlKey|alt|altKey|control|shiftKey|detachEvent|CollectGarbage|meta|metaKey|keyCode|111|detail|120|wheel|innerHeight|attachEvent|srcElement'.split('|'),0,{}))
/* autocompleter.js */
/**
* Autocompleter
*
* @version		1.0rc4
*
* @license		MIT-style license
* @author		Harald Kirschner <mail [at] digitarald.de>
* @copyright	Author
*/
var Autocompleter = {};
Autocompleter.Base = new Class({
options: {
minLength: 1,
useSelection: true,
markQuery: true,
inheritWidth: true,
maxChoices: 10,
injectChoice: null,
onSelect: Class.empty,
onShow: Class.empty,
onHide: Class.empty,
customTarget: null,
className: 'autocompleter-choices',
zIndex: 42,
observerOptions: {},
fxOptions: {},
overflown: []
},
initialize: function(el, options) {
this.setOptions(options);
this.element = $(el);
this.build();
this.observer = new Observer(this.element, this.prefetch.bind(this), $merge({
delay: 400
}, this.options.observerOptions));
this.value = this.observer.value;
this.queryValue = null;
},
/**
* build - Initialize DOM
*
* Builds the html structure for choices and appends the events to the element.
* Override this function to modify the html generation.
*/
build: function() {
if ($(this.options.customTarget)) this.choices = this.options.customTarget;
else {
this.choices = new Element('ul', {
'class': this.options.className,
styles: {zIndex: this.options.zIndex}
}).injectInside(document.body);
this.fix = new OverlayFix(this.choices);
}
this.fx = this.choices.effect('opacity', $merge({
wait: false,
duration: 200
}, this.options.fxOptions))
.addEvent('onStart', function() {
if (this.fx.now) return;
this.choices.setStyle('display', '');
this.fix.show();
}.bind(this))
.addEvent('onComplete', function() {
if (this.fx.now) return;
this.choices.setStyle('display', 'none');
this.fix.hide();
}.bind(this)).set(0);
this.element.setProperty('autocomplete', 'off')
.addEvent(window.ie ? 'keydown' : 'keypress', this.onCommand.bindWithEvent(this))
.addEvent('mousedown', this.onCommand.bindWithEvent(this, [true]))
.addEvent('focus', this.toggleFocus.bind(this, [true]))
.addEvent('blur', this.toggleFocus.bind(this, [false]))
.addEvent('trash', this.destroy.bind(this));
},
destroy: function() {
this.choices.remove();
},
toggleFocus: function(state) {
this.focussed = state;
if (!state) this.hideChoices();
},
onCommand: function(e, mouse) {
if (mouse && this.focussed) this.prefetch();
if (e.key && !e.shift) switch (e.key) {
case 'enter':
if (this.selected && this.visible) {
this.choiceSelect(this.selected);
e.stop();
} return;
case 'up': case 'down':
if (this.observer.value != (this.value || this.queryValue)) this.prefetch();
else if (this.queryValue === null) break;
else if (!this.visible) this.showChoices();
else {
this.choiceOver((e.key == 'up')
? this.selected.getPrevious() || this.choices.getLast()
: this.selected.getNext() || this.choices.getFirst() );
this.setSelection();
}
e.stop(); return;
case 'esc': this.hideChoices(); return;
}
this.value = false;
},
setSelection: function() {
if (!this.options.useSelection) return;
var startLength = this.queryValue.length;
if (this.element.value.indexOf(this.queryValue) != 0) return;
var insert = this.selected.inputValue.substr(startLength);
if (document.getSelection) {
this.element.value = this.queryValue + insert;
this.element.selectionStart = startLength;
this.element.selectionEnd = this.element.value.length;
} else if (document.selection) {
var sel = document.selection.createRange();
sel.text = insert;
sel.move("character", - insert.length);
sel.findText(insert);
sel.select();
}
this.value = this.observer.value = this.element.value;
},
hideChoices: function() {
if (!this.visible) return;
this.visible = this.value = false;
this.observer.clear();
this.fx.start(0);
this.fireEvent('onHide', [this.element, this.choices]);
},
showChoices: function() {
if (this.visible || !this.choices.getFirst()) return;
this.visible = true;
var pos = this.element.getCoordinates(this.options.overflown);
this.choices.setStyles({
left: pos.left,
top: pos.bottom
});
if (this.options.inheritWidth) this.choices.setStyle('width', pos.width);
this.fx.start(1);
this.choiceOver(this.choices.getFirst());
this.fireEvent('onShow', [this.element, this.choices]);
},
prefetch: function() {
if (this.element.value.length < this.options.minLength) this.hideChoices();
else if (this.element.value == this.queryValue) this.showChoices();
else this.query();
},
updateChoices: function(choices) {
this.choices.empty();
this.selected = null;
if (!choices || !choices.length) return;
if (this.options.maxChoices < choices.length) choices.length = this.options.maxChoices;
choices.each(this.options.injectChoice || function(choice, i){
var el = new Element('li').setHTML(this.markQueryValue(choice));
el.inputValue = choice;
this.addChoiceEvents(el).injectInside(this.choices);
}, this);
this.showChoices();
},
choiceOver: function(el) {
if (this.selected) this.selected.removeClass('autocompleter-selected');
this.selected = el.addClass('autocompleter-selected');
},
choiceSelect: function(el) {
this.observer.value = this.element.value = el.inputValue;
this.hideChoices();
this.fireEvent('onSelect', [this.element], 20);
},
/**
* markQueryValue
*
* Marks the queried word in the given string with <span class="autocompleter-queried">*</span>
* Call this i.e. from your custom parseChoices, same for addChoiceEvents
*
* @param		{String} Text
* @return		{String} Text
*/
markQueryValue: function(txt) {
return (this.options.markQuery && this.queryValue) ? txt.replace(new RegExp('(' + this.queryValue.escapeRegExp() + ')', 'i'), '<span class="autocompleter-queried">$1</span>') : txt;
},
/**
* addChoiceEvents
*
* Appends the needed event handlers for a choice-entry to the given element.
*
* @param		{Element} Choice entry
* @return		{Element} Choice entry
*/
addChoiceEvents: function(el) {
return el.addEvents({
mouseover: this.choiceOver.bind(this, [el]),
mousedown: this.choiceSelect.bind(this, [el])
});
}
});
Autocompleter.Base.implement(new Events);
Autocompleter.Base.implement(new Options);
Autocompleter.Local = Autocompleter.Base.extend({
options: {
minLength: 0,
filterTokens : null
},
initialize: function(el, tokens, options) {
this.parent(el, options);
this.tokens = tokens;
if (this.options.filterTokens) this.filterTokens = this.options.filterTokens.bind(this);
},
query: function() {
this.hideChoices();
this.queryValue = this.element.value;
this.updateChoices(this.filterTokens());
},
filterTokens: function(token) {
var regex = new RegExp(this.queryValue.escapeRegExp(), 'i');
return this.tokens.filter(function(token) {
return regex.test(token);
});
}
});
Autocompleter.Ajax = {};
Autocompleter.Ajax.Base = Autocompleter.Base.extend({
options: {
postVar: 'value',
postData: {},
ajaxOptions: {},
onRequest: Class.empty,
onComplete: Class.empty
},
initialize: function(el, url, options) {
this.parent(el, options);
this.ajax = new Ajax(url, $merge({
autoCancel: true
}, this.options.ajaxOptions));
this.ajax.addEvent('onComplete', this.queryResponse.bind(this));
this.ajax.addEvent('onFailure', this.queryResponse.bind(this, [false]));
},
query: function(){
var data = $extend({}, this.options.postData);
data[this.options.postVar] = this.element.value;
this.fireEvent('onRequest', [this.element, this.ajax]);
this.ajax.request(data);
},
/**
* queryResponse - abstract
*
* Inherated classes have to extend this function and use this.parent(resp)
*
* @param		{String} Response
*/
queryResponse: function(resp) {
this.value = this.queryValue = this.element.value;
this.selected = false;
this.hideChoices();
this.fireEvent(resp ? 'onComplete' : 'onFailure', [this.element, this.ajax], 20);
}
});
Autocompleter.Ajax.Json = Autocompleter.Ajax.Base.extend({
queryResponse: function(resp) {
this.parent(resp);
var choices = Json.evaluate(resp || false);
if (!choices || !choices.length) return;
this.updateChoices(choices);
}
});
Autocompleter.Ajax.Xhtml = Autocompleter.Ajax.Base.extend({
options: {
parseChoices: null
},
queryResponse: function(resp) {
this.parent(resp);
if (!resp) return;
this.choices.setHTML(resp).getChildren().each(this.options.parseChoices || this.parseChoices, this);
this.showChoices();
},
parseChoices: function(el) {
var value = el.innerHTML;
el.inputValue = value;
el.setHTML(this.markQueryValue(value));
}
});
var OverlayFix = new Class({
initialize: function(el) {
this.element = $(el);
if (window.ie){
this.element.addEvent('trash', this.destroy.bind(this));
this.fix = new Element('iframe', {
properties: {
frameborder: '0',
scrolling: 'no',
src: 'javascript:false;'
},
styles: {
position: 'absolute',
border: 'none',
display: 'none',
filter: 'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'
}
}).injectAfter(this.element);
}
},
show: function() {
if (this.fix) this.fix.setStyles($extend(
this.element.getCoordinates(), {
display: '',
zIndex: (this.element.getStyle('zIndex') || 1) - 1
}));
return this;
},
hide: function() {
if (this.fix) this.fix.setStyle('display', 'none');
return this;
},
destroy: function() {
this.fix.remove();
}
});/* observer.js */
/**
* Observer - Observe formelements for changes
*
* @version		1.0rc1
*
* @license		MIT-style license
* @author		Harald Kirschner <mail [at] digitarald.de>
* @copyright	Author
*/
var Observer = new Class({
options: {
periodical: false,
delay: 1000
},
initialize: function(el, onFired, options){
this.setOptions(options);
this.addEvent('onFired', onFired);
this.element = $(el);
this.listener = this.fired.bind(this);
this.value = this.element.getValue();
if (this.options.periodical) this.timer = this.listener.periodical(this.options.periodical);
else this.element.addEvent('keyup', this.listener);
},
fired: function() {
var value = this.element.getValue();
if (this.value == value) return;
this.clear();
this.value = value;
this.timeout = this.fireEvent.delay(this.options.delay, this, ['onFired', [value]]);
},
clear: function() {
$clear(this.timeout);
return this;
}
});
Observer.implement(new Options);
Observer.implement(new Events);/* bumeran.js */
/* ***********************
* bumeran js v202
* 2007, icograma.com
* **********************/

/* debug */
var annoy=true; function debug(m){if(annoy){annoy=confirm(m);};};

function rmHintEv(){ rmHint(this); }
function rmHint(what){
	if( !($(what)) ){ what=this; }

	//for mootools
	if( $(what).hasClass('hint') ){
		what.value="";
		what.removeClass('hint');
	}

}

function addHintEv(){ addHint(this); }
function addHint(what){
	if( !($(what)) ){ what=this; }
	if(what.title.indexOf("*")==0){
		var t = what.title.substring(1);
		if(what.value=="" || what.value == t){
			what.value = t;
			what.addClass("hint"); //moo
		}
	}
}

function dynLayoutEv(){ dynLayout( window.getWidth() ); }//moo
function dynLayout(w){
	var sizes=new Array( 755, "w800", 860, "w1024" );
	var sizeClass = sizes[1];
	var b=document.getElementsByTagName("HTML")[0];
	for(var i=sizes.length-2;i>=0;i-=2){ if(w >= sizes[i] ){ sizeClass = sizes[i+1]; break;  } }
	b.className = sizeClass;
	Cookie.set("browserWidth",w);
}

//this fixes an issue with the old method, ambiguous values
//with this test document.cookie.indexOf( name + "=" );
function Get_Cookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );


		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return cookie_value;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return null;
	}
}

function showHeaderShortcuts()
{
	var idShortcutToShow = 'shortcutsNoLogueadoNoCookies';
	//BMN_APENOM
	if( Cookie.get('BMN_USERTYPE') == 'APLICANTES' && Get_Cookie('BMN_APENOM') )
	{
		phpSessId = Cookie.get('PHPSESSID'); 
		bmnSessId = Cookie.get('BMN_SESSID');
		if( phpSessId && bmnSessId && phpSessId == bmnSessId )
		{
			idShortcutToShow = 'shortcutsLogueado';			
		}
		else
		{
			idShortcutToShow = 'shortcutsCookies';
		}
		
		document.getElementById( idShortcutToShow ).innerHTML = document.getElementById( idShortcutToShow ).innerHTML.replace(', bienvenido!', Get_Cookie('BMN_APENOM').replace(/\+/g, '&nbsp;') );
	}
	
	
	document.getElementById( idShortcutToShow ).style.display = 'block';
	
	return false;
}

function init(){
	dynLayoutEv();

	//shortcuts para usuarios
	showHeaderShortcuts();
	
	//fin shortcuts para usuarios

	for( var f=0; f<document.forms.length; f++){
		var fs = document.forms[f].elements;

		for ( var j=0; j<fs.length; j++ ){
			if( $(fs[j]).type == "text" ){
				addHint( $(fs[j]) );

				// for mootools
				$(fs[j]).addEvent( "blur", addHint );
				$(fs[j]).addEvent( "focus", rmHint );
				$(fs[j]).addEvent( "change", rmHint );
				$(fs[j]).addEvent( "click", rmHint );

			}//end type==text
		}//end j
	}//end f

	//hack para Firefox
	if(window.gecko){
		//valido que exista el div que va a contener la respuesta
		if($chk($('paginador'))) {
			$('paginador').addClass('paginador-fix-ff');
		}
	}

	//hack para IE
	if(window.ie){
		if($chk($('mainbody'))) {
			///$('mainbody').addClass('main-fix-ie');
		}
	}



	//caja de newsletter con AJAX
	/*	Variable que guarda el elemento de Formulario */
	var miFormu = $('news_form');
	//valido que exista el formulario

	if($chk(miFormu)) {
		/*	Agregamos nuestra funcion al evento enviar 'submit' */
		miFormu.addEvent('submit', function(e) {
			/*	Evitamos el Evento submit natural */
			new Event(e).stop();

			//if(checkForm(miFormu)){
			if(checkForm(this)){
				/* enviar con cuidado de enconding y retornar una instancia de Ajax. */
				var  divRespuesta = $('news_subscribe');
				var  url = '/aplicantes/a_newsadd.ngmf?email='+ $('email').value;
				divRespuesta.empty().addClass('ajax-loading');
				divRespuesta.setHTML('<br/><br/>');
				new Ajax(url, {
					method: 'get',
					onComplete: function() {
						divRespuesta.removeClass('ajax-loading');
					},
					update: divRespuesta
				}).request();
			}
		});
	}

	//caja de busqueda
	/*	Variable que guarda el elemento de Formulario */
	var miFormu = $('BUS_POS');
	//valido que exista el formulario
	if($chk(miFormu)) {
		/*	Agregamos nuestra funcion al evento enviar 'submit' */
		miFormu.addEvent('submit', function(e) {
			/*	Evitamos el Evento submit natural */
			new Event(e).stop();
			var keyword = $('KEYWORD');
			var categoria = document.getElementById('CATEGORIA');
                        var catId=categoria.selectedIndex;
			if(categoria) {
				categoria = categoria.options[catId].value;
				//categoria= escape(categoria.replace(/ /g,'-'));//Groso Uroz que lo resolvio
			}
			rmHint(keyword);
			if (keyword.value == '' && catId == 0){
				window.location = $('BUS_POS').action + '.html';
			}else{
			window.location = $('BUS_POS').action +'_'+escape(keyword.value)+(categoria?'_'+categoria:'')+'.html';
			}
		});
	}

	//encuesta con ajax
	var miFormu = $('formalter');
	//valido que exista el formulario
	if($chk(miFormu)) {
		/*	Agregamos nuestra funcion al evento enviar 'submit' */
		miFormu.addEvent('submit', function(e) {
			/*	Evitamos el Evento submit natural */
			new Event(e).stop();

			var alternativa=0;
			for (t=0; t<miFormu.length && alternativa==0; t++) {
				if (miFormu.ALTERNATIVAS[t].checked)
				alternativa = miFormu.ALTERNATIVAS[t].value;
			}

			var  divRespuesta = $('encuestadiv');
			if($('encuestaTipo').value==1) {
				var url ="/aplicantes/contenidos/encuestas/a_encuestas.ngmf?ENCUESTA=" + $('encuestaId').value + "&ALTERNA=" + alternativa;
			} else {
				var url ="/empresas/contenidos/encuestas/e_encuestas.ngmf?ENCUESTA=" + $('encuestaId').value + "&ALTERNA=" + alternativa;
			}
			divRespuesta.empty().addClass('ajax-loading');
			divRespuesta.setHTML('<br/><br/><br/><br/>');
			new Ajax(url, {
				method: 'get',
				onComplete: function() {
					divRespuesta.removeClass('ajax-loading');
				},
				update: divRespuesta
			}).request();
		});
	}
	//colocamos el foco en la caja de busqueda
	if($chk($('UUSERNAME'))) {
		$('UUSERNAME').focus();
		if((Cookie.get('BMN_USERNAME'))){
			var value = Cookie.get('BMN_USERNAME');
			$('UUSERNAME').value = value;
		}

	}else{
		if($chk($('KEYWORD'))){
			$('KEYWORD').focus();
		}
	}

	//breadcrumb de busquedas en avisos
	if($chk($('breadcrumbBusqueda'))) {
		if((Get_Cookie('BUSQUEDA_CAMINO'))){
			var value = (Get_Cookie('BUSQUEDA_CAMINO'));
			value = value.replace(/\+/g, ' ');
			$('breadcrumbBusqueda').innerHTML = value;
		}
	}

	//suggest
	var input      = $('KEYWORD');
    var completer2 = new Autocompleter.Ajax.Json(input, '/2008/ajax/sugerirAvisos/', {postVar: 'keyword', minLength: 3} );
    //fin suggest

}//end init fn

dynLayout( Cookie.get("browserWidth") );
window.addEvent('domready', init);
window.addEvent("resize",dynLayoutEv)




/* --- FORMS ---- */

function checkForm(f){ /* for mootools */

	if(!document.getElementById){ return true; }
	var oktosend=true; var fs=f.elements;
		
	for(var i=0;i<fs.length;i++){
		if(fs[i].type&&fs[i].name){

			//get field value
			var ftype=fs[i].type; var efilter=false;
			if(ftype=="text"||ftype=="textarea"){
				v=fs[i].value && !$(fs[i]).hasClass("hint");
				/*
				if( fs[i].hasClass("hint") ){
				v = false;
				}
				*/
			}else if(ftype=="select-one"||ftype=="select-multiple"){
				v=fs[i][fs[i].selectedIndex].value;
			}else if(ftype=="checkbox"){
				v=fs[i].checked;
			}else{
				v="!";//other types, don't check
			}
			var isfilled = isvalid = (v!="");

			//special fields:
			if(fs[i].name&&fs[i].name.indexOf("mail")>-1){ ftype="email";efilter=true; }
			if(efilter){ isvalid=isValidField(fs[i].value,ftype); }

			//is required, or need to check if filled?
			var reqelm = FindTagClassUp(fs[i],".required","form");

			if(!reqelm&&efilter&&isfilled){
				reqelm=FindTagClassUp(fs[i],".field","form");
				if(!reqelm){reqelm=fs[i];}
			};

			if(!isvalid&&reqelm){
				if(oktosend&&(ftype.indexOf("mail")>-1||ftype.indexOf("text")>-1||ftype.indexOf("select")>-1) ){ fs[i].select(); }
				oktosend=false;
				fs[i].onclick=rmErrorClass; fs[i].onkeydown=rmErrorClass;
				reqelm.addClass("error");
			}

		}//end filter fs
	}//end for i in fs
	//	}
	return oktosend;

}

function rmErrorClass(event){
	var elm=this;var etag=FindTagClassUp(elm,".error","form");if(!etag){etag=FindTagClassUp(elm,".field","form");};if(!etag){etag=elm}
	if(etag){
		etag.removeClass("error");
		elm.onclick=null;elm.onfocus=null;elm.onkeyup=null}
}

function isValidField(t,k){
	if(k=="email"){
		if( t.indexOf("@example.com")>-1){return false;};
		var emailFilter=/^.+@.+\..{2,}$/;
		var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
		if(!(emailFilter.test(t))||t.match(illegalChars)){return(false);}else{return (true);}
		return false
	}//end email
}

/* --- DOM --- */

function FindTagClassUp(elm,tcsearch,tclimit){ // for mootools
	var elm= $(elm);
	var tc=( tcsearch+"." ).split("."); tc[0]=tc[0].toUpperCase();
	if(!tclimit){tclimit="BODY";};
	var tz=( tclimit+"." ).split("."); tz[0]=tz[0].toUpperCase();
	while( n = elm.nodeName ){
		if(tc[0]==""||n==tc[0]){
			if( tc[1]=="" || $(elm).hasClass(tc[1]) ){ return elm; }; };
			if(tz[0]==""||n==tz[0]){
				if( tz[1]=="" || $(elm).hasClass(tz[1]) ){ return false; }; };
				elm=elm.parentNode;
	};
	debug("No se pudo obtener NODENAME para: ",elm);
	return false;
};


function $path(e,c){
	var e=$(e);
	c=c.split(" ");

	for(var i=0;i<c.length;i++){
		var cis = c[i].split(":")
		var num = cis[1]?cis[1]:"0"
		var ci=cis[0]

		if(ci=="<"){
			e=e.parentNode;
		}else if(ci.charAt(0)=="#"){
			e=$( ci.substring(1) );
			if(!e){return false;};
		}else if(ci.charAt(0)=="."){
			var a=e.childNodes;var t=ci.substring(1);var d=false;
			for(var b=0;b<a.length;b++){
				if(a[b].hasClass(t)){d=a[b];break;};
			};
			if(d){e=d;}else{return false;};
		}else if(ci.charAt(0)=="<"){
			e=FindTagClassUp(e.parentNode,ci.substring(1),"BODY");
			if(!e){return false;};
		}else{
			var a = e.getElementsByTagName( ci.toLowerCase() );
			if(a.length>0){
				if(num=="0"){e=a[0];
				}else if(num=="last"||num>a.length){
					e=a[a.length-1]
				}else{
					e=a[num]
				}
			}else{
				var a = document.getElementsByName(ci);
				if( a[0] ){ e=a[0]; }else{return false;};
			};
		};
	};
	return e;
};

//caja de busqueda
function Buscar() {
	var keyword = $('KEYWORD');
	var form	= $('BUS_POS');
	rmHint(keyword);
	if (keyword.value == ''){
		window.location = '/aplicantes/listado_postings_completo.html';
		//form.action = '/aplicantes/listado_postings_completo.html';
		//form.method = 'POST';
		return false;
	}else{
		form.action = '/aplicantes/a_listadopostings.ngmf';
		form.method = 'GET';
		return true;
	}
}

//caja de Avisos Similares AJAX
function CargarSimilares(idaviso){
	var  divRespuesta = $('avisosSimilares');
	//valido que exista el div que va a contener la respuesta
	if($chk(divRespuesta)) {
		var url = "/presentacion/avisos/client/avi_avisossimilaresbox.ngmf?idpost="+idaviso;
		divRespuesta.empty().addClass('ajax-loading');
		divRespuesta.setHTML('<br/><br/>');
		new Ajax(url, {
			method: 'get',
			onComplete: function() {
				divRespuesta.removeClass('ajax-loading');
			},
			update: divRespuesta
		}).request();

	}
}

//caja de Avisos Visitados AJAX
function CargarVisitados(idaviso,puesto,empresa){
	var  divRespuesta = $('avisosVisitados');
	//valido que exista el div que va a contener la respuesta
	if($chk(divRespuesta)) {
		var url = '/presentacion/avisos/client/avi_avisosvisitadosbox.ngmf?idpost='+idaviso+'&puesto='+escape(puesto)+'&empresa='+escape(empresa);
		divRespuesta.empty().addClass('ajax-loading');
		divRespuesta.setHTML('<br/><br/>');
		new Ajax(url, {
			method: 'get',
			onComplete: function() {
				divRespuesta.removeClass('ajax-loading');
			},
			update: divRespuesta
		}).request();

	}
}

//caja de Avisos Visitados AJAX
function CargarAvisosUniversobit(keyword){
	var  divRespuesta = $('avisosSimilaresBumeranUniversobit');

	//valido que exista el div que va a contener la respuesta
	if($chk(divRespuesta)) {
		var url = '/presentacion/avisos/client/avi_avisosuniversobit.ngmf?keyword='+keyword;
		divRespuesta.empty().addClass('ajax-loading-similares-ubit');
		divRespuesta.setHTML('<br/><br/>');
		new Ajax(url, {
			method: 'get',
			onComplete: function() {
				divRespuesta.removeClass('ajax-loading-similares-ubit');
			},
			update: divRespuesta
		}).request();

	}
}

//funcion para contar vistas de un posting por ajax
function ContarVistaAviso(idaviso) {
	var url = '/aplicantes/a_posting_count.ngmf?idpost='+idaviso;
	new Ajax(url, {
		method: 'get'
	}).request();
}

/***** DIV POPUP ****/

function desplHiddenValues(id){
	var obj = document.getElementById(id).style;
	if(obj.display=='none'||obj .display==''){
		obj .display = 'block';
	}else{
		obj .display = 'none';
	}
}


function openWindow(windowID,link){
	var loadingDiv = document.getElementById( windowID );

	var cwidth = "415";
	var cheight= "320";

	var cleft = 170;
	var ctop = 150;

	if( loadingDiv.style.setAttribute ){ //IE

		loadingDiv.style.setAttribute('position',	'absolute');
		loadingDiv.style.setAttribute('left', parseInt(cleft));
		loadingDiv.style.setAttribute('top', parseInt(ctop));
		loadingDiv.style.setAttribute('visibility','visible');

	}else{
		loadingDiv.setAttribute('style',"position:absolute;left:"+cleft+"px;top:"+ctop+"px;visibility:visible");
	}

	shownWindow = loadingDiv;


}

function hideWindow(){
	if (shownWindow == null) return ;
	if( shownWindow.style.setAttribute ){//IE
		shownWindow.style.setAttribute( "visibility" , "hidden" );
	}else{
		shownWindow.setAttribute("style","visibility:hidden;position:absolute");
	}
	shownWindow = null;
}

function setContentLoaded(){
	document.onclick = executeClick;
	contentLoaded = true;
}

function executeClick(e){

	if (window.event) e = window.event;
	var srcEl = e.srcElement? e.srcElement : e.target;
	hideWindowByClick(srcEl);

}

function hideWindowByClick(srcElement){
	var parent=srcElement;
	while( parent != null ){
		if (parent.id == 'shownWindow') return ;
		parent = parent.offsetParent;
	}
	hideWindow();
}


function EnviarValidacion(){
	if(isValidField($('emailValid').value,'email')){
		var  divRespuesta = $('respuestaValidacion');
		var  url = '/aplicantes/a_validaremail.ngmf?emailValid='+$('emailValid').value;
		divRespuesta.empty().addClass('ajax-loading');
		new Ajax(url, {
			method: 'get',
			onComplete: function() {
					divRespuesta.removeClass('ajax-loading');
				},
			update: divRespuesta
		}).request();
	}else{
		alert('Su email no parece ser correcto');
	}
}
function EnviarValidacionZona(){
	
		var  divRespuesta = $('respuestaValidacion');
		var  url = '/aplicantes/a_validarzona.ngmf?zonaValid='+$('zonaValid').value;
		divRespuesta.empty().addClass('ajax-loading');
		new Ajax(url, {
			method: 'get',
			onComplete: function() {
					divRespuesta.removeClass('ajax-loading');
				},
			update: divRespuesta
		}).request();
	
}
/**** FIN POPUP ****/
