XML parsing complexity sub levels - javascript

so I have this XML and I want to parse out the field <name> inside <condition>.
<dataPoint> repeats in this case.
</collection>
<dataPoint>
<dataPointId></dataPointId>
<description>Hi</description>
<pointType>
<pointTypeId></pointTypeId>
</pointType>
<currentValue>
<id>870004</id>
<condition>
<id>6</id>
<name>Failure</name>
<priority>1</priority>
<customStyle></customStyle>
<reportColor>#202020</reportColor>
</condition>
</currentValue>
<condition>
<id>6</id>
<name>What I need</name>
</condition>
</dataPoint>
</collection>
I used:
xmlDatapoints=xmlhttp.responseXML;
var eachDp = dataPointXml.getElementsByTagName("dataPoint");
for (data=0; data<eachDp.length; data++){
eachDp[data].getElementsByTagName("condition") [0].childNodes[1].childNodes[0].nodeValue;
}
But this gives me "Failure", I want "What I need" inside the <condition>, what am I doing wrong here?

You might be getting the first "condition" element.
<condition>
<id>6</id>
<name>Failure</name>
<priority>1</priority>
<customStyle></customStyle>
<reportColor>#202020</reportColor>
</condition>

Related

Javascript Querying on Elasticsearch does not work on Child Elements

I am trying to display searchresults on a elasticsearch database in my reactjs-app. Nevertheless I can only access the upper layer of key value pairs and am unable to reach the children.
The structure of my elasticsearch-objects is as follows:
...
"hits":[{
"_index":"knowledgecrawler",
"_type":"doc",
"_id":"5fea73f38399f4c01f",
"_score":1.0,
"_source":{
"content":"content comes here",
"meta":{
"author":"Jones#stackoverflow.com",
"title":"I am lost"
"date":"today",
"keywords":["Stackoverflow"],
"language":"Javascript",
}
"raw":{
"date":"2017-03-08",
"subject":"How do I get here?"
}
}}]
The elasticsearch-object is much bigger, but I am only searching in the "hits". With the following lines of code i can easily display the firstlevel values(_index, _type, _id), but any attempt to access the children failed so far:
render() {
const result = this.props.result;
return (
<div className={this.props.bemBlocks.item().mix(this.props.bemBlocks.container("item"))} key={result._id}>
<div className={this.props.bemBlocks.item("title")}>{result._id}</div>
<div className={this.props.bemBlocks.item("title")}>{result._type}</div>
</div>
)
}
Can anybody advice me how to access the children of _source. E.g. I want to display the author in my frontend.
EDIT:
So the error is apparently due to the fact that the _source field in Elasticsearch is not indexed and thus not searchable (according to the elasticsearch docs). I haven't come up with a solution so far, but will post it here, when I find it. Help is also much appreciated.
Let's say you have following data:
data = {"hits":[{
"_index":"knowledgecrawler",
"_type":"doc",
"_id":"5fea73f38399f4c01f",
"_score":1.0,
"_source":{
"content":"content comes here",
"meta":{
"author":"Jones#stackoverflow.com",
"title":"I am lost"
"date":"today",
"keywords":["Stackoverflow"],
"language":"Javascript",
}
"raw":{
"date":"2017-03-08",
"subject":"How do I get here?"
}
}}]}
Now you question is : Can anybody advice me how to access the children of _source. E.g. I want to display the author in my frontend.
So, you can do the following to get the author of _source:
{data.hits && data.hits.length > 0 && data.hits[0]._source && data.hits[0]._source.meta && data.hits[0]._source.meta.author ?data.hits[0]._source.meta.author : ''}
If you have multiple hits, then you can use array.map() like this:
data.hits.map(value => value._source && value._source.meta && value._source.meta.author ? value._source.meta.author : '')

replace a portion of xml using xpath and xmldom in node.js

I have a huge xml structure which i have attached below,
I am adding update details and adding data to the product tracking module but when i try to change it it will replacing the entire xml with the new xml
Sample xml
<query_by_gtin_response:queryByGtinResponse xmlns:query_by_gtin_response="urn:gs1:tsd:query_by_gtin_response:xsd:1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:gs1:tsd:query_by_gtin_response:xsd:1 QueryByGtinResponse.xsd urn:gs1:tsd:basic_product_information_module:xsd:1 BasicProductInformationModule.xsd urn:gs1:tsd:nutritional_product_information_module:xsd:1 NutritionalProductInformationModule.xsd">
<productData>
<gtin>00000000000509</gtin>
<targetMarket>124</targetMarket>
<informationProviderGLN>1111111133333</informationProviderGLN>
<informationProviderName>Testsub</informationProviderName>
<productDataRecord>
<module>
<bpi:basicProductInformationModule xmlns:bpi="urn:gs1:tsd:basic_product_information_module:xsd:1">
<productName languageCode="en">waka waka</productName>
<brandNameInformation>
<brandName>wowozella</brandName>
</brandNameInformation>
</bpi:basicProductInformationModule>
</module>
<module>
<nfii:nonfoodIngredientInformationModule xmlns:nfii="urn:gs1:tsd:nonfood_ingredient_information_module:xsd:1"/>
</module>
<module>
<product_tracking_information_module>
<variantId>ec9ef090-57c2-11e6-bc2b-51c4bf71f613</variantId>
<status/>
<name>admin#gmail.com</name>
<createdBy>552f5b90b348147e03e49b62</createdBy>
<createdDate>2016-08-01T08:35:38.648Z</createdDate>
<updatedBy>552f5b90b348147e03e49b62</updatedBy>
<updatedDate>2016-08-01T08:35:38.648Z</updatedDate>
<applicationId>webapp</applicationId>
<history>
<createdDate>2016-08-01T08:35:38.648Z</createdDate>
<updatedDate>2016-08-01T08:35:38.648Z</updatedDate>
<status/>
<updatedBy>552f5b90b348147e03e49b62</updatedBy>
<createdBy>552f5b90b348147e03e49b62</createdBy>
<applicationId>webapp</applicationId>
<name>admin#gmail.com</name>
</history>
</product_tracking_information_module>
</module>
</productDataRecord>
</productData>
</query_by_gtin_response:queryByGtinResponse>
the sample xml i want to replace the current full data in product_tracking_information_module with below
<product_tracking_information_module>
<variantId>ec9ef090-57c2-11e6-bc2b-51c4bf71f613</variantId>
<status>deleted</status>
<name>gs1canada</name>
<createdBy>552f5b90b348147e03e49b62</createdBy>
<createdDate>2016-08-01T08:35:38.648Z</createdDate>
<updatedBy>company Id 552f5b62b348147e03e49b61</updatedBy>
<updatedDate>2016-08-01T14:52:23.985Z</updatedDate>
<applicationId>serverlet</applicationId>
<history>
<createdDate>2016-08-01T08:35:38.648Z</createdDate>
<updatedDate>2016-08-01T08:35:38.648Z</updatedDate>
<status/>
<updatedBy>552f5b90b348147e03e49b62</updatedBy>
<createdBy>552f5b90b348147e03e49b62</createdBy>
<applicationId>webapp</applicationId>
<name>admin#gmail.com</name>
</history>
<history status="deleted">
<applicationId/>
<updatedBy>company Id 552f5b62b348147e03e49b61</updatedBy>
<updatedDate>2016-08-01T14:52:23.985Z</updatedDate>
<name>gs1canada</name>
</history>
</product_tracking_information_module>
and the code to do that, where doc is the xmldom parsed Document
var ptimdom = new dom().parseFromString(ptimxml.toString());
var nodesPTIM = xpath.select("//productData//productDataRecord//module//product_tracking_information_module", doc);
doc.replaceChild(ptimdom,nodesPTIM[0]);
but the result is that the doc after this is the second xml only and the full data is lost.
What am i doing wrong?
Try nodesPTIM[0].parentNode.replaceChild(ptimdom, nodesPTIM[0]), that is call the replaceChild method on the parentNode of the element you want to replace.

