/* This code may be used internally to Travelocity without limitation, exclusion, or restriction. If this code is used externally the following comment must be included everywhere this code is used. */ /*********************************************************************** This is written by Austin Cheney on 7 May 2009. Anybody may use this code without permission so long as this comment exists verbatim in each instance of its use. http://www.travelocity.com/ http://mailmarkup.org/ http://prettydiff.com/ **********************************************************************/ var markupmin=function(g){var d=0,k=(typeof g.source==="string")?g.source.split(""):"Error: no content supplied to markup.",e=(g.comments!=="comments"&&g.comments!=="beautify"&&g.comments!=="diff")?"":g.comments,l=(g.presume_html===true)?true:false,c=(g.top_comments===true)?true:false,b=function(){var i=0,n=[],m=k.length;for(i=d;i"){break}else{n.push(k[i]);k[i]=""}}d=i;k[d]=n.join("").replace(/\s+/g," ").replace(/\s*,\s+/g,", ").replace(/\s*\/\s*/g,"/").replace(/\s*=\s*/g,"=").replace(/ \="/g,'="').replace(/ \='/g,"='")+">"},a=function(){var m=k.length,i=0,n=[];for(i=d;i"){k[i]="";k[i+1]="";k[i+2]="";d=i+2;break}else{if(e==="beautify"||e==="comments"){n.push(k[i])}k[i]=""}}if(e==="comments"||e==="beautify"){k[d]=" "+n.join("")+"-->"}},h=function(C){var B=0,A=[],x=0,v="",t="",s="\s*)$/),p=(/^(\s*<\!\-\-)/),u=(/(\/+\-\->\s*)$/),w="",o="",D=g.source;if(typeof jsmin!=="function"){return}for(B=d;B"){A.push(k[B]);k[B]=""}else{break}}q=A[0];A.splice(0,1);if((/\s/).test(A[0])){A.splice(0,1)}for(x;x"){t=t+k[x];k[x]=""}else{break}}t=t+">";d=x;if(A.join("")===""){k[d]=q+t;return}v=A.join("");if(e!=="beautify"){if(i.test(v)){w=v.match(i)[0];v=v.replace(i,"")}else{if(p.test(v)){w=v.match(p)[0];v=v.replace(p,"")}}if(r.test(v)){o=v.match(r)[0];v=v.replace(r,"")}else{if(u.test(v)){o=v.match(u)[0];v=v.replace(u,"")}}if(C==="style"){v=w+jsmin({source:v,level:3,type:"css",alter:true,fcomment:c})+o}else{v=w+jsmin({source:v,level:2,type:"javascript",alter:true,fcomment:c})+o}}n=v.length;for(B=0;B"){break}m.push(o.charAt(i))}n=m.join("").toLowerCase().replace(/'/g,'"');if(e!=="beautify"&&e!=="diff"){b()}if(n.indexOf('type="')===-1||n.indexOf('type="text/javascript"')!==-1||n.indexOf('type="application/javascript"')!==-1||n.indexOf('type="application/x-javascript"')!==-1||n.indexOf('type="text/ecmascript"')!==-1||n.indexOf('type="application/ecmascript"')!==-1){h("script")}}else{if((o.slice(d,d+6)).toLowerCase()===""){break}m.push(o.charAt(i))}n=m.join("").toLowerCase().replace(/'/g,'"');if(e!=="beautify"&&e!=="diff"){b()}if(n.indexOf('type="')===-1||n.indexOf('type="text/css"')!==-1){h("style")}}else{if(o.slice(d,d+4)==="\s+/g,"--> ").replace(/\s+<\?php/g," \s+/g,"> ").replace(/\s+<\s*/g," <").replace(/\s+\/>/g,"/>").replace(/\s+>/g,">");if((/\s/).test(p.charAt(0))){p=p.slice(1,p.length)}return p}())};