how can convert string to hash using jquery

list = "{"mins_spent_in_stor":"{"AM 01:00":0,"AM 02:00":0,"AM 03:00":0,"AM 04:00":0,"AM 05:00":0,"AM 06:00":0,"AM 07:00":0,"AM 08:00":0,"AM 09:00":0,"AM 10:00":0,"AM 11:00":0,"PM 12:00":273,"PM 01:00":0,"PM 02:00":30,"PM 03:00":0,"PM 04:00":0,"PM 05:00":0,"PM 06:00":0,"PM 07:00":0,"PM 08:00":0,"PM 09:00":0,"PM 10:00":0,"PM 11:00":0,"AM 12:00":0}","store_hr_opt":"{"00:0C:66:20:0E:3A":{"AM 01:00":0,"AM 02:00":0,"AM 03:00":0,"AM 04:00":0,"AM 05:00":0,"AM 06:00":0,"AM 07:00":0,"AM 08:00":0,"AM 09:00":0,"AM 10:00":0,"AM 11:00":0,"PM 12:00":5,"PM 01:00":0,"PM 02:00":0,"PM 03:00":0,"PM 04:00":0,"PM 05:00":0,"PM 06:00":0,"PM 07:00":0,"PM 08:00":0,"PM 09:00":0,"PM 10:00":0,"PM 11:00":0,"AM 12:00":0}}"}"
I need to convert this string into hash, but when am using this command JSON.parse(list), i'm getting this error
SyntaxError: Unexpected token A,
Please anyone help me..
I got it to work with a couple of replaces:
var list = '{"mins_spent_in_stor":"{"AM 01:00":0,"AM 02:00":0,"AM 03:00":0,"AM 04:00":0,"AM 05:00":0,"AM 06:00":0,"AM 07:00":0,"AM 08:00":0,"AM 09:00":0,"AM 10:00":0,"AM 11:00":0,"PM 12:00":273,"PM 01:00":0,"PM 02:00":30,"PM 03:00":0,"PM 04:00":0,"PM 05:00":0,"PM 06:00":0,"PM 07:00":0,"PM 08:00":0,"PM 09:00":0,"PM 10:00":0,"PM 11:00":0,"AM 12:00":0}","store_hr_opt":"{"00:0C:66:20:0E:3A":{"AM 01:00":0,"AM 02:00":0,"AM 03:00":0,"AM 04:00":0,"AM 05:00":0,"AM 06:00":0,"AM 07:00":0,"AM 08:00":0,"AM 09:00":0,"AM 10:00":0,"AM 11:00":0,"PM 12:00":5,"PM 01:00":0,"PM 02:00":0,"PM 03:00":0,"PM 04:00":0,"PM 05:00":0,"PM 06:00":0,"PM 07:00":0,"PM 08:00":0,"PM 09:00":0,"PM 10:00":0,"PM 11:00":0,"AM 12:00":0}}"}'.replace(/\"\{/g,"{").replace(/}\"/g,"}");
But that is by no means an elegant or good solution and is only likely to work on this particular input and will break if you get any other garbled JSON string.
So you should really fix the source of the data.
http://jsonlint.com/ is a nice tool to quickly check if a JSON is valid.

How to pass the Null Value in Javascript in Dynamics CRM 4.0?

I need to fetch the parent Subjects using Javascript. How can I get all the 1st level parent subjects? Logic should be like when parentsubject is 'null'. for that I wrote the following query.
var message =
[
"<?xml version='1.0' encoding='utf-8'?>",
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema">",
GenerateAuthenticationHeader(),
"<soap:Body>",
"<RetrieveMultiple xmlns=\"http://schemas.microsoft.com/crm/2007/WebServices\">",
"<query xmlns:q1='http://schemas.microsoft.com/crm/2006/Query' >xsi:type='q1:QueryExpression' >",
"<q1:EntityName>subject</q1:EntityName>",
"<q1:ColumnSet xsi:type=\"q1:ColumnSet\" >",
"<q1:Attributes>",
"<q1:Attribute>subjectid</q1:Attribute>",
"</q1:Attributes>",
"</q1:ColumnSet>",
"<q1:Criteria>",
"<q1:FilterOperator >And</q1:FilterOperator>",
"<q1:Conditions>",
"<q1:Condition>",
"<q1:AttributeName >parentsubject</q1:AttributeName>",
"<q1:FilterOperator>Equal</q1:FilterOperator>",
"<q1:Values>",
"<q1:Value xsi:type='xsd:string'>" _____________ "</q1:Value>",
"</q1:Values>",
"</q1:Condition>",
"</q1:Conditions>",
"</q1:Criteria>",
"</query>",
"</RetrieveMultiple>",
"</soap:Body>",
"</soap:Envelope>"
].join("");
Please let me know what should I pass in _______
Thanks in advance
JK
FilterOperator should be Operator, Equal should be Null, and remove the Values node. So:
"<q1:Condition>",
"<q1:AttributeName >parentsubject</q1:AttributeName>",
"<q1:FilterOperator>Equal</q1:FilterOperator>",
"<q1:Values>",
"<q1:Value xsi:type='xsd:string'>" _____________ "</q1:Value>",
"</q1:Values>",
"</q1:Condition>",
should be
"<q1:Condition>",
"<q1:AttributeName >parentsubject</q1:AttributeName>",
"<q1:Operator>Null</q1:Operator>",
"</q1:Condition>",

missing ; after for-loop condition

Mozilla Firefox error console is telling me over and over again that:
missing ; after for-loop condition
Here is my JavaScript file (compressed) and I cannot find any error there:
$(document).ready(function(){$('#nav ul li, table tr').mouseover(function(){$(this).addClass('hover')});$('#nav ul li, table tr').mouseout(function(){$(this).removeClass('hover')})});$(document).ready(function(){$('.input-submit').button()});$(document).ready(function(){$('a[rel=external]').click(function(){$(this).attr('target','_top')});$('a[rel=external-new-window]').unbind('click').click(function(){window.open($(this).attr('href'),'','width=800, height=600, scrollbars=1');return false})});$(document).ready(function(){$('.clickable').click(function(){var href=$(this).attr('rel');if(href){window.location=href}})});function browserdetect(){var a=navigator.userAgent.toLowerCase();if(this.isIE=a.indexOf("msie")>-1)this.ieVer=/msie\s(\d\.\d)/.exec(a)[1],this.quirksMode=!document.compatMode||document.compatMode.indexOf("BackCompat")>-1,this.get_style=function(a,c){if(!(c in a.currentStyle))return"";var d=/^([\d.]+)(\w*)/.exec(a.currentStyle[c]);if(!d)return a.currentStyle[c];if(d[1]==0)return"0";if(d[2]&&d[2]!=="px"){var e=a.style.left,f=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=d[1]+d[2];d[0]=a.style.pixelLeft;a.style.left=e;a.runtimeStyle.left=f}return d[0]},this.supportsCorners=this.ieVer>=9;else if(this.ieVer=this.quirksMode=0,this.get_style=function(a,c){c=c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return document.defaultView.getComputedStyle(a,"").getPropertyValue(c)},this.isSafari=a.indexOf("safari")!=-1,this.isWebKit=a.indexOf("webkit")!=-1,this.isOp="opera"in window)this.supportsCorners=(this.isOp=window.opera.version())>=10.5;else{if(!this.isWebkit&&!(this.isMoz=a.indexOf("firefox")!==-1))for(a=document.childNodes.length;--a>=0;)if("style"in document.childNodes[a]){this.isMoz="MozBorderRadius"in document.childNodes[a].style;break}this.supportsCorners=this.isWebKit||this.isMoz}}var curvyBrowser=new browserdetect;if(curvyBrowser.isIE)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e$$5){}function curvyCnrSpec(a){this.selectorText=a;this.tlR=this.trR=this.blR=this.brR=0;this.tlu=this.tru=this.blu=this.bru="";this.antiAlias=!0}curvyCnrSpec.prototype.setcorner=function(a,b,c,d){a?(a=a.charAt(0)+b.charAt(0),this[a+"R"]=parseInt(c),this[a+"u"]=d):(this.tlR=this.trR=this.blR=this.brR=parseInt(c),this.tlu=this.tru=this.blu=this.bru=d)};curvyCnrSpec.prototype.get=function(a){if(/^(t|b)(l|r)(R|u)$/.test(a))return this[a];if(/^(t|b)(l|r)Ru$/.test(a))return a=a.charAt(0)+a.charAt(1),this[a+"R"]+this[a+"u"];if(/^(t|b)Ru?$/.test(a)){var b=a.charAt(0);b+=this[b+"lR"]>this[b+"rR"]?"l":"r";b=this[b+"R"];a.length===3&&a.charAt(2)==="u"&&(b+=this.u);return b}throw Error("Don't recognize property "+a);};curvyCnrSpec.prototype.radiusdiff=function(a){if(a!=="t"&&a!=="b")throw Error("Param must be 't' or 'b'");return Math.abs(this[a+"lR"]-this[a+"rR"])};curvyCnrSpec.prototype.setfrom=function(a){this.tlu=this.tru=this.blu=this.bru="px";if("tl"in a)this.tlR=a.tl.radius;if("tr"in a)this.trR=a.tr.radius;if("bl"in a)this.blR=a.bl.radius;if("br"in a)this.brR=a.br.radius;if("antiAlias"in a)this.antiAlias=a.antiAlias};curvyCnrSpec.prototype.cloneOn=function(a){var b=["tl","tr","bl","br"],c=0,d,e;for(d in b)if(!isNaN(d)&&(e=this[b[d]+"u"],e!==""&&e!=="px")){c=new curvyCnrSpec;break}if(c){var f,g,k=curvyBrowser.get_style(a,"left");for(d in b)if(!isNaN(d)){f=b[d];e=this[f+"u"];g=this[f+"R"];if(e!=="px"){var l=a.style.left;a.style.left=g+e;g=a.style.pixelLeft;a.style.left=l}c[f+"R"]=g;c[f+"u"]="px"}a.style.left=k}else c=this;return c};curvyCnrSpec.prototype.radiusSum=function(a){if(a!=="t"&&a!=="b")throw Error("Param must be 't' or 'b'");return this[a+"lR"]+this[a+"rR"]};curvyCnrSpec.prototype.radiusCount=function(a){var b=0;this[a+"lR"]&&++b;this[a+"rR"]&&++b;return b};curvyCnrSpec.prototype.cornerNames=function(){var a=[];this.tlR&&a.push("tl");this.trR&&a.push("tr");this.blR&&a.push("bl");this.brR&&a.push("br");return a};function operasheet(a){var a=document.styleSheets.item(a).ownerNode.text,a=a.replace(/\/\*(\n|\r|.)*?\*\//g,""),b=RegExp("^\\s*([\\w.#][-\\w.#, ]+)[\\n\\s]*\\{([^}]+border-((top|bottom)-(left|right)-)?radius[^}]*)\\}","mg"),c;for(this.rules=[];(c=b.exec(a))!==null;){for(var d=RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g"),e,f=new curvyCnrSpec(c[1]);(e=d.exec(c[2]))!==null;)e[1]!=="z-"&&f.setcorner(e[3],e[4],e[5],e[6]);this.rules.push(f)}}operasheet.contains_border_radius=function(a){return/border-((top|bottom)-(left|right)-)?radius/.test(document.styleSheets.item(a).ownerNode.text)};function curvyCorners(){var a,b,c,d,e;if(typeof arguments[0]!=="object")throw curvyCorners.newError("First parameter of curvyCorners() must be an object.");if(arguments[0]instanceof curvyCnrSpec){if(d=arguments[0],!d.selectorText&&typeof arguments[1]==="string")d.selectorText=arguments[1]}else{if(typeof arguments[1]!=="object"&&typeof arguments[1]!=="string")throw curvyCorners.newError("Second parameter of curvyCorners() must be an object or a class name.");b=arguments[1];typeof b!=="string"&&(b="");b!==""&&b.charAt(0)!=="."&&"autoPad"in arguments[0]&&(b="."+b);d=new curvyCnrSpec(b);d.setfrom(arguments[0])}if(d.selectorText){e=0;var f=d.selectorText.replace(/\s+$/,"").split(/,\s*/);c=[];for(a=0;a<f.length;++a){if((b=f[a].lastIndexOf("#"))!==-1)f[a]=f[a].substr(b);c=c.concat(curvyCorners.getElementsBySelector(f[a].split(/\s+/)))}}else e=1,c=arguments;a=e;for(b=c.length;a<b;++a)if(e=c[a],f=!1,e.className?(f=e.className.indexOf("curvyIgnore")!==-1)||(e.className+=" curvyIgnore"):e.className="curvyIgnore",!f){if(e.className.indexOf("curvyRedraw")!==-1){if(typeof curvyCorners.redrawList==="undefined")curvyCorners.redrawList=[];curvyCorners.redrawList.push({node:e,spec:d,copy:e.cloneNode(!1)})}(new curvyObject(d,e)).applyCorners()}}curvyCorners.prototype.applyCornersToAll=function(){throw curvyCorners.newError("This function is now redundant. Just call curvyCorners(). See documentation.");};curvyCorners.redraw=function(){if(!curvyBrowser.supportsCorners){if(!curvyCorners.redrawList)throw curvyCorners.newError("curvyCorners.redraw() has nothing to redraw.");var a=curvyCorners.block_redraw;curvyCorners.block_redraw=!0;for(var b in curvyCorners.redrawList)if(!isNaN(b)){var c=curvyCorners.redrawList[b];if(c.node.clientWidth){for(var d=c.copy.cloneNode(!1),e=c.node.firstChild;e!==null;e=e.nextSibling)if(e.className.indexOf("autoPadDiv")!==-1)break;if(!e){curvyCorners.alert("Couldn't find autoPad DIV");break}c.node.parentNode.replaceChild(d,c.node);for(var f=e.getElementsByTagName("script"),g=f.length-1;g>=0;--g)f[g].parentNode.removeChild(f[g]);for(;e.firstChild;)d.appendChild(e.removeChild(e.firstChild));c=new curvyObject(c.spec,c.node=d);c.applyCorners()}}curvyCorners.block_redraw=a}};curvyCorners.adjust=function(a,b,c){if(!curvyBrowser.supportsCorners){if(!curvyCorners.redrawList)throw curvyCorners.newError("curvyCorners.adjust() has nothing to adjust.");var d,e=curvyCorners.redrawList.length;for(d=0;d<e;++d)if(curvyCorners.redrawList[d].node===a)break;if(d===e)throw curvyCorners.newError("Object not redrawable");a=curvyCorners.redrawList[d].copy}b.indexOf(".")===-1?a[b]=c:eval("obj."+b+"='"+c+"'")};curvyCorners.handleWinResize=function(){curvyCorners.block_redraw||curvyCorners.redraw()};curvyCorners.setWinResize=function(a){curvyCorners.block_redraw=!a};curvyCorners.newError=function(a){return Error("curvyCorners Error:\n"+a)};curvyCorners.alert=function(a){(typeof curvyCornersVerbose==="undefined"||curvyCornersVerbose)&&alert(a)};function curvyObject(a,b){var c;this.box=b;this.settings=a;this.topContainer=this.bottomContainer=this.shell=c=null;var d=this.box.clientWidth;if("canHaveChildren"in this.box&&!this.box.canHaveChildren||this.box.tagName==="TABLE")throw Error(this.errmsg("You cannot apply corners to "+this.box.tagName+" elements.","Error"));if(!d&&curvyBrowser.isIE)this.box.style.zoom=1,d=this.box.clientWidth;if(!d&&curvyBrowser.get_style(this.box,"display")==="inline")this.box.style.display="inline-block",curvyCorners.alert(this.errmsg("Converting inline element to inline-block","warning")),d=this.box.clientWidth;if(!d){if(!this.box.parentNode)throw this.newError("box has no parent!");for(c=this.box;c=c.parentNode){if(!c||c.tagName==="BODY"){this.applyCorners=function(){};curvyCorners.alert(this.errmsg("zero-width box with no accountable parent","warning"));return}if(curvyBrowser.get_style(c,"display")==="none")break}var e=c.style.display;c.style.display="block";d=this.box.clientWidth}if(d){a instanceof curvyCnrSpec?this.spec=a.cloneOn(this.box):(this.spec=new curvyCnrSpec(""),this.spec.setfrom(this.settings));var f=curvyBrowser.get_style(this.box,"borderTopWidth"),g=curvyBrowser.get_style(this.box,"borderBottomWidth"),k=curvyBrowser.get_style(this.box,"borderLeftWidth"),l=curvyBrowser.get_style(this.box,"borderRightWidth"),s=curvyBrowser.get_style(this.box,"borderTopColor"),y=curvyBrowser.get_style(this.box,"borderBottomColor"),q=curvyBrowser.get_style(this.box,"borderLeftColor"),o=curvyBrowser.get_style(this.box,"borderRightColor"),E=curvyBrowser.get_style(this.box,"borderTopStyle"),F=curvyBrowser.get_style(this.box,"borderBottomStyle"),G=curvyBrowser.get_style(this.box,"borderLeftStyle"),H=curvyBrowser.get_style(this.box,"borderRightStyle"),C=curvyBrowser.get_style(this.box,"backgroundColor"),D=curvyBrowser.get_style(this.box,"backgroundImage"),I=curvyBrowser.get_style(this.box,"backgroundRepeat"),p,t;this.box.currentStyle&&this.box.currentStyle.backgroundPositionX?(p=curvyBrowser.get_style(this.box,"backgroundPositionX"),t=curvyBrowser.get_style(this.box,"backgroundPositionY")):(p=curvyBrowser.get_style(this.box,"backgroundPosition"),p=p.split(" "),t=p.length===2?p[1]:0,p=p[0]);var J=curvyBrowser.get_style(this.box,"position"),K=curvyBrowser.get_style(this.box,"paddingTop"),L=curvyBrowser.get_style(this.box,"paddingBottom"),M=curvyBrowser.get_style(this.box,"paddingLeft"),N=curvyBrowser.get_style(this.box,"paddingRight"),w=curvyBrowser.ieVer>7?curvyBrowser.get_style(this.box,"filter"):null,x=this.spec.get("tR"),z=this.spec.get("bR"),u=function(a){if(typeof a==="number")return a;if(typeof a!=="string")throw Error("unexpected styleToNPx type "+typeof a);var c=/^[-\d.]([a-z]+)$/.exec(a);if(c&&c[1]!="px")throw Error("Unexpected unit "+c[1]);if(isNaN(a=parseInt(a)))a=0;return a};try{this.borderWidth=u(f),this.borderWidthB=u(g),this.borderWidthL=u(k),this.borderWidthR=u(l),this.boxColour=curvyObject.format_colour(C),this.topPadding=u(K),this.bottomPadding=u(L),this.leftPadding=u(M),this.rightPadding=u(N),this.boxWidth=d,this.boxHeight=this.box.clientHeight,this.borderColour=curvyObject.format_colour(s),this.borderColourB=curvyObject.format_colour(y),this.borderColourL=curvyObject.format_colour(q),this.borderColourR=curvyObject.format_colour(o),this.borderString=this.borderWidth+"px "+E+" "+this.borderColour,this.borderStringB=this.borderWidthB+"px "+F+" "+this.borderColourB,this.borderStringL=this.borderWidthL+"px "+G+" "+this.borderColourL,this.borderStringR=this.borderWidthR+"px "+H+" "+this.borderColourR,this.backgroundImage=D!="none"?D:"",this.backgroundRepeat=I}catch(O){throw this.newError(O.message);}var A=this.boxHeight,B=d;if(curvyBrowser.isOp){var v;p=u(p);t=u(t);p&&(v=B+this.borderWidthL+this.borderWidthR,p>v&&(p=v),p=v/p*100+"%");t&&(v=A+this.borderWidth+this.borderWidthB,t>v&&(t=v),t=v/t*100+"%")}curvyBrowser.quirksMode||(this.boxWidth-=this.leftPadding+this.rightPadding,this.boxHeight-=this.topPadding+this.bottomPadding);this.contentContainer=document.createElement("div");if(w)this.contentContainer.style.filter=w;for(;this.box.firstChild;)this.contentContainer.appendChild(this.box.removeChild(this.box.firstChild));if(J!="absolute")this.box.style.position="relative";this.box.style.padding="0";this.box.style.border=this.box.style.backgroundImage="none";this.box.style.backgroundColor="transparent";this.box.style.width=B+this.borderWidthL+this.borderWidthR+"px";this.box.style.height=A+this.borderWidth+this.borderWidthB+"px";var i=document.createElement("div");i.style.position="absolute";if(w)i.style.filter=w;i.style.width=curvyBrowser.quirksMode?B+this.borderWidthL+this.borderWidthR+"px":B+"px";i.style.height=A+this.borderWidth+this.borderWidthB-x-z<=0?"0":A+this.borderWidth+this.borderWidthB-x-z+"px";i.style.padding="0";i.style.top=x+"px";i.style.left="0";if(this.borderWidthL)i.style.borderLeft=this.borderStringL;if(this.borderWidth&&!x)i.style.borderTop=this.borderString;if(this.borderWidthR)i.style.borderRight=this.borderStringR;if(this.borderWidthB&&!z)i.style.borderBottom=this.borderStringB;i.style.backgroundColor=C;i.style.backgroundImage=this.backgroundImage;i.style.backgroundRepeat=this.backgroundRepeat;i.style.direction="ltr";this.shell=this.box.appendChild(i);d=curvyBrowser.get_style(this.shell,"width");if(d===""||d==="auto"||d.indexOf("%")!==-1)throw this.newError("Shell width is "+d);this.boxWidth=d!==""&&d!="auto"&&d.indexOf("%")==-1?parseInt(d):this.shell.clientWidth;this.applyCorners=function(){this.backgroundPosX=this.backgroundPosY=0;if(this.backgroundObject){var a=function(a,c,b){if(a===0)return 0;if(a==="right"||a==="bottom")return b-c;if(a==="center")return(b-c)/2;if(a.indexOf("%")>0)return(b-c)*100/parseInt(a);return u(a)};this.backgroundPosX=a(p,this.backgroundObject.width,B);this.backgroundPosY=a(t,this.backgroundObject.height,A)}else if(this.backgroundImage)this.backgroundPosX=u(p),this.backgroundPosY=u(t);if(x)i=document.createElement("div"),i.style.width=this.boxWidth+"px",i.style.fontSize="1px",i.style.overflow="hidden",i.style.position="absolute",i.style.paddingLeft=this.borderWidth+"px",i.style.paddingRight=this.borderWidth+"px",i.style.height=x+"px",i.style.top=-x+"px",i.style.left=-this.borderWidthL+"px",this.topContainer=this.shell.appendChild(i);if(z)i=document.createElement("div"),i.style.width=this.boxWidth+"px",i.style.fontSize="1px",i.style.overflow="hidden",i.style.position="absolute",i.style.paddingLeft=this.borderWidthB+"px",i.style.paddingRight=this.borderWidthB+"px",i.style.height=z+"px",i.style.bottom=-z+"px",i.style.left=-this.borderWidthL+"px",this.bottomContainer=this.shell.appendChild(i);var a=this.spec.cornerNames(),b;for(b in a)if(!isNaN(b)){var d=a[b],f=this.spec[d+"R"],k,g,l;d=="tr"||d=="tl"?(k=this.borderColour,l=this.borderWidth):(k=this.borderColourB,l=this.borderWidthB);g=f-l;var n=document.createElement("div");n.style.height=this.spec.get(d+"Ru");n.style.width=this.spec.get(d+"Ru");n.style.position="absolute";n.style.fontSize="1px";n.style.overflow="hidden";var m,j,o,s=w?parseInt(/alpha\(opacity.(\d+)\)/.exec(w)[1]):100;for(m=0;m<f;++m){var y=m+1>=g?-1:Math.floor(Math.sqrt(Math.pow(g,2)-Math.pow(m+1,2)))-1;if(g!=f)var h=m>=g?-1:Math.ceil(Math.sqrt(Math.pow(g,2)-Math.pow(m,2))),q=m+1>=f?-1:Math.floor(Math.sqrt(Math.pow(f,2)-Math.pow(m+1,2)))-1;var C=m>=f?-1:Math.ceil(Math.sqrt(Math.pow(f,2)-Math.pow(m,2)));y>-1&&this.drawPixel(m,0,this.boxColour,s,y+1,n,!0,f);if(g!=f)if(this.spec.antiAlias){for(j=y+1;j<h;++j)this.backgroundImage!==""?(o=curvyObject.pixelFraction(m,j,g)*100,this.drawPixel(m,j,k,s,1,n,o>=30,f)):this.boxColour!=="transparent"?(o=curvyObject.BlendColour(this.boxColour,k,curvyObject.pixelFraction(m,j,g)),this.drawPixel(m,j,o,s,1,n,!1,f)):this.drawPixel(m,j,k,s>>1,1,n,!1,f);q>=h&&(h==-1&&(h=0),this.drawPixel(m,h,k,s,q-h+1,n,!1,0));o=k;j=q}else q>y&&this.drawPixel(m,y+1,k,s,q-y,n,!1,0);else o=this.boxColour,j=y;if(this.spec.antiAlias&&this.boxColour!=="transparent")for(;++j<C;)this.drawPixel(m,j,o,curvyObject.pixelFraction(m,j,f)*s,1,n,l<=0,f)}v=0;for(k=n.childNodes.length;v<k;++v){g=n.childNodes[v];l=parseInt(g.style.top);m=parseInt(g.style.left);s=parseInt(g.style.height);if(d=="tl"||d=="bl")g.style.left=f-m-1+"px";if(d=="tr"||d=="tl")g.style.top=f-s-l+"px";g.style.backgroundRepeat=this.backgroundRepeat;if(this.backgroundImage)switch(d){case"tr":g.style.backgroundPosition=this.backgroundPosX-this.borderWidthL+f-B-m+"px "+(this.backgroundPosY+s+l+this.borderWidth-f)+"px";break;case"tl":g.style.backgroundPosition=this.backgroundPosX-f+m+1+this.borderWidthL+"px "+(this.backgroundPosY-f+s+l+this.borderWidth)+"px";break;case"bl":g.style.backgroundPosition=this.backgroundPosX-f+m+1+this.borderWidthL+"px "+(this.backgroundPosY-A-this.borderWidth+(curvyBrowser.quirksMode?l:-l)+f)+"px";break;case"br":g.style.backgroundPosition=curvyBrowser.quirksMode?this.backgroundPosX-this.borderWidthL-B+f-m+"px "+(this.backgroundPosY-A-this.borderWidth+l+f)+"px":this.backgroundPosX-this.borderWidthL-B+f-m+"px "+(this.backgroundPosY-A-this.borderWidth+f-l)+"px"}}switch(d){case"tl":n.style.top=n.style.left="0";this.topContainer.appendChild(n);break;case"tr":n.style.top=n.style.right="0";this.topContainer.appendChild(n);break;case"bl":n.style.bottom=n.style.left="0";this.bottomContainer.appendChild(n);break;case"br":n.style.bottom=n.style.right="0",this.bottomContainer.appendChild(n)}}b={t:this.spec.radiusdiff("t"),b:this.spec.radiusdiff("b")};for(var r in b)if(typeof r!=="function"&&this.spec.get(r+"R")){if(b[r]){j=this.spec[r+"lR"]<this.spec[r+"rR"]?r+"l":r+"r";h=document.createElement("div");h.style.height=b[r]+"px";h.style.width=this.spec.get(j+"Ru");h.style.position="absolute";h.style.fontSize="1px";h.style.overflow="hidden";h.style.backgroundColor=this.boxColour;if(w)h.style.filter=w;h.style.backgroundImage=this.backgroundImage;h.style.backgroundRepeat=this.backgroundRepeat;switch(j){case"tl":h.style.bottom=h.style.left="0";h.style.borderLeft=this.borderStringL;h.style.backgroundPosition=this.backgroundPosX+"px "+(this.borderWidth+this.backgroundPosY-this.spec.tlR)+"px";this.topContainer.appendChild(h);break;case"tr":h.style.bottom=h.style.right="0";h.style.borderRight=this.borderStringR;h.style.backgroundPosition=this.backgroundPosX-this.boxWidth+this.spec.trR+"px "+(this.borderWidth+this.backgroundPosY-this.spec.trR)+"px";this.topContainer.appendChild(h);break;case"bl":h.style.top=h.style.left="0";h.style.borderLeft=this.borderStringL;h.style.backgroundPosition=this.backgroundPosX+"px "+(this.backgroundPosY-this.borderWidth-this.boxHeight+b[r]+this.spec.blR)+"px";this.bottomContainer.appendChild(h);break;case"br":h.style.top=h.style.right="0",h.style.borderRight=this.borderStringR,h.style.backgroundPosition=this.borderWidthL+this.backgroundPosX-this.boxWidth+this.spec.brR+"px "+(this.backgroundPosY-this.borderWidth-this.boxHeight+b[r]+this.spec.brR)+"px",this.bottomContainer.appendChild(h)}}j=document.createElement("div");if(w)j.style.filter=w;j.style.position="relative";j.style.fontSize="1px";j.style.overflow="hidden";j.style.width=this.fillerWidth(r);j.style.backgroundColor=this.boxColour;j.style.backgroundImage=this.backgroundImage;j.style.backgroundRepeat=this.backgroundRepeat;switch(r){case"t":if(this.topContainer){j.style.height=curvyBrowser.quirksMode?100+x+"px":100+x-this.borderWidth+"px";j.style.marginLeft=this.spec.tlR?this.spec.tlR-this.borderWidthL+"px":"0";j.style.borderTop=this.borderString;if(this.backgroundImage)h=this.spec.tlR?this.borderWidthL+this.backgroundPosX-this.spec.tlR+"px ":this.backgroundPosX+"px ",j.style.backgroundPosition=h+this.backgroundPosY+"px",this.shell.style.backgroundPosition=this.backgroundPosX+"px "+(this.backgroundPosY-x+this.borderWidthL)+"px";this.topContainer.appendChild(j)}break;case"b":if(this.bottomContainer){j.style.height=curvyBrowser.quirksMode?z+"px":z-this.borderWidthB+"px";j.style.marginLeft=this.spec.blR?this.spec.blR-this.borderWidthL+"px":"0";j.style.borderBottom=this.borderStringB;if(this.backgroundImage)h=this.spec.blR?this.backgroundPosX+this.borderWidthL-this.spec.blR+"px ":this.backgroundPosX+"px ",j.style.backgroundPosition=h+(this.backgroundPosY-A-this.borderWidth+z)+"px";this.bottomContainer.appendChild(j)}}}this.contentContainer.style.position="absolute";this.contentContainer.className="autoPadDiv";this.contentContainer.style.left=this.borderWidthL+"px";this.contentContainer.style.paddingTop=this.topPadding+"px";this.contentContainer.style.top=this.borderWidth+"px";this.contentContainer.style.paddingLeft=this.leftPadding+"px";this.contentContainer.style.paddingRight=this.rightPadding+"px";r=B;curvyBrowser.quirksMode||(r-=this.leftPadding+this.rightPadding);this.contentContainer.style.width=r+"px";this.contentContainer.style.textAlign=curvyBrowser.get_style(this.box,"textAlign");this.box.style.textAlign="left";this.box.appendChild(this.contentContainer);if(c)c.style.display=e};if(this.backgroundImage&&(p=this.backgroundCheck(p),t=this.backgroundCheck(t),this.backgroundObject))this.backgroundObject.holdingElement=this,this.dispatch=this.applyCorners,this.applyCorners=function(){this.backgroundObject.complete?this.dispatch():this.backgroundObject.onload=new Function("curvyObject.dispatch(this.holdingElement);")}}else curvyCorners.alert(this.errmsg("zero-width box, cannot display","error")),this.applyCorners=function(){}}curvyObject.prototype.backgroundCheck=function(a){if(a==="top"||a==="left"||parseInt(a)===0)return 0;if(!/^[-\d.]+px$/.test(a)&&!this.backgroundObject)this.backgroundObject=new Image,this.backgroundObject.src=function(a){var c=/url\("?([^'"]+)"?\)/.exec(a);return c?c[1]:a}(this.backgroundImage);return a};curvyObject.dispatch=function(a){if("dispatch"in a)a.dispatch();else throw a.newError("No dispatch function");};curvyObject.prototype.drawPixel=function(a,b,c,d,e,f,g,k){var l=document.createElement("div");l.style.height=e+"px";l.style.width="1px";l.style.position="absolute";l.style.fontSize="1px";l.style.overflow="hidden";e=this.spec.get("tR");l.style.backgroundColor=c;if(g&&this.backgroundImage!=="")l.style.backgroundImage=this.backgroundImage,l.style.backgroundPosition="-"+(this.boxWidth-(k-a)+this.borderWidth)+"px -"+(this.boxHeight+e+b-this.borderWidth)+"px";d!=100&&curvyObject.setOpacity(l,d);l.style.top=b+"px";l.style.left=a+"px";f.appendChild(l)};curvyObject.prototype.fillerWidth=function(a){var b;b=curvyBrowser.quirksMode?0:this.spec.radiusCount(a)*this.borderWidthL;if((a=this.boxWidth-this.spec.radiusSum(a)+b)<0)throw this.newError("Radius exceeds box width");return a+"px"};curvyObject.prototype.errmsg=function(a,b){var c="\ntag: "+this.box.tagName;this.box.id&&(c+="\nid: "+this.box.id);this.box.className&&(c+="\nclass: "+this.box.className);var d;(d=this.box.parentNode)===null?c+="\n(box has no parent)":(c+="\nParent tag: "+d.tagName,d.id&&(c+="\nParent ID: "+d.id),d.className&&(c+="\nParent class: "+d.className));b===void 0&&(b="warning");return"curvyObject "+b+":\n"+a+c};curvyObject.prototype.newError=function(a){return Error(this.errmsg(a,"exception"))};curvyObject.IntToHex=function(a){var b=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];return b[a>>>4]+""+b[a&15]};curvyObject.BlendColour=function(a,b,c){if(a==="transparent"||b==="transparent")throw this.newError("Cannot blend with transparent");a.charAt(0)!=="#"&&(a=curvyObject.format_colour(a));b.charAt(0)!=="#"&&(b=curvyObject.format_colour(b));var d=parseInt(a.substr(1,2),16),e=parseInt(a.substr(3,2),16),a=parseInt(a.substr(5,2),16),f=parseInt(b.substr(1,2),16),g=parseInt(b.substr(3,2),16),b=parseInt(b.substr(5,2),16);if(c>1||c<0)c=1;d=Math.round(d*c+f*(1-c));d>255&&(d=255);d<0&&(d=0);e=Math.round(e*c+g*(1-c));e>255&&(e=255);e<0&&(e=0);c=Math.round(a*c+b*(1-c));c>255&&(c=255);c<0&&(c=0);return"#"+curvyObject.IntToHex(d)+curvyObject.IntToHex(e)+curvyObject.IntToHex(c)};curvyObject.pixelFraction=function(a,b,c){c*=c;var d=Array(2),e=Array(2),f=0,g="",k=Math.sqrt(c-Math.pow(a,2));k>=b&&k<b+1&&(g="Left",d[f]=0,e[f]=k-b,++f);k=Math.sqrt(c-Math.pow(b+1,2));k>=a&&k<a+1&&(g+="Top",d[f]=k-a,e[f]=1,++f);k=Math.sqrt(c-Math.pow(a+1,2));k>=b&&k<b+1&&(g+="Right",d[f]=1,e[f]=k-b,++f);k=Math.sqrt(c-Math.pow(b,2));k>=a&&k<a+1&&(g+="Bottom",d[f]=k-a,e[f]=0);switch(g){case"LeftRight":a=Math.min(e[0],e[1])+(Math.max(e[0],e[1])-Math.min(e[0],e[1]))/2;break;case"TopRight":a=1-(1-d[0])*(1-e[1])/2;break;case"TopBottom":a=Math.min(d[0],d[1])+(Math.max(d[0],d[1])-Math.min(d[0],d[1]))/2;break;case"LeftBottom":a=e[0]*d[1]/2;break;default:a=1}return a};curvyObject.rgb2Array=function(a){return a.substring(4,a.indexOf(")")).split(/,\s*/)};curvyObject.rgb2Hex=function(a){try{var b=curvyObject.rgb2Array(a),c=parseInt(b[0]),d=parseInt(b[1]),e=parseInt(b[2]),f="#"+curvyObject.IntToHex(c)+curvyObject.IntToHex(d)+curvyObject.IntToHex(e)}catch(g){throw a="getMessage"in g?g.getMessage():g.message,Error("Error ("+a+") converting RGB value to Hex in rgb2Hex");}return f};curvyObject.setOpacity=function(a,b){b=b==100?99.999:b;if(curvyBrowser.isSafari&&a.tagName!="IFRAME"){var c=curvyObject.rgb2Array(a.style.backgroundColor),d=parseInt(c[0]),e=parseInt(c[1]),c=parseInt(c[2]);a.style.backgroundColor="rgba("+d+", "+e+", "+c+", "+b/100+")"}else if(typeof a.style.opacity!=="undefined")a.style.opacity=b/100;else if(typeof a.style.MozOpacity!=="undefined")a.style.MozOpacity=b/100;else if(typeof a.style.filter!=="undefined")a.style.filter="alpha(opacity="+b+")";else if(typeof a.style.KHTMLOpacity!=="undefined")a.style.KHTMLOpacity=b/100};curvyCorners.addEvent=function(a,b,c,d){if(a.addEventListener)return a.addEventListener(b,c,d),!0;if(a.attachEvent)return a.attachEvent("on"+b,c);a["on"+b]=c;return!1};if(typeof addEvent==="undefined")addEvent=curvyCorners.addEvent;curvyObject.getComputedColour=function(a){var b=document.createElement("DIV");b.style.backgroundColor=a;document.body.appendChild(b);if(window.getComputedStyle)return a=document.defaultView.getComputedStyle(b,null).getPropertyValue("background-color"),b.parentNode.removeChild(b),a.substr(0,3)==="rgb"&&(a=curvyObject.rgb2Hex(a)),a;else{var c=document.body.createTextRange();c.moveToElementText(b);c.execCommand("ForeColor",!1,a);a=c.queryCommandValue("ForeColor");a="rgb("+(a&255)+", "+((a&65280)>>8)+", "+((a&16711680)>>16)+")";b.parentNode.removeChild(b);return curvyObject.rgb2Hex(a)}};curvyObject.format_colour=function(a){a!==""&&a!=="transparent"&&(a.substr(0,3)==="rgb"?a=curvyObject.rgb2Hex(a):a.charAt(0)!=="#"?a=curvyObject.getComputedColour(a):a.length===4&&(a="#"+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)+a.charAt(3)+a.charAt(3)));return a};curvyCorners.getElementsByClass=function(a,b){var c=[];b===void 0&&(b=document);var a=a.split("."),d="*";a.length===1?(d=a[0],a=!1):(a[0]&&(d=a[0]),a=a[1]);var e,f;if(d.charAt(0)==="#")(e=document.getElementById(d.substr(1)))&&c.push(e);else if(e=b.getElementsByTagName(d),f=e.length,a)for(var g=RegExp("(^|\\s)"+a+"(\\s|$)"),d=0;d<f;++d)g.test(e[d].className)&&c.push(e[d]);else for(d=0;d<f;++d)c.push(e[d]);return c};curvyCorners.getElementsBySelector=function(a,b){var c;c=a[0];b===void 0&&(b=document);if(c.indexOf("#")===-1)c=curvyCorners.getElementsByClass(c,b);else{c=b.getElementById(c.substr(1));if(!c)return[];c=[c]}if(a.length>1){for(var d=[],e=c.length;--e>=0;)d=d.concat(curvyCorners.getElementsBySelector(a.slice(1),c[e]));c=d}return c};if(curvyBrowser.supportsCorners){var curvyCornersNoAutoScan=!0;curvyCorners.init=function(){}}else curvyCorners.scanStyles=function(){function a(a){if(!parseInt(a))return"px";return/^[\d.]+(\w+)$/.exec(a)[1]}var b,c,d;if(curvyBrowser.isIE){var e=function(c){var b=c.style,d,e,f,q;curvyBrowser.ieVer>6?(d=b["-moz-border-radius"]||0,e=b["-moz-border-radius-topright"]||0,f=b["-moz-border-radius-topleft"]||0,q=b["-moz-border-radius-bottomright"]||0,b=b["-moz-border-radius-bottomleft"]||0):(d=b["moz-border-radius"]||0,e=b["moz-border-radius-topright"]||0,f=b["moz-border-radius-topleft"]||0,q=b["moz-border-radius-bottomright"]||0,b=b["moz-border-radius-bottomleft"]||0);if(d){var o=d.split("/"),o=o[0].split(/\s+/);o[o.length-1]===""&&o.pop();switch(o.length){case 3:f=o[0];e=b=o[1];q=o[2];d=!1;break;case 2:f=q=o[0],e=b=o[1],d=!1;case 1:break;case 4:f=o[0];e=o[1];q=o[2];b=o[3];d=!1;break;default:curvyCorners.alert("Illegal corners specification: "+d)}}if(d||f||e||q||b)c=new curvyCnrSpec(c.selectorText),d?c.setcorner(null,null,parseInt(d),a(d)):(e&&c.setcorner("t","r",parseInt(e),a(e)),f&&c.setcorner("t","l",parseInt(f),a(f)),b&&c.setcorner("b","l",parseInt(b),a(b)),q&&c.setcorner("b","r",parseInt(q),a(q))),curvyCorners(c)};for(b=0;b<document.styleSheets.length;++b)try{if(document.styleSheets[b].imports)for(c=0;c<document.styleSheets[b].imports.length;++c)for(d=0;d<document.styleSheets[b].imports[c].rules.length;++d)e(document.styleSheets[b].imports[c].rules[d]);for(c=0;c<document.styleSheets[b].rules.length;++c)e(document.styleSheets[b].rules[c])}catch(f){typeof curvyCornersVerbose!=="undefined"&&curvyCornersVerbose&&alert(f.message+" - ignored")}}else if(curvyBrowser.isOp)for(b=0;b<document.styleSheets.length;++b){if(operasheet.contains_border_radius(b))for(c in d=new operasheet(b),d.rules)isNaN(c)||curvyCorners(d.rules[c])}else curvyCorners.alert("Scanstyles does nothing in Webkit/Firefox/Opera")},curvyCorners.init=function(){if(!arguments.callee.done){arguments.callee.done=!0;if(curvyBrowser.isWebKit&&curvyCorners.init.timer)clearInterval(curvyCorners.init.timer),curvyCorners.init.timer=null;curvyCorners.scanStyles()}};if(typeof curvyCornersNoAutoScan==="undefined"||curvyCornersNoAutoScan===!1)curvyBrowser.isOp?document.addEventListener("DOMContentLoaded",curvyCorners.init,!1):curvyCorners.addEvent(window,"load",curvyCorners.init,!1);
Perhaps the compression messed something up? I just opened the uncompressed code in Eclipse and there are no errors.
Instead of opening your uncompressed code in Eclipse, open it in JSHint, fix the errors and I'll bet your problem goes away. Make sure you configure your options to indicate you're using jQuery.
The code is virtually un-readable in the compressed format, but there are some for() loops without the two semicolons.
If you search for the word for( in the code, you should find them. One is about a third of the way through, and reads for(c=this.box;c=c.parentNode).
I didn't have time to keep searching, but I suspect there are more.
If the code is working prior to being compressed then I suspect you're correct about the compressor being faulty. What compressor did you use?
There are many locations in your code where you did not use the ; jslint reports about 10, this is killing for compression. those errors probably chain react to a mis-interpretation of the file by the javascript engine.
In for(var d=RegExp("(..)border-((top|bottom)-(left|right)-)?radius:\\s*([\\d.]+)(in|em|px|ex|pt)","g"),e,f=new curvyCnrSpec(c[1]);(e=d.exec(c[2]))!==null;)e[1]!=="z-"&&f.setcorner(e[3],e[4],e[5],e[6])
The semicolon after null should come after the closing parenthesis. This would be a lot easier to spot if your code was not formatted all on one line.
EDIT: Disregard this, it is totally wrong.
With same problem, found a comma instead of semi-colon.
for(i = 0, i < x.length; i++)

Categories

Resources