onerror=errorHandler;
var exception_logged=false;
function errorHandler(_1,_2,_3){
if(exception_logged){
return;
}
exception_logged=true;
var _4="Exception: "+_1+"\n";
_4+="URL: "+_2+"\n";
_4+="Line: "+_3+"\n\n";
_4+="Sign: "+sign.to_string()+"\n\n";
var d=new Date();
var _6=d.getMinutes();
var _7=d.getSeconds();
var _8=d.getMilliseconds();
_4+="Time: "+_6+":"+_7+":"+_8+"\n\n";
_4+="Log: \n"+log_text();
if($$("admin")){
alert(_4);
}
_4=encodeURIComponent(_4);
var _2="/contact/report_exception?user_question[name]=exception&user_question[email_or_phone]=0&user_question[question]="+_4;
$.ajax({url:"/contact/report_exception?user_question[name]=exception&user_question[email_or_phone]=0&user_question[question]="+_4,data:"",type:"post"});
return true;
}
var debug_log=[];
var debug_log_index=0;
var max_debug_log_items=40;
function log_text(){
var i=debug_log_index-1;
var _a=0;
var _b="";
for(var _a=0;_a<max_debug_log_items;_a++){
var j=(i-_a+max_debug_log_items)%max_debug_log_items;
_b+=debug_log[j]+"\n";
}
_b+=debug_log[debug_log_index]+"\n";
return _b;
}
function log(_d){
var d=new Date();
var _f=d.getMinutes();
var _10=d.getSeconds();
var _11=d.getMilliseconds();
debug_log[debug_log_index]=_f+":"+_10+":"+_11+" "+_d;
debug_log_index++;
if(debug_log_index==max_debug_log_items){
debug_log_index=0;
}
}
function getStackTrace(){
var _12;
try{
(0)();
}
catch(e){
_12=e.stack?"Firefox":window.opera?"Opera":"Other";
}
switch(_12){
case "Firefox":
return function(){
try{
(0)();
}
catch(e){
return e.stack.replace(/^.*?\n/,"").replace(/(?:\n@:0)?\s+$/m,"").replace(/^\(/gm,"{anonymous}(").split("\n");
}
};
case "Opera":
return function(){
try{
(0)();
}
catch(e){
var _13=e.message.split("\n"),_14="{anonymous}",_15=/Line\s+(\d+).*?in\s+(http\S+)(?:.*?in\s+function\s+(\S+))?/i,i,j,len;
for(i=4,j=0,len=_13.length;i<len;i+=2){
if(_15.test(_13[i])){
_13[j++]=(RegExp.$3?RegExp.$3+"()@"+RegExp.$2+RegExp.$1:_14+RegExp.$2+":"+RegExp.$1)+" -- "+_13[i+1].replace(/^\s+/,"");
}
}
_13.splice(j,_13.length-j);
return _13;
}
};
default:
return function(){
var _19=arguments.callee.caller,_1a="function",_1b="{anonymous}",_1c=/function\s*([\w\-$]+)?\s*\(/i,_1d=[],j=0,fn,_20,i;
while(_19){
fn=_1c.test(_19.toString())?RegExp.$1||_1b:_1b;
_20=_1d.slice.call(_19.arguments);
i=_20.length;
while(i--){
switch(typeof _20[i]){
case "string":
_20[i]="\""+_20[i].replace(/"/g,"\\\"")+"\"";
break;
case "function":
_20[i]=_1a;
break;
}
}
_1d[j++]=fn+"("+_20.join()+")";
_19=_19.caller;
}
return _1d;
};
}
}
var product_max_width=50;
var product_max_height=40;
var product_min_font_size=3;
var SignImage=Class.create({initalize:function(){
}});
var Sign=Class.create({initialize:function(_22){
if(((typeof _22)=="undefined")||(_22=="")){
if($$("sign_type_data")){
this.sign_type=$$("sign_type_data").getAttribute("sign_type");
}
this.v_text="";
this.text_left=0;
this.text_top=0;
this.row_count=1;
this.v_hang_type=null;
this.v_background_color="#fff";
this.v_text_color="#000";
this.fixed_price=0;
this.fixed_width=0;
this.fixed_height=0;
this.v_sign_style="round";
this.v_sign_border="none";
this.images=new Array();
this.sign_model="";
this.price=0;
this.v_product_name=null;
if((typeof _22)=="undefined"){
this.restore_from_cookie();
}
}else{
this.load(eval("("+_22+")"));
}
},load:function(_23){
this.sign_type=_23.sign_type;
if($$("sign_type_data")){
this.sign_type=$$("sign_type_data").getAttribute("sign_type");
}
this.v_text=_23.v_text||"";
this.text_left=_23.text_left||0;
this.text_top=_23.text_top||0;
this.row_count=_23.row_count||1;
this.v_hang_type=_23.v_hang_type;
this.v_background_color=_23.v_background_color||"#fff";
this.v_text_color=_23.v_text_color||"#000";
this.fixed_price=_23.fixed_price||0;
this.price=_23.price||0;
this.fixed_width=1200;
this.fixed_height=400;
this.fixed_height=Math.min(_23.fixed_height||0,this.max_height());
this.fixed_width=Math.min(_23.fixed_width||0,this.max_width());
this.v_sign_style=_23.v_sign_style;
this.v_sign_border=_23.v_sign_border;
this.sign_model=_23.sign_model;
this.images=_23.images;
this.v_product_name=_23.v_product_name;
},to_string:function(){
return encodeURIComponent($.toJSON(this));
},restore_from_cookie:function(){
log("restore from cookie");
var _24=document.cookie.indexOf("sign=");
var len=_24+5;
if((!_24)&&(name!=document.cookie.substring(0,name.length))){
return;
}
if(_24==-1){
return;
}
var end=document.cookie.indexOf(";",len);
if(end==-1){
end=document.cookie.length;
}
var xxx=decodeURIComponent(document.cookie.substring(len,end));
this.load(eval("("+xxx+")"));
},save_to_cookie:function(){
log("save to cookie");
document.cookie="sign="+this.to_string()+";path=/";
return true;
},save_to_database:function(){
document.location="/admin/signs/add?sign="+this.to_string();
},edit:function(){
this.save_to_cookie();
switch($$("money_type").getAttribute("language")){
case "de-DE"||"de-AT":
if(this.get_sign_type()=="name_sign"){
document.location.href="/schildautomat/namensschild";
}else{
if(this.get_sign_type()=="aluminium_sign"){
document.location.href="/schildautomat/aluminiumschild";
}else{
if(this.get_sign_type()=="text"){
document.location.href="/schildautomat/vinyltext";
}else{
document.location.href="/schildautomat";
}
}
}
return;
case "en-GB"||"en-IE"||"en-US":
if(this.get_sign_type()=="name_sign"){
document.location.href="/signomatic/namebadge";
}else{
if(this.get_sign_type()=="aluminium_sign"){
document.location.href="/signomatic/aluminiumsign";
}else{
if(this.get_sign_type()=="text"){
document.location.href="/signomatic/text";
}else{
document.location.href="/signomatic";
}
}
}
return;
case "fr-FR":
if(this.get_sign_type()=="name_sign"){
document.location.href="/plaqueomatic/badge";
}else{
if(this.get_sign_type()=="aluminium_sign"){
document.location.href="/plaqueomatic/aluminium";
}else{
if(this.get_sign_type()=="text"){
document.location.href="/plaqueomatic/texte";
}else{
document.location.href="/plaqueomatic";
}
}
}
return;
case "da-DK":
if(this.get_sign_type()=="name_sign"){
document.location.href="/skiltomaten/navneskilt";
}else{
if(this.get_sign_type()=="aluminium_sign"){
document.location.href="/skiltomaten/aluminiumskilt";
}else{
if(this.get_sign_type()=="text"){
document.location.href="/skiltomaten/tekst";
}else{
document.location.href="/skiltomaten";
}
}
}
return;
case "fi-FI":
if(this.get_sign_type()=="name_sign"){
document.location.href="/kylttiautomaattis/nimikyltit";
}else{
if(this.get_sign_type()=="aluminium_sign"){
document.location.href="/kylttiautomaattis/alumiinikyltit";
}else{
if(this.get_sign_type()=="text"){
document.location.href="/kylttiautomaattis/vinyyliteksti";
}else{
document.location.href="/kylttiautomaattis";
}
}
}
return;
case "es-ES":
if(this.get_sign_type()=="name_sign"){
document.location.href="/signomatic/chapaidentificativa";
}else{
if(this.get_sign_type()=="aluminium_sign"){
document.location.href="/signomatic/aluminio";
}else{
if(this.get_sign_type()=="text"){
document.location.href="/signomatic/texto";
}else{
document.location.href="/signomatic";
}
}
}
return;
case "nb-NO":
if(this.get_sign_type()=="name_sign"){
document.location.href="/skiltomaten/navneskilt";
}else{
if(this.get_sign_type()=="aluminium_sign"){
document.location.href="/skiltomaten/aluminiumsskilt";
}else{
if(this.get_sign_type()=="text"){
document.location.href="/skiltomaten/tekst";
}else{
document.location.href="/skiltomaten";
}
}
}
return;
case "nl-NL":
if(this.get_sign_type()=="name_sign"){
document.location.href="/bordenautomaat/naambord";
}else{
if(this.get_sign_type()=="aluminium_sign"){
document.location.href="/bordenautomaat/aluminiumbord";
}else{
if(this.get_sign_type()=="text"){
document.location.href="/bordenautomaat/tekst";
}else{
document.location.href="/bordenautomaat";
}
}
}
return;
}
if(this.get_sign_type()=="name_sign"){
document.location.href="/skyltomaten/namnskylt";
}else{
if(this.get_sign_type()=="aluminium_sign"){
document.location.href="/skyltomaten/aluminiumskylt";
}else{
if(this.get_sign_type()=="text"){
document.location.href="/skyltomaten/text";
}else{
document.location.href="/skyltomaten";
}
}
}
},remove:function(){
},checkOK:function(){
log("checkOK");
if(!$$("hidden_sign")||view_mode){
return this.save_to_cookie();
}
if(!sizeOK()){
this.restore_from_cookie();
sizeOK();
return false;
}
log("checkOK done");
return this.save_to_cookie();
},text:function(_28){
if(typeof (_28)!="undefined"){
log("sign: set text");
this.v_text=_28;
this.row_count=Math.max(this.v_text.split("</p>").length-1,1);
if(!this.checkOK()){
alert_user($$("texten_far_inte_plats").innerHTML);
return false;
}
return true;
}
return this.v_text;
},row_text:function(_29){
var _2a=this.text().split("</p>")[_29];
if((!_2a)||(_2a.length==0)||(_2a=="&nbsp;")){
return "";
}
return _2a+"</p>";
},row_color:function(_2b){
if(this.single_text_color()){
return null;
}
return this.row_text(_2b).between("color: ",";");
},text_position:function(_2c,_2d){
if(typeof (_2d)!="undefined"){
this.text_left=_2c;
this.text_top=_2d;
this.save_to_cookie();
}
result=[];
result.x=this.text_left;
result.y=this.text_top;
return result;
},hang_type:function(){
var _2e;
if($$("sign_format_hang_types_select")){
_2e=$$("sign_format_hang_types_select").value;
}else{
_2e=getCheckedValue("sign_format_hang_types");
}
if(_2e!=""){
this.v_hang_type=_2e;
}
return this.v_hang_type;
},background_color:function(_2f){
if(typeof (_2f)!="undefined"){
log("sign: background_color");
this.v_background_color=_2f;
if(this.get_sign_type()=="product"){
this.update_product_image();
}
this.checkOK();
}
return this.v_background_color;
},text_color:function(_30){
if(typeof (_30)!="undefined"){
log("sign: text_color");
this.v_text_color=_30;
this.checkOK();
}
return this.v_text_color;
},colors:function(_31){
if(typeof (_31)!="undefined"){
log("sign: colors");
var _32=_31.split(",");
if((this.v_background_color!=_32[0])||(this.v_text_color!=_32[1])){
this.v_background_color=_32[0];
this.v_text_color=_32[1];
this.checkOK();
}
}
return this.v_background_color+","+this.v_text_color;
},colors_as_text:function(){
if(this.is_wood_sign()){
return "";
}
if(this.single_text_color()){
return color_to_text(this.v_background_color)+"/"+color_to_text(this.v_text_color);
}else{
return color_to_text(this.v_background_color);
}
},is_wood_sign:function(){
return this.v_background_color=="#e8cca1";
},font_family:function(){
return this.v_text.between("font-family: ",";");
},sign_style:function(_33){
if(typeof (_33)!="undefined"){
log("sign: sign_style");
if(this.v_sign_style!=_33){
this.v_sign_style=_33;
this.checkOK();
}
}
return this.v_sign_style;
},sign_border:function(_34){
if(typeof (_34)!="undefined"){
log("sign: sign_border");
if(this.v_sign_border!=_34){
this.v_sign_border=_34;
this.checkOK();
}
}
return this.v_sign_border||"none";
},clear_images:function(){
log("sign: clear_images");
this.images=new Array();
this.save_to_cookie();
},update_image:function(_35,_36){
if(_35>=this.images.length){
return;
}
var img=this.images[_35];
img.color=_36;
this.save_to_cookie();
},add_image:function(_38,_39,_3a,_x,_y,_3d,_3e,_3f){
log("sign: add_image");
if((_x+_3d<0)||(_y+_3e<0)){
return -1;
}
if((_x)>this.width){
return -1;
}
if((_y)>this.height){
return -1;
}
var img=new SignImage(_38,_x,_y,_3d,_3e);
img.name=_38;
img.bw=_39;
img.border=_3a;
img.x=_x;
img.y=_y;
img.w=_3d;
img.h=_3e;
img.color=_3f;
this.images[this.images.length]=img;
this.save_to_cookie();
return this.images.length-1;
},delete_image:function(_41){
log("sign: delete_image");
this.images.splice(_41,1);
this.save_to_cookie();
},min_width:function(){
if(this.get_sign_type()=="name_sign"){
return 50;
}
return 23;
},min_height:function(){
if(this.get_sign_type()=="name_sign"){
return 22;
}
return 7;
},max_width:function(){
switch(this.get_sign_type()){
case "acryl_sign":
return 600;
case "stamp":
return 90;
case "plastic_sign":
return 510;
case "aluminium_sign":
if(this.hang_type()=="wall_distance"){
return 600;
}else{
return 1500;
}
case "name_sign":
return 80;
case "text":
return 3000;
case "brass_sign":
return 170;
case "sticker":
return 300;
case "product":
return product_max_width;
}
alert("max_width: "+this.get_sign_type());
return 0;
},max_height:function(){
switch(this.get_sign_type()){
case "acryl_sign":
return 550;
case "plastic_sign":
return 330;
case "aluminium_sign":
return 600;
case "name_sign":
return 50;
case "text":
return 500;
case "brass_sign":
return 150;
case "sticker":
return 200;
case "product":
return product_max_height;
case "stamp":
return 50;
}
return 0;
},min_font_size:function(){
switch(this.get_sign_type()){
case "stamp":
return 3;
case "plastic_sign":
return 4;
case "acryl_sign":
case "aluminium_sign":
case "text":
return 16;
case "name_sign":
return 4;
case "brass_sign":
return 8;
case "sticker":
return 4;
case "product":
return product_min_font_size;
}
return 0;
},update_product_image:function(){
$$("sign_background_area").style.height="500px";
var _42="/images/products/"+this.v_product_name.replaceAll("-","/")+"/"+this.v_background_color.replace("#","").toLowerCase()+".jpg";
$$("sign_background_area").style.background="url('"+_42+"') top center no-repeat";
$$("sign_background_area").style.backgroundPosition="50% 10px";
},product_name:function(_43){
this.v_product_name=_43;
this.update_product_image();
this.checkOK();
},get_sign_type:function(){
if(typeof (this.sign_type)=="undefined"){
return "plastic_sign";
}
if(this.sign_type=="normal_sign"){
return "plastic_sign";
}
return this.sign_type;
},is_vector_type:function(){
return (this.get_sign_type()!="plastic_sign")&&(this.get_sign_type()!="name_sign");
},single_text_color:function(){
return true;
return !this.is_vector_type();
},number_of_colors:function(){
if(this.single_text_color()){
return 1;
}
var _44=[];
for(var i=0;i<this.row_count;i++){
_44[this.row_color(i)]=1;
}
var _46=0;
for(var t in _44){
_46++;
}
return Math.max(_46,1);
},sign_type_name:function(){
if(!$$("sign_type_data")){
return "";
}
return $$("sign_type_data").getAttribute("sign_name");
}});
function create_sign_images(){
log("create_sign_images");
for(var i=0;i<sign.images.length;i++){
var w=Math.round(sign.images[i].w)+"px";
var h=Math.round(sign.images[i].h)+"px";
if(sign.images[i].name=="circle"){
html="<div id='sign_img_"+i+"' style='position: absolute; width: "+w+";height:"+h+";'></div>";
}else{
html="<img id='sign_image_"+i+"' name='sign_img_"+i+"' style='position: absolute; width: "+w+";height:"+h+";visibility:hidden;'>";
}
document.write(html);
}
}
var vectorModel=null;
var SignForm=Class.create({jags:5,radiuses:[20,10],startRadius:54,width:0,height:0,rectangle:0,screws:[null,null],initialize:function(_4b){
log("signForm initialize");
if(!vectorModel){
vectorModel=new VectorModel();
}
log("signForm initialize 2");
var _4c=$$(_4b);
log("signForm initialize 3");
this.mySvg=vectorModel.createElement("svg");
log("signForm initialize 4");
this.mySvg.style.position="absolute";
this.mySvg.style.left="0px";
this.mySvg.style.top="0px";
this.mySvg.style.zIndex="0";
this.transparentFill=document.createElement("v:fill");
this.transparentFill.setAttribute("type","frame");
this.transparentFill.setAttribute("src","/images/transparent.gif");
var _4d=vectorModel.createElement("defs");
_4d.appendChild(this.createGradient("silver","#9a9ea1","#cAdBdD"));
_4d.appendChild(this.createGradient("gold","#a06500","#eac540"));
this.mySvg.appendChild(_4d);
this.oakFill=document.createElement("v:fill");
this.oakFill.setAttribute("type","frame");
this.oakFill.setAttribute("src","/images/ekfaner.jpg");
_4c.appendChild(this.mySvg);
this.mySvg.setAttribute("version","1.1");
this.myG=vectorModel.createElement("g");
this.mySvg.appendChild(this.myG);
log("signForm initialize done");
},createScrew:function(_4e,_cx,_cy,_51,_52){
var _53=vectorModel.createElement("ellipse");
var _54=3;
var _55="#ccc";
var _56="#aaa";
var _57=1;
if(typeof (_52)!="undefined"){
_54=_52;
}
if(_51=="wall_distance"){
_54=25;
_55="#ddd";
_56="#ccc";
}else{
if(_51=="suction_cups"||_51=="center_cup"){
_54=42;
_55="#ccc";
_56="#ddd";
_57=22;
}
}
_53.setAttribute("fill",_55);
_53.setAttribute("stroke",_56);
_53.setAttribute("stroke-width",(_57*_4e)+"px");
_53.setAttribute("rx",(_54*_4e));
_53.setAttribute("ry",(_54*_4e));
_53.setAttribute("cx",_cx);
_53.setAttribute("cy",_cy);
return _53;
},update_suction_cups:function(_58,_59,_w,_h,_5c,_5d,_5e){
var _5f=64*_5c;
var _60=_w+_59;
var _61=_h+_59;
var _62=_60/2;
var _63=_61/2;
if(_58=="oval"||_58=="thorny"){
if(_5d<150){
this.myG.appendChild(this.createSuctionCup(_5c,_62,_5f));
}else{
if(_5d>=150){
this.myG.appendChild(this.createSuctionCup(_5c,_5f,_63));
this.myG.appendChild(this.createSuctionCup(_5c,_60-_5f,_63));
}
}
}else{
if(_5d<150&&_5e<200){
}else{
if(_5d>=150&&_5e<200){
}else{
if(_5d<150&&_5e>=200){
this.myG.appendChild(this.createSuctionCup(_5c,_62,_5f));
this.myG.appendChild(this.createSuctionCup(_5c,_62,_61-_5f));
}else{
if(_5d>=150&&_5e>=200){
this.myG.appendChild(this.createSuctionCup(_5c,_5f,_5f));
this.myG.appendChild(this.createSuctionCup(_5c,_60-_5f,_5f));
this.myG.appendChild(this.createSuctionCup(_5c,_5f,_61-_5f));
this.myG.appendChild(this.createSuctionCup(_5c,_60-_5f,_61-_5f));
}
}
}
}
}
},createSuctionCup:function(_64,_65,_66){
var _67=vectorModel.createElement("ellipse");
var _68=44;
var _69="#ccc";
var _6a="#ddd";
var _6b=22;
_67.setAttribute("fill",_69);
_67.setAttribute("stroke",_6a);
_67.setAttribute("stroke-width",(_6b*_64)+"px");
_67.setAttribute("rx",(_68*_64));
_67.setAttribute("ry",(_68*_64));
_67.setAttribute("cx",_65);
_67.setAttribute("cy",_66);
return _67;
},createGradient:function(_6c,_6d,_6e){
var _6f=vectorModel.createElement("linearGradient");
_6f.setAttribute("id",_6c);
_6f.setAttribute("x1","0%");
_6f.setAttribute("y1","0%");
_6f.setAttribute("x2","100%");
_6f.setAttribute("y2","20%");
var _70=vectorModel.createElement("stop");
_70.setAttribute("offset","20%");
_70.setAttribute("stop-color",_6d);
_70.setAttribute("stop-opacity","1");
var _71=vectorModel.createElement("stop");
_71.setAttribute("offset","100%");
_71.setAttribute("stop-color",_6e);
_71.setAttribute("stop-opacity","1");
_6f.appendChild(_70);
_6f.appendChild(_71);
return _6f;
},padding:function(_w,_h,_74,_75){
log("sf: padding");
var _76=[];
_76.left=0;
_76.top=0;
_76.right=0;
_76.bottom=0;
switch(sign.sign_style()){
case "round":
case "none":
if(_75==0){
break;
}
_76.left=_h*0.08;
_76.top=_h*0.08;
_76.right=_h*0.08;
_76.bottom=_h*0.08;
break;
case "arrow_left":
_76.top=_h*0.4;
_76.bottom=_h*0.4;
_76.left=_h*0.5;
break;
case "arrow_right":
_76.top=_h*0.4;
_76.bottom=_h*0.4;
_76.right=_h*0.5;
break;
case "rounded_sides":
_76.left=_h*0.35;
_76.right=_h*0.35;
break;
case "stop":
_76.top=_h*0.3;
_76.bottom=_h*0.3;
break;
case "star":
_76.top=_h*0.7;
_76.bottom=_h*0.3;
_76.right=_w*0.6;
_76.left=_w*0.6;
break;
case "oval":
if(sign.row_count==1){
_76.left=_w*0.05;
_76.right=_w*0.05;
_76.top=_h*0.25;
}else{
_76.left=_w*0.12;
_76.right=_w*0.12;
_76.top=_h*0.2;
}
_76.bottom=_h*0.2;
break;
case "thorny":
_76.left=_w*0.2;
_76.top=_h*0.2;
_76.right=_w*0.2;
_76.bottom=_h*0.2;
break;
}
var _77=Math.min(_w,_h);
var _78=0;
switch(_74){
case "thin":
_78=_77*0.03;
break;
case "thick":
_78=_77*0.09;
break;
}
_76.left+=_78*2;
_76.top+=_78*2;
_76.right+=_78*2;
_76.bottom+=_78*2;
return _76;
},paint_star:function(_79,_w,_h){
log("sf: paint_star");
var _7c=360/(this.jags*this.radiuses.length);
var _7d=[];
var _7e=0;
var x,y;
var _81=0;
var _82;
var _83="";
var _84=[];
_84["xmin"]=0;
_84["xmax"]=0;
_84["ymin"]=0;
_84["ymax"]=0;
for(var s=0;s<=this.jags*this.radiuses.length+1;s++){
if(_81>this.radiuses.length-1){
_81=0;
}
_82=this.radiuses[_81];
_81++;
_7e=s*_7c+this.startRadius;
a=_7e*Math.PI/180;
x=_82*Math.cos(a);
y=_82*Math.sin(a);
_7d[s]={"x":x,"y":y};
if(x<_84["xmin"]){
_84["xmin"]=x;
}
if(x>_84["xmax"]){
_84["xmax"]=x;
}
if(y<_84["ymin"]){
_84["ymin"]=y;
}
if(y>_84["ymax"]){
_84["ymax"]=y;
}
}
for(i in _7d){
x=(_7d[i].x-_84["xmin"])/(_84["xmax"]-_84["xmin"]);
y=(_7d[i].y-_84["ymin"])/(_84["ymax"]-_84["ymin"]);
_83+=(x*_w+1+_79).toFixed(0)+","+(y*_h+1+_79).toFixed(0)+" ";
}
var _86=vectorModel.createElement("polyline");
_86.setAttribute("points",_83);
return _86;
},hide:function(){
this.mySvg.style.visibility="hidden";
},update_hanging:function(_87,_88,_w,_h,_8b,_8c,_8d){
var _8e=Math.min(_8c,_8d);
var _8f=Math.min(Math.max(_8e/9,8),24)*_8b;
var h=((_8f*2.5)*0.9)+_88*0.8;
var x=(_8f*3)*_8b;
switch(_87){
case "round":
x+=0.04*_w;
break;
}
this.myG.appendChild(this.createScrew(_8b,x+_88,h,"screw",_8f));
this.myG.appendChild(this.createScrew(_8b,_w-x,h,"screw",_8f));
},update_screws:function(_92,_93,_w,_h,_96,_97,_98){
log("sf: update_screws");
var _99=20;
var l=15;
var _9b=100;
var h=_h/2+_93/2;
if(_98=="suction_cups"){
_9b=200;
}
if(_98=="one_screw"){
l=40;
this.myG.appendChild(this.createScrew(_96*2,20*_96+_93,h,_98));
return;
}
if(_98=="center_cup"){
l=40;
this.myG.appendChild(this.createScrew(_96,(_w+_93)/2,54*_96,_98));
return;
}
if(_98=="wall_distance"){
_9b=70;
if(_97<_9b){
_99=30;
}
l+=_99;
}
r=l;
switch(_92){
case "round":
if(_97>=_9b){
l=_97/4;
if(_98=="wall_distance"){
l+=_99;
}
r=l;
this.myG.appendChild(this.createScrew(_96,l*_96+_93,l*_96+_93,_98));
this.myG.appendChild(this.createScrew(_96,_w-(r*_96),r*_96+_93,_98));
h=_h-(l*_96);
}
break;
case "none":
if(_97>=_9b){
l=_97/9+10;
if(_98=="wall_distance"){
l+=_99;
}
r=l;
this.myG.appendChild(this.createScrew(_96,l*_96+_93,l*_96+_93,_98));
this.myG.appendChild(this.createScrew(_96,_w-(r*_96),r*_96+_93,_98));
h=_h-(l*_96);
}
break;
case "rounded_sides":
case "oval":
l=30;
if(_98=="wall_distance"){
l+=30;
}
r=l;
break;
case "triangle_top":
this.myG.appendChild(this.createScrew(_96,_w/2,15*_96));
h=_h-15;
case "thorny":
l=40;
r=40;
break;
case "arrow_left":
l=30;
r=15;
break;
case "arrow_right":
l=15;
r=30;
break;
}
this.myG.appendChild(this.createScrew(_96,l*_96+_93,h,_98));
this.myG.appendChild(this.createScrew(_96,_w-r*_96,h,_98));
},set_style:function(_9d,_9e,_w,_h,_a1,_a2,_a3,_a4,_a5,_a6){
log("sf: set_style");
if(_a1){
_a1=_a1.toLowerCase();
}
if(typeof (_a6)=="undefined"){
_a6=0;
}
this.width=_w;
this.height=_h;
var _a7=Math.min(_w,_h);
if(_a7<5){
return;
}
var _a8=0;
switch(_9e){
case "thin":
_a8=_a7*0.03;
break;
case "thick":
_a8=_a7*0.09;
break;
}
while(this.myG.childNodes.length>=1){
this.myG.removeChild(this.myG.firstChild);
}
var _a9=_a8/2;
_h-=_a8+2;
_w-=_a8+2;
var _aa;
var d="";
this.style=_9d;
log("sf: switch style");
switch(_9d){
case "round":
_aa=vectorModel.createElement("rect");
_aa.setAttribute("x",1+_a9);
_aa.setAttribute("y",1+_a9);
_aa.setAttribute("width",_w);
_aa.setAttribute("height",_h);
var _ac=(Math.min(_w,_h)*0.1).toFixed();
_aa.setAttribute("rx",_ac);
_aa.setAttribute("ry",_ac);
break;
case "square":
case "none":
_aa=vectorModel.createElement("rect");
_aa.setAttribute("x",1+(_a9));
_aa.setAttribute("y",1+(_a9));
_aa.setAttribute("width",_w);
_aa.setAttribute("height",_h);
break;
case "oval":
_aa=vectorModel.createElement("ellipse");
_aa.setAttribute("cx",_w/2+1+(_a9));
_aa.setAttribute("cy",_h/2+1+(_a9));
_aa.setAttribute("rx",(_w-(_a9/2))/2);
_aa.setAttribute("ry",(_h-(_a9/2))/2);
break;
case "rounded_sides":
var a_w=(_w-_h*0.68).toFixed(0)*1;
var a_x=(_w-_h*0.34).toFixed(0)*1;
d="M 0.34h,0.84h l 0,0.16h l "+a_w+",0 l 0,-0.16h A 0.33h,0.33h 0 1,0 "+a_x+",0.16h l 0,-0.16h l -"+a_w+",0 l 0,0.16h "+"A 0.33h,0.33h 0 1,0 0.34h,0.84h l 0,0.16h z";
break;
case "arrow_right":
var a_w=(_w-_h/2).toFixed(0)*1;
d="M x,"+(_h*0.2+1+_a9).toFixed(0)+" l 0,0.6h l "+a_w+",0 l 0,0.2h L w,0.5h L "+(a_w+1)+",1 l 0,0.2h l -"+a_w+",0";
break;
case "arrow_left":
var a_w=(_w-_h/2).toFixed(0)*1;
var _af=(_w+_a9).toFixed(0)*1;
d="M "+_af+","+(_h*0.2+1+_a9).toFixed(0)+" l 0,0.6h l -"+a_w+",0 l 0,0.2h L 1,0.5h L "+(_w-a_w).toFixed(0)+",1 l 0,0.2h l "+(a_w+_a9).toFixed(0)+",0 l 0,0.6h";
break;
case "stop":
this.jags=4;
this.radiuses=[20,20];
this.startRadius=22.5;
_aa=this.paint_star(_a9,_w,_h);
break;
case "star":
this.jags=5;
this.radiuses=[20,10];
this.startRadius=54;
_aa=this.paint_star(_a9,_w,_h);
break;
case "triangle_top":
this.jags=3;
this.radiuses=[20,10];
this.startRadius=270;
_aa=this.paint_star(_a9,_w,_h);
break;
case "thorny":
this.jags=30;
this.radiuses=[20,18];
this.startRadius=54;
_aa=this.paint_star(_a9,_w,_h);
break;
case "heart":
d="M 0.5w,h L 1,0.5h A 0.25w,0.25w 0 1,1 0.5w,0.5h A 0.25w,0.25w 0 1,1 w,0.5h z";
break;
}
if(d!=""){
log("sf: d != 0");
_aa=vectorModel.createElement("path");
d=d.replaceAll("0.16h",(_h*0.16).toFixed(0)).replaceAll("0.2h",(_h*0.2).toFixed(0)).replaceAll("0.34h",(_h*0.34).toFixed(0)).replaceAll("0.4h",(_h*0.4).toFixed(0)).replaceAll("0.42h",(_h*0.42).toFixed(0)).replaceAll("0.5h",(_h*0.5).toFixed(0)).replaceAll("0.6h",(_h*0.6).toFixed(0)).replaceAll("0.8h",(_h*0.8).toFixed(0)).replaceAll("0.84h",(_h*0.84).toFixed(0)).replaceAll("h",_h.toFixed(0));
d=d.replaceAll("0.2w",(_w*0.2).toFixed(0)).replaceAll("0.25w",(_w*0.25).toFixed(0)).replaceAll("0.5w",(_w*0.5).toFixed(0)).replaceAll("0.8w",(_w*0.8).toFixed(0)).replaceAll("w",_w.toFixed(0));
d=d.replaceAll("x",(_a9+1).toFixed(0)).replaceAll("y",(_a9+1).toFixed(0));
_aa.setAttribute("d",d);
}
var _b0="#ccc";
if(_aa){
log("sf: color");
if((_a1==null)||(_a1=="#f0f0f0")){
if($.browser.msie){
_aa.appendChild(this.transparentFill);
}else{
_aa.setAttribute("fill","transparent");
}
_b0="#666";
}else{
if(_a1=="#bbb"){
_aa.setAttribute("fill","url(#silver)");
}else{
if(_a1=="#daa520"){
_aa.setAttribute("fill","url(#gold)");
}else{
if(_a1=="#e8cca1"){
if($.browser.msie){
_aa.appendChild(this.oakFill);
}else{
_aa.setAttribute("fill","#e8cca1");
}
}else{
_aa.setAttribute("fill",_a1);
}
}
}
}
if(_9e=="thin"){
_aa.setAttribute("stroke",_a2);
_aa.setAttribute("stroke-width",_a8+"px");
}else{
if(_9e=="thick"){
_aa.setAttribute("stroke",_a2);
_aa.setAttribute("stroke-width",_a8+"px");
}else{
if(_9e=="2px"){
_aa.setAttribute("stroke",_a2);
_aa.setAttribute("stroke-width","1.5px");
}else{
_aa.setAttribute("stroke",_b0);
_aa.setAttribute("stroke-width","1px");
}
}
}
this.myG.appendChild(_aa);
this.mySvg.style.visibility="visible";
}
if((_a3=="screw")||(_a3=="tape_and_screw")||(_a3=="wall_distance")||(_a3=="one_screw")){
this.update_screws(_9d,_a8,_w,_h,_a4,_a6,_a3);
}else{
if((_a3=="hanging")&&(_a5>=150)){
this.update_hanging(_9d,_a8,_w,_h,_a4,_a5,_a6);
}else{
if(_a3=="suction_cups"){
this.update_suction_cups(_9d,_a8,_w,_h,_a4,_a5,_a6);
}
}
}
log("sf: done");
this.rectangle=_aa;
return _aa;
}});
var doClose;
doClose=function(){
log("doClose");
iPanel.closeIFrame("imagelist_frame");
};
function show_video(_b1,_b2){
iPanel.openIFrame("imagelist_frame","InternalFramePanel","/video/show?name="+_b1,542,340);
}
function show_video2(_b3,_b4){
iPanel.openIFrame("imagelist_frame","InternalFramePanel","/video/show_flv?name="+_b3+".flv",542,340);
}
function show_video_flv(_b5,_b6,_b7){
iPanel.openIFrame("imagelist_frame","InternalFramePanel","/video/show_flv?name="+_b5+".flv&width="+_b6+"&height="+_b7,_b6,_b7);
}
function show_youtube_video(_b8,_b9){
iPanel.openIFrame("imagelist_frame","InternalFramePanel","/video/show?name="+_b8,562,480);
}
function show_large_youtube_video(_ba,_bb){
iPanel.openIFrame("imagelist_frame","InternalFramePanel","/video/show?name="+_ba,742,580);
}
function InternalFramePanel(){
}
InternalFramePanel.prototype.reloadWithUrl=function(){
if(this.altUrl){
window.location=this.altUrl;
}else{
var _bc=window.location;
window.location=_bc;
}
};
InternalFramePanel.prototype.alternateClose=function(url){
if(url){
this.altUrl=url;
}
doClose=this.reloadWithUrl;
};
InternalFramePanel.prototype.openIFrame=function(id,_bf,url,_c1,_c2){
log("openIFrame");
this.createMask();
var div=document.createElement("div");
div.innerHTML="<iframe name=\""+id+"_iframe\"></iframe>";
var _c4=div.firstChild;
div.setAttribute("id",id+"_div");
_c4.setAttribute("id",id+"_iframe");
_c4.setAttribute("scrolling","no");
_c4.setAttribute("frameBorder","0");
_c4.setAttribute("allowTransparency","true");
_c4.className=_bf;
_c4.setAttribute("src",url);
if(screen.height<=600){
div.style.position="absolute";
div.style.top="10px";
div.style.left="10px";
div.style.margin="0";
div.style.zIndex="20";
_c4.style.position="absolute";
_c4.style.top="10px";
_c4.style.left="10px";
_c4.style.margin="0";
}
if(_c1&&_c2){
div.setAttribute("width",_c1);
div.setAttribute("height",_c2);
_c4.style.width=_c1+"px";
_c4.style.height=_c2+"px";
_c4.style.marginLeft=-(_c1/2)+"px";
}
div.appendChild(_c4);
document.body.appendChild(div);
log("openIFrame done");
return _c4;
};
InternalFramePanel.prototype.closeIFrame=function(id){
log("closeIFrame");
var div=document.getElementById(id+"_div");
var _c7;
while((_c7=div.firstChild)!=null){
div.removeChild(_c7);
}
document.body.removeChild(div);
this.removeMask();
};
InternalFramePanel.prototype.createMask=function(){
log("createMask");
var id="EditMask";
var _c9=eval(document.getElementById(id));
if(!_c9){
maskIFrame=document.createElement("iframe");
maskIFrame.id=id;
maskIFrame.className="EditMask";
maskIFrame.scrolling="no";
maskIFrame.setAttribute("frameBorder","0");
body=document.getElementsByTagName("body")[0];
body.appendChild(maskIFrame);
var doc=maskIFrame.contentDocument?maskIFrame.contentDocument:maskIFrame.Document;
doc.write("<html><head></head>"+"<body style=\"background-color: black;\"></body></html>");
doc.close();
}
log("createMask done");
};
InternalFramePanel.prototype.removeMask=function(){
log("removeMask");
var id="EditMask";
var _cc=eval(document.getElementById(id));
if(_cc){
document.body.removeChild(document.getElementById(id));
}
};
InternalFramePanel.prototype.adjustFrameSize=function(win){
log("adjustFrameSize");
var elm=document.getElementById(win.name);
if(win.document.compatMode&&win.document.compatMode!="BackCompat"){
elm.style.height=win.document.documentElement.scrollHeight+"px";
elm.style.width=win.document.documentElement.scrollWidth+"px";
}else{
elm.style.height=win.document.body.scrollHeight+"px";
elm.style.width=win.document.body.scrollWidth+"px";
}
log("adjustFrameSize done");
};
var iPanel=new InternalFramePanel();
var itemsAddedToBasket=0;
var products_in_basket=[];
var last_received_ajax_id=0;
var last_ajax_id=0;
var ajax_requests=new Array();
var order_basket_when_complete=false;
function add_to_basket(_cf){
log("add_to_basket");
_cf.server_id=0;
_cf.count=1;
_cf.basket_id=Math.round(Math.random()*99999999);
products_in_basket.push(_cf);
addProductToTable(_cf);
send_product_to_server(_cf);
}
function server_add_to_basket(_d0,_d1,_d2,_d3,_d4,_d5,_d6,_d7,_d8,_d9){
log("server_add_to_basket");
try{
var _da=new Object;
_da.basket_id=Math.round(Math.random()*99999999);
_da.server_id=_d0;
_da.description=_d2;
_da.sign_type=_d3;
_da.get_sign_type=function(){
return this.sign_type;
};
_da.width=_d4;
_da.height=_d5;
_da.colors_as_text=function(){
return _d6;
};
_da.price=_d7;
_da.count=_d8;
_da.data=_d1;
_da.to_string=function(){
return this.data;
};
products_in_basket.push(_da);
addProductToTable(_da,_d9);
return _da;
}
catch(e){
}
}
function local_measurement(_mm){
if(local_measurement_str()!="mm"){
return Math.round(_mm*0.393700787)/10;
}
return _mm;
}
function inverted_measurement(_mm){
if(local_measurement_str()!="mm"){
return Math.round(_mm/0.0393700787);
}
return _mm;
}
function local_measurement_str(){
return $$("money_type").getAttribute("measurement");
}
function local_measurement_string(_mm){
if(local_measurement_str()!="mm"){
return local_measurement(_mm)+"&nbsp;"+local_measurement_str();
}else{
return local_measurement(_mm)+local_measurement_str();
}
}
function price_with_sign(_de){
if($$("money_type").getAttribute("money_first")=="true"){
return $$("money_type").getAttribute("money_name")+_de;
}else{
return _de+" "+$$("money_type").getAttribute("money_name");
}
}
function local_price(_df){
var _e0=$$("money_type").getAttribute("rel_value")*1;
var _e1=(_df/_e0).toFixed($$("money_type").getAttribute("decimals"));
return price_with_sign(_e1);
}
function local_price_sum(_e2){
var _e3=$$("money_type").getAttribute("rel_value")*1;
var _e4=(_e2/_e3).toFixed($$("money_type").getAttribute("decimals"));
return _e4;
}
function local_price_tax(_e5){
var _e6=$$("money_type").getAttribute("rel_value")*1;
var tax=$$("money_type").getAttribute("tax")/100;
var _e8=(_e5/_e6*tax).toFixed($$("money_type").getAttribute("decimals"));
return price_with_sign(_e8);
}
function local_price_with_tax(_e9){
var _ea=$$("money_type").getAttribute("rel_value")*1;
var tax=$$("money_type").getAttribute("tax")/100+1;
var _ec=(_e9/_ea*tax).toFixed($$("money_type").getAttribute("decimals"));
return price_with_sign(_ec);
}
var first_product=true;
function addProductToTable(_ed,_ee){
log("addProductToTable");
_ee=_ee||first_product;
first_product=false;
var tbl=$$("order_basket_table");
var _f0=tbl.rows.length;
if($$("basket_discount")){
_f0-=1;
}
if($$("basket_total_price_row")){
_f0-=1;
}
var row=tbl.insertRow(_f0);
var _f2=_ed.basket_id;
var _f3=row.insertCell(0);
_f3.appendChild(document.createTextNode(_f0));
var _f4=row.insertCell(1);
_f4.style.textAlign="left";
_f4.basket_id=_f2;
var _f5=document.createElement("div");
_f5.className="basket_description";
if(_ed&&_ed.data&&(_ed.data.indexOf("border-bottom")>0)){
_f5.innerHTML="<u>"+_ed.description+"</u>";
}else{
_f5.innerHTML=_ed.description;
}
_f4.appendChild(_f5);
var _f6=row.insertCell(2);
_f6.appendChild(document.createTextNode(_ed.colors_as_text()));
var _f7=row.insertCell(3);
_f7.id="basket_item_price_"+_f2;
_f7.appendChild(document.createTextNode(local_price(_ed.price)));
if(!_ee){
var _f8=document.createElement("input");
_f8.type="text";
_f8.name="basket_item_count_"+_f2;
_f8.id="basket_item_count_"+_f2;
_f8.size=3;
_f8.width="40";
_f8.value=_ed.count;
_f8.onkeydown=function(_f9){
return numericInput(_f9,function(){
basket_item_count_changed(_ed);
});
};
_f8.onchange=function(){
update_basket_item_count(_ed);
};
row.insertCell(4).appendChild(_f8);
}else{
if(_ed.count==null){
_ed.count=1;
}
row.insertCell(4).appendChild(document.createTextNode(_ed.count));
}
var _fa=row.insertCell(5);
_fa.id="basket_item_total_price_"+_f2;
_fa.appendChild(document.createTextNode(local_price(0)));
if(!_ee){
var _fb=document.createElement("span");
_fb.onclick=function(){
remove_product(_ed);
};
_fb.id="basket_remove_button";
_fb.innerHTML=$$("basket_remove").innerHTML;
var _fc=row.insertCell(6);
_fc.style.textAlign="center";
_fc.appendChild(_fb);
}else{
if(tbl.rows[0].childNodes.length==13){
row.insertCell(6).appendChild(document.createTextNode(""));
}
}
basket_item_count_changed(_ed);
log("addProductToTable done");
}
function isIE(){
return /msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent);
}
function update_total_price(){
log("update_total_price");
var _fd=0;
var _fe=0;
var _ff="";
var _100=0;
var _101=0;
for(var i=0;i<products_in_basket.length;i++){
var _103=products_in_basket[i];
_fd+=_103.price*_103.count;
if((_103.get_sign_type()=="plastic_sign")||(_103.get_sign_type()=="name_sign")){
_fe+=_103.price*_103.count;
}
if(_103.get_sign_type()=="name_sign"){
_100+=_103.count;
}
_ff+="("+products_in_basket[i].description+")";
}
_fd+=_101;
if(typeof (debugmode)!="undefined"){
$$("items_in_basket").innerHTML=products_in_basket.length;
$$("text_in_basket").innerHTML=_ff;
}
if($$("basket_discount")){
var _104=0;
if(_fe>700){
_104=5;
}
if(_fe>1000){
_104=10;
}
if(_fe>2000){
_104=15;
}
if(_fe>5000){
_104=20;
}
if(_fe>11000){
_104=25;
}
if(_fe>18000){
_104=30;
}
if($$("coupon[order_discount]")){
var _105=parseInt($$("coupon[order_discount]").value)||0;
}
if(_105>0){
}
if(_104>=10||(_100>4)){
var _106=Math.max(_100-4,0)*4.1;
var _107=Math.floor(_fe*(_104/100)+_106);
_104=Math.round((_107/_fd)*100);
if(!_105){
_fd=_fd-_107;
}
var _108=parseInt(local_price_sum(_107));
if((_108&&_105==0)||(_108&&!_105)){
$$("basket_discount_percent").innerHTML=_104+" %";
$$("basket_discount_price").innerHTML=$$("rabatt").innerHTML+": "+local_price(_107);
if($$("coupon[mass_discount]")){
$$("coupon[mass_discount]").value=_107;
}
if($$("order_discount_field")){
$$("order_discount_field").value=_107;
}
if($$("order_discount_field")){
$$("order_discount_field").value=_107;
}
if($$("basket_total_discount_result")){
$$("basket_total_discount_result").innerHTML="-"+local_price(_107);
$$("basket_discount_text").innerHTML=$$("rabatt_inraknat").innerHTML;
}
if(isIE()){
$$("basket_discount").style.display="inline";
}else{
$$("basket_discount").style.display="table-row";
}
}else{
if(parseInt(_108)>parseInt(local_price_sum($$("order_discount_field").value))){
$$("order_discount_field").value=_107;
$$("coupon[order_discount]").value=_107;
$$("coupon[mass_discount]").value=_107;
if($$("basket_total_discount_result")){
$$("basket_total_discount_result").innerHTML="-"+local_price(_107);
$$("basket_discount_text").innerHTML=$$("rabatt_inraknat").innerHTML;
}
_fd=_fd-_107;
}else{
_fd=_fd-_105;
}
}
}else{
if($$("basket_total_discount_result")&&_105>0){
$$("basket_total_discount_result").innerHTML="-"+local_price(_105);
$$("basket_discount_text").innerHTML=$$("rabatt_inraknat").innerHTML;
}
if($$("order_discount_field")){
_fd=_fd-(_105||0);
}
$$("basket_discount").style.display="none";
}
}
$$("basket_total_price").innerHTML=local_price(_fd);
if($$("basket_total_price_2")){
$$("basket_total_price_2").innerHTML=local_price(_fd);
}
if($$("basket_total_price_total")){
$$("basket_total_price_total").innerHTML=local_price_with_tax(_fd);
}
if($$("basket_total_price_tax")){
$$("basket_total_price_tax").innerHTML=local_price_tax(_fd);
}
try{
update_basket_buttons();
}
catch(e){
}
}
function basket_item_count_changed(_109){
var id=_109.basket_id;
try{
_109.count=$$("basket_item_count_"+id).value*1;
}
catch(e){
}
$$("basket_item_total_price_"+id).innerHTML=local_price(_109.count*_109.price);
update_total_price();
}
function update_basket_item_count(_10b){
basket_item_count_changed(_10b);
send_product_to_server(_10b);
}
function find_product_from_basket_id(_10c){
for(var i=0;i<products_in_basket.length;i++){
if(products_in_basket[i].basket_id==_10c){
return products_in_basket[i];
}
}
return null;
}
function send_product_to_server(_10e){
ajax_request("/order/add","product="+encodeURIComponent($.toJSON(_10e)));
}
function ajax_request(_10f,_110){
log("ajax_request");
last_ajax_id++;
_10f=$$("pre_language").innerHTML+_10f+"?ajax_id="+last_ajax_id;
if(_110){
_10f=_10f+"****&****"+_110;
}
ajax_requests[last_ajax_id]=_10f;
if($$("basket_status")&&($$("basket_status").innerHTML=="")){
$$("basket_status").innerHTML=$$("uppdaterar_kundvagnen").innerHTML;
}
if(last_ajax_id==(last_received_ajax_id+1)){
send_next_ajax_request();
}
}
var ajax_updater_timer;
var ajax_error=false;
function send_next_ajax_request(){
log("send_next_ajax_request");
if(ajax_updater_timer){
clearInterval(ajax_updater_timer);
}
ajax_updater_timer=setInterval(function(){
send_next_ajax_request();
},10000);
var _111=ajax_requests[last_received_ajax_id+1].split("****&****");
$.ajax({url:_111[0],data:_111[1],type:"post",complete:function(_112){
log("ajax complete call");
if(_112.responseText==(last_received_ajax_id+1)){
last_received_ajax_id++;
delete ajax_requests[_112.responseText];
if(last_received_ajax_id==last_ajax_id){
clearInterval(ajax_updater_timer);
if($$("basket_status")){
$$("basket_status").innerHTML="";
}
ajax_error=false;
if(order_basket_when_complete){
order_basket();
}else{
update_basket_buttons();
}
}else{
send_next_ajax_request();
}
}else{
if($$("basket_status")){
$$("basket_status").innerHTML="<span style=\"color:red\">"+$$("vantar_pa_skyltmax").innerHTML+"</span>";
}
ajax_error=true;
order_basket_when_complete=false;
update_basket_buttons();
}
}});
}
function update_basket_buttons(){
if(!$$("basket_order_button")){
return;
}
var _113=products_in_basket.length==1;
if((ajax_error)||_113){
$$("basket_order_button").style.display="none";
$$("basket_view_button").style.display="none";
}else{
$$("basket_order_button").style.display="block";
$$("basket_view_button").style.display="block";
}
}
function update_row_index(){
var tbl=$$("order_basket_table");
for(var i=0;i<tbl.tBodies[0].rows.length-1;i++){
tbl.tBodies[0].rows[i].childNodes[0].innerHTML=i+1;
}
}
function remove_product(_116){
log("remove_product");
var _117=products_in_basket.indexOf(_116);
if(_117!=-1){
var tbl=$$("order_basket_table");
tbl.deleteRow(_117+1);
products_in_basket.splice(_117,1);
ajax_request("/order/remove","product="+encodeURIComponent($.toJSON(_116)));
update_total_price();
update_row_index();
}
}
function empty_basket(){
log("empty_basket");
var tbl=$$("order_basket_table");
var rows=tbl.tBodies[0].rows.length-1;
for(var i=0;i<rows;i++){
tbl.tBodies[0].deleteRow(0);
}
products_in_basket=[];
update_total_price();
ajax_request("/order/remove_all");
}
(function(a,b){
function cA(a){
return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1;
}
function cx(a){
if(!cm[a]){
var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");
d.remove();
if(e==="none"||e===""){
cn||(cn=c.createElement("iframe"),cn.frameBorder=cn.width=cn.height=0),b.appendChild(cn);
if(!co||!cn.createElement){
co=(cn.contentWindow||cn.contentDocument).document,co.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),co.close();
}
d=co.createElement(a),co.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cn);
}
cm[a]=e;
}
return cm[a];
}
function cw(a,b){
var c={};
f.each(cs.concat.apply([],cs.slice(0,b)),function(){
c[this]=a;
});
return c;
}
function cv(){
ct=b;
}
function cu(){
setTimeout(cv,0);
return ct=f.now();
}
function cl(){
try{
return new a.ActiveXObject("Microsoft.XMLHTTP");
}
catch(b){
}
}
function ck(){
try{
return new a.XMLHttpRequest;
}
catch(b){
}
}
function ce(a,c){
a.dataFilter&&(c=a.dataFilter(c,a.dataType));
var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;
for(g=1;g<i;g++){
if(g===1){
for(h in a.converters){
typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);
}
}
l=k,k=d[g];
if(k==="*"){
k=l;
}else{
if(l!=="*"&&l!==k){
m=l+" "+k,n=e[m]||e["* "+k];
if(!n){
p=b;
for(o in e){
j=o.split(" ");
if(j[0]===l||j[0]==="*"){
p=e[j[1]+" "+k];
if(p){
o=e[o],o===!0?n=p:p===!0&&(n=o);
break;
}
}
}
}
!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)));
}
}
}
return c;
}
function cd(a,c,d){
var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;
for(i in g){
i in d&&(c[g[i]]=d[i]);
}
while(f[0]==="*"){
f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));
}
if(h){
for(i in e){
if(e[i]&&e[i].test(h)){
f.unshift(i);
break;
}
}
}
if(f[0] in d){
j=f[0];
}else{
for(i in d){
if(!f[0]||a.converters[i+" "+f[0]]){
j=i;
break;
}
k||(k=i);
}
j=j||k;
}
if(j){
j!==f[0]&&f.unshift(j);
return d[j];
}
}
function cc(a,b,c,d){
if(f.isArray(b)){
f.each(b,function(b,e){
c||bG.test(a)?d(a,e):cc(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d);
});
}else{
if(!c&&b!=null&&typeof b=="object"){
for(var e in b){
cc(a+"["+e+"]",b[e],c,d);
}
}else{
d(a,b);
}
}
}
function cb(a,c){
var d,e,g=f.ajaxSettings.flatOptions||{};
for(d in c){
c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);
}
e&&f.extend(!0,a,e);
}
function ca(a,c,d,e,f,g){
f=f||c.dataTypes[0],g=g||{},g[f]=!0;
var h=a[f],i=0,j=h?h.length:0,k=a===bV,l;
for(;i<j&&(k||!l);i++){
l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=ca(a,c,d,e,l,g)));
}
(k||!l)&&!g["*"]&&(l=ca(a,c,d,e,"*",g));
return l;
}
function b_(a){
return function(b,c){
typeof b!="string"&&(c=b,b="*");
if(f.isFunction(c)){
var d=b.toLowerCase().split(bR),e=0,g=d.length,h,i,j;
for(;e<g;e++){
h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c);
}
}
};
}
function bE(a,b,c){
var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bz:bA;
if(d>0){
c!=="border"&&f.each(e,function(){
c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0;
});
return d+"px";
}
d=bB(a,b,b);
if(d<0||d==null){
d=a.style[b]||0;
}
d=parseFloat(d)||0,c&&f.each(e,function(){
d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0);
});
return d+"px";
}
function br(a,b){
b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bi,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b);
}
function bq(a){
var b=(a.nodeName||"").toLowerCase();
b==="input"?bp(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bp);
}
function bp(a){
if(a.type==="checkbox"||a.type==="radio"){
a.defaultChecked=a.checked;
}
}
function bo(a){
return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[];
}
function bn(a,b){
var c;
if(b.nodeType===1){
b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();
if(c==="object"){
b.outerHTML=a.outerHTML;
}else{
if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){
if(c==="option"){
b.selected=a.defaultSelected;
}else{
if(c==="input"||c==="textarea"){
b.defaultValue=a.defaultValue;
}
}
}else{
a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);
}
}
b.removeAttribute(f.expando);
}
}
function bm(a,b){
if(b.nodeType===1&&!!f.hasData(a)){
var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;
if(i){
delete h.handle,h.events={};
for(c in i){
for(d=0,e=i[c].length;d<e;d++){
f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data);
}
}
}
h.data&&(h.data=f.extend({},h.data));
}
}
function bl(a,b){
return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a;
}
function X(a){
var b=Y.split(" "),c=a.createDocumentFragment();
if(c.createElement){
while(b.length){
c.createElement(b.pop());
}
}
return c;
}
function W(a,b,c){
b=b||0;
if(f.isFunction(b)){
return f.grep(a,function(a,d){
var e=!!b.call(a,d,a);
return e===c;
});
}
if(b.nodeType){
return f.grep(a,function(a,d){
return a===b===c;
});
}
if(typeof b=="string"){
var d=f.grep(a,function(a){
return a.nodeType===1;
});
if(R.test(b)){
return f.filter(b,d,!c);
}
b=f.filter(b,d);
}
return f.grep(a,function(a,d){
return f.inArray(a,b)>=0===c;
});
}
function V(a){
return !a||!a.parentNode||a.parentNode.nodeType===11;
}
function N(){
return !0;
}
function M(){
return !1;
}
function n(a,b,c){
var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);
h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){
!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire());
},0);
}
function m(a){
for(var b in a){
if(b==="data"&&f.isEmptyObject(a[b])){
continue;
}
if(b!=="toJSON"){
return !1;
}
}
return !0;
}
function l(a,c,d){
if(d===b&&a.nodeType===1){
var e="data-"+c.replace(k,"-$1").toLowerCase();
d=a.getAttribute(e);
if(typeof d=="string"){
try{
d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d;
}
catch(g){
}
f.data(a,c,d);
}else{
d=b;
}
}
return d;
}
function h(a){
var b=g[a]={},c,d;
a=a.split(/\s+/);
for(c=0,d=a.length;c<d;c++){
b[a[c]]=!0;
}
return b;
}
var c=a.document,d=a.navigator,e=a.location,f=function(){
function K(){
if(!e.isReady){
try{
c.documentElement.doScroll("left");
}
catch(a){
setTimeout(K,1);
return;
}
e.ready();
}
}
var e=function(a,b){
return new e.fn.init(a,b,h);
},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z]|[0-9])/ig,x=/^-ms-/,y=function(a,b){
return (b+"").toUpperCase();
},z=d.userAgent,A,B,C,D=Object.prototype.toString,E=Object.prototype.hasOwnProperty,F=Array.prototype.push,G=Array.prototype.slice,H=String.prototype.trim,I=Array.prototype.indexOf,J={};
e.fn=e.prototype={constructor:e,init:function(a,d,f){
var g,h,j,k;
if(!a){
return this;
}
if(a.nodeType){
this.context=this[0]=a,this.length=1;
return this;
}
if(a==="body"&&!d&&c.body){
this.context=c,this[0]=c.body,this.selector=a,this.length=1;
return this;
}
if(typeof a=="string"){
a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];
if(g&&(g[1]||!d)){
if(g[1]){
d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);
return e.merge(this,a);
}
h=c.getElementById(g[2]);
if(h&&h.parentNode){
if(h.id!==g[2]){
return f.find(a);
}
this.length=1,this[0]=h;
}
this.context=c,this.selector=a;
return this;
}
return !d||d.jquery?(d||f).find(a):this.constructor(d).find(a);
}
if(e.isFunction(a)){
return f.ready(a);
}
a.selector!==b&&(this.selector=a.selector,this.context=a.context);
return e.makeArray(a,this);
},selector:"",jquery:"1.7",length:0,size:function(){
return this.length;
},toArray:function(){
return G.call(this,0);
},get:function(a){
return a==null?this.toArray():a<0?this[this.length+a]:this[a];
},pushStack:function(a,b,c){
var d=this.constructor();
e.isArray(a)?F.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");
return d;
},each:function(a,b){
return e.each(this,a,b);
},ready:function(a){
e.bindReady(),B.add(a);
return this;
},eq:function(a){
return a===-1?this.slice(a):this.slice(a,+a+1);
},first:function(){
return this.eq(0);
},last:function(){
return this.eq(-1);
},slice:function(){
return this.pushStack(G.apply(this,arguments),"slice",G.call(arguments).join(","));
},map:function(a){
return this.pushStack(e.map(this,function(b,c){
return a.call(b,c,b);
}));
},end:function(){
return this.prevObject||this.constructor(null);
},push:F,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){
var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;
typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);
for(;j<k;j++){
if((a=arguments[j])!=null){
for(c in a){
d=i[c],f=a[c];
if(i===f){
continue;
}
l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f);
}
}
}
return i;
},e.extend({noConflict:function(b){
a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);
return e;
},isReady:!1,readyWait:1,holdReady:function(a){
a?e.readyWait++:e.ready(!0);
},ready:function(a){
if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){
if(!c.body){
return setTimeout(e.ready,1);
}
e.isReady=!0;
if(a!==!0&&--e.readyWait>0){
return;
}
B.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready");
}
},bindReady:function(){
if(!B){
B=e.Callbacks("once memory");
if(c.readyState==="complete"){
return setTimeout(e.ready,1);
}
if(c.addEventListener){
c.addEventListener("DOMContentLoaded",C,!1),a.addEventListener("load",e.ready,!1);
}else{
if(c.attachEvent){
c.attachEvent("onreadystatechange",C),a.attachEvent("onload",e.ready);
var b=!1;
try{
b=a.frameElement==null;
}
catch(d){
}
c.documentElement.doScroll&&b&&K();
}
}
}
},isFunction:function(a){
return e.type(a)==="function";
},isArray:Array.isArray||function(a){
return e.type(a)==="array";
},isWindow:function(a){
return a&&typeof a=="object"&&"setInterval" in a;
},isNumeric:function(a){
return a!=null&&m.test(a)&&!isNaN(a);
},type:function(a){
return a==null?String(a):J[D.call(a)]||"object";
},isPlainObject:function(a){
if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)){
return !1;
}
try{
if(a.constructor&&!E.call(a,"constructor")&&!E.call(a.constructor.prototype,"isPrototypeOf")){
return !1;
}
}
catch(c){
return !1;
}
var d;
for(d in a){
}
return d===b||E.call(a,d);
},isEmptyObject:function(a){
for(var b in a){
return !1;
}
return !0;
},error:function(a){
throw a;
},parseJSON:function(b){
if(typeof b!="string"||!b){
return null;
}
b=e.trim(b);
if(a.JSON&&a.JSON.parse){
return a.JSON.parse(b);
}
if(o.test(b.replace(p,"@").replace(q,"]").replace(r,""))){
return (new Function("return "+b))();
}
e.error("Invalid JSON: "+b);
},parseXML:function(c){
var d,f;
try{
a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c));
}
catch(g){
d=b;
}
(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);
return d;
},noop:function(){
},globalEval:function(b){
b&&j.test(b)&&(a.execScript||function(b){
a.eval.call(a,b);
})(b);
},camelCase:function(a){
return a.replace(x,"ms-").replace(w,y);
},nodeName:function(a,b){
return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase();
},each:function(a,c,d){
var f,g=0,h=a.length,i=h===b||e.isFunction(a);
if(d){
if(i){
for(f in a){
if(c.apply(a[f],d)===!1){
break;
}
}
}else{
for(;g<h;){
if(c.apply(a[g++],d)===!1){
break;
}
}
}
}else{
if(i){
for(f in a){
if(c.call(a[f],f,a[f])===!1){
break;
}
}
}else{
for(;g<h;){
if(c.call(a[g],g,a[g++])===!1){
break;
}
}
}
}
return a;
},trim:H?function(a){
return a==null?"":H.call(a);
}:function(a){
return a==null?"":(a+"").replace(k,"").replace(l,"");
},makeArray:function(a,b){
var c=b||[];
if(a!=null){
var d=e.type(a);
a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?F.call(c,a):e.merge(c,a);
}
return c;
},inArray:function(a,b,c){
var d;
if(b){
if(I){
return I.call(b,a,c);
}
d=b.length,c=c?c<0?Math.max(0,d+c):c:0;
for(;c<d;c++){
if(c in b&&b[c]===a){
return c;
}
}
}
return -1;
},merge:function(a,c){
var d=a.length,e=0;
if(typeof c.length=="number"){
for(var f=c.length;e<f;e++){
a[d++]=c[e];
}
}else{
while(c[e]!==b){
a[d++]=c[e++];
}
}
a.length=d;
return a;
},grep:function(a,b,c){
var d=[],e;
c=!!c;
for(var f=0,g=a.length;f<g;f++){
e=!!b(a[f],f),c!==e&&d.push(a[f]);
}
return d;
},map:function(a,c,d){
var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));
if(k){
for(;i<j;i++){
f=c(a[i],i,d),f!=null&&(h[h.length]=f);
}
}else{
for(g in a){
f=c(a[g],g,d),f!=null&&(h[h.length]=f);
}
}
return h.concat.apply([],h);
},guid:1,proxy:function(a,c){
if(typeof c=="string"){
var d=a[c];
c=a,a=d;
}
if(!e.isFunction(a)){
return b;
}
var f=G.call(arguments,2),g=function(){
return a.apply(c,f.concat(G.call(arguments)));
};
g.guid=a.guid=a.guid||g.guid||e.guid++;
return g;
},access:function(a,c,d,f,g,h){
var i=a.length;
if(typeof c=="object"){
for(var j in c){
e.access(a,j,c[j],f,g,d);
}
return a;
}
if(d!==b){
f=!h&&f&&e.isFunction(d);
for(var k=0;k<i;k++){
g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);
}
return a;
}
return i?g(a[0],c):b;
},now:function(){
return (new Date).getTime();
},uaMatch:function(a){
a=a.toLowerCase();
var b=s.exec(a)||t.exec(a)||u.exec(a)||a.indexOf("compatible")<0&&v.exec(a)||[];
return {browser:b[1]||"",version:b[2]||"0"};
},sub:function(){
function a(b,c){
return new a.fn.init(b,c);
}
e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){
f&&f instanceof e&&!(f instanceof a)&&(f=a(f));
return e.fn.init.call(this,d,f,b);
},a.fn.init.prototype=a.fn;
var b=a(c);
return a;
},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){
J["[object "+b+"]"]=b.toLowerCase();
}),A=e.uaMatch(z),A.browser&&(e.browser[A.browser]=!0,e.browser.version=A.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?C=function(){
c.removeEventListener("DOMContentLoaded",C,!1),e.ready();
}:c.attachEvent&&(C=function(){
c.readyState==="complete"&&(c.detachEvent("onreadystatechange",C),e.ready());
}),typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){
return e;
});
return e;
}(),g={};
f.Callbacks=function(a){
a=a?g[a]||h(a):{};
var c=[],d=[],e,i,j,k,l,m=function(b){
var d,e,g,h,i;
for(d=0,e=b.length;d<e;d++){
g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g);
}
},n=function(b,f){
f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;
for(;c&&l<k;l++){
if(c[l].apply(b,f)===!1&&a.stopOnFalse){
e=!0;
break;
}
}
i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])));
},o={add:function(){
if(c){
var a=c.length;
m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]));
}
return this;
},remove:function(){
if(c){
var b=arguments,d=0,e=b.length;
for(;d<e;d++){
for(var f=0;f<c.length;f++){
if(b[d]===c[f]){
i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);
if(a.unique){
break;
}
}
}
}
}
return this;
},has:function(a){
if(c){
var b=0,d=c.length;
for(;b<d;b++){
if(a===c[b]){
return !0;
}
}
}
return !1;
},empty:function(){
c=[];
return this;
},disable:function(){
c=d=e=b;
return this;
},disabled:function(){
return !c;
},lock:function(){
d=b,(!e||e===!0)&&o.disable();
return this;
},locked:function(){
return !d;
},fireWith:function(b,c){
d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));
return this;
},fire:function(){
o.fireWith(this,arguments);
return this;
},fired:function(){
return !!e;
}};
return o;
};
var i=[].slice;
f.extend({Deferred:function(a){
var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){
return e;
},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){
i.done(a).fail(b).progress(c);
return this;
},always:function(){
return i.done.apply(i,arguments).fail.apply(i,arguments);
},pipe:function(a,b,c){
return f.Deferred(function(d){
f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){
var c=b[0],e=b[1],g;
f.isFunction(c)?i[a](function(){
g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g]);
}):i[a](d[e]);
});
}).promise();
},promise:function(a){
if(a==null){
a=h;
}else{
for(var b in h){
a[b]=h[b];
}
}
return a;
}},i=h.promise({}),j;
for(j in g){
i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;
}
i.done(function(){
e="resolved";
},c.disable,d.lock).fail(function(){
e="rejected";
},b.disable,d.lock),a&&a.call(i,i);
return i;
},when:function(a){
function m(a){
return function(b){
e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e);
};
}
function l(a){
return function(c){
b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b);
};
}
var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();
if(d>1){
for(;c<d;c++){
b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;
}
g||j.resolveWith(j,b);
}else{
j!==a&&j.resolveWith(j,d?[a]:[]);
}
return k;
}}),f.support=function(){
var a=c.createElement("div"),b=c.documentElement,d,e,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u;
a.setAttribute("className","t"),a.innerHTML="   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/><nav></nav>",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];
if(!d||!d.length||!e){
return {};
}
g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,unknownElems:!!a.getElementsByTagName("nav").length,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",enctype:!!c.createElement("form").enctype,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;
try{
delete a.test;
}
catch(v){
k.deleteExpando=!1;
}
!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){
k.noCloneEvent=!1;
}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.lastChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},m&&f.extend(p,{position:"absolute",left:"-999px",top:"-999px"});
for(t in p){
o.style[t]=p[t];
}
o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom" in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);
if(a.attachEvent){
for(t in {submit:1,change:1,focusin:1}){
s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;
}
}
f(function(){
var a,b,d,e,g,h,i=1,j="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",l="visibility:hidden;border:0;",n="style='"+j+"border:5px solid #000;padding:0;'",p="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>";
m=c.getElementsByTagName("body")[0];
!m||(a=c.createElement("div"),a.style.cssText=l+"width:0;height:0;position:static;top:0;margin-top:"+i+"px",m.insertBefore(a,m.firstChild),o=c.createElement("div"),o.style.cssText=j+l,o.innerHTML=p,a.appendChild(o),b=o.firstChild,d=b.firstChild,g=b.nextSibling.firstChild.firstChild,h={doesNotAddBorder:d.offsetTop!==5,doesAddBorderForTableAndCells:g.offsetTop===5},d.style.position="fixed",d.style.top="20px",h.fixedPosition=d.offsetTop===20||d.offsetTop===15,d.style.position=d.style.top="",b.style.overflow="hidden",b.style.position="relative",h.subtractsBorderForOverflowNotVisible=d.offsetTop===-5,h.doesNotIncludeMarginInBodyOffset=m.offsetTop!==i,m.removeChild(a),o=a=null,f.extend(k,h));
}),o.innerHTML="",n.removeChild(o),o=l=g=h=m=j=a=i=null;
return k;
}(),f.boxModel=f.support.boxModel;
var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;
f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){
a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];
return !!a&&!m(a);
},data:function(a,c,d,e){
if(!!f.acceptData(a)){
var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[f.expando]:a[f.expando]&&f.expando,o=c==="events";
if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b){
return;
}
n||(l?a[f.expando]=n=++f.uuid:n=f.expando),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));
if(typeof c=="object"||typeof c=="function"){
e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);
}
g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);
if(o&&!h[c]){
return g.events;
}
k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;
return i;
}
},removeData:function(a,b,c){
if(!!f.acceptData(a)){
var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[f.expando]:f.expando;
if(!j[k]){
return;
}
if(b){
d=c?j[k]:j[k].data;
if(d){
f.isArray(b)?b=b:b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" "));
for(e=0,g=b.length;e<g;e++){
delete d[b[e]];
}
if(!(c?m:f.isEmptyObject)(d)){
return;
}
}
}
if(!c){
delete j[k].data;
if(!m(j[k])){
return;
}
}
f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[f.expando]:a.removeAttribute?a.removeAttribute(f.expando):a[f.expando]=null);
}
},_data:function(a,b,c){
return f.data(a,b,c,!0);
},acceptData:function(a){
if(a.nodeName){
var b=f.noData[a.nodeName.toLowerCase()];
if(b){
return b!==!0&&a.getAttribute("classid")===b;
}
}
return !0;
}}),f.fn.extend({data:function(a,c){
var d,e,g,h=null;
if(typeof a=="undefined"){
if(this.length){
h=f.data(this[0]);
if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){
e=this[0].attributes;
for(var i=0,j=e.length;i<j;i++){
g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));
}
f._data(this[0],"parsedAttrs",!0);
}
}
return h;
}
if(typeof a=="object"){
return this.each(function(){
f.data(this,a);
});
}
d=a.split("."),d[1]=d[1]?"."+d[1]:"";
if(c===b){
h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));
return h===b&&d[1]?this.data(d[0]):h;
}
return this.each(function(){
var b=f(this),e=[d[0],c];
b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e);
});
},removeData:function(a){
return this.each(function(){
f.removeData(this,a);
});
}}),f.extend({_mark:function(a,b){
a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1));
},_unmark:function(a,b,c){
a!==!0&&(c=b,b=a,a=!1);
if(b){
c=c||"fx";
var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;
e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"));
}
},queue:function(a,b,c){
var d;
if(a){
b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));
return d||[];
}
},dequeue:function(a,b){
b=b||"fx";
var c=f.queue(a,b),d=c.shift(),e={};
d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){
f.dequeue(a,b);
},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"));
}}),f.fn.extend({queue:function(a,c){
typeof a!="string"&&(c=a,a="fx");
if(c===b){
return f.queue(this[0],a);
}
return this.each(function(){
var b=f.queue(this,a,c);
a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a);
});
},dequeue:function(a){
return this.each(function(){
f.dequeue(this,a);
});
},delay:function(a,b){
a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";
return this.queue(b,function(b,c){
var d=setTimeout(b,a);
c.stop=function(){
clearTimeout(d);
};
});
},clearQueue:function(a){
return this.queue(a||"fx",[]);
},promise:function(a,c){
function m(){
--h||d.resolveWith(e,[e]);
}
typeof a!="string"&&(c=a,a=b),a=a||"fx";
var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;
while(g--){
if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0)){
h++,l.add(m);
}
}
m();
return d.promise();
}});
var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;
f.fn.extend({attr:function(a,b){
return f.access(this,a,b,!0,f.attr);
},removeAttr:function(a){
return this.each(function(){
f.removeAttr(this,a);
});
},prop:function(a,b){
return f.access(this,a,b,!0,f.prop);
},removeProp:function(a){
a=f.propFix[a]||a;
return this.each(function(){
try{
this[a]=b,delete this[a];
}
catch(c){
}
});
},addClass:function(a){
var b,c,d,e,g,h,i;
if(f.isFunction(a)){
return this.each(function(b){
f(this).addClass(a.call(this,b,this.className));
});
}
if(a&&typeof a=="string"){
b=a.split(p);
for(c=0,d=this.length;c<d;c++){
e=this[c];
if(e.nodeType===1){
if(!e.className&&b.length===1){
e.className=a;
}else{
g=" "+e.className+" ";
for(h=0,i=b.length;h<i;h++){
~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");
}
e.className=f.trim(g);
}
}
}
}
return this;
},removeClass:function(a){
var c,d,e,g,h,i,j;
if(f.isFunction(a)){
return this.each(function(b){
f(this).removeClass(a.call(this,b,this.className));
});
}
if(a&&typeof a=="string"||a===b){
c=(a||"").split(p);
for(d=0,e=this.length;d<e;d++){
g=this[d];
if(g.nodeType===1&&g.className){
if(a){
h=(" "+g.className+" ").replace(o," ");
for(i=0,j=c.length;i<j;i++){
h=h.replace(" "+c[i]+" "," ");
}
g.className=f.trim(h);
}else{
g.className="";
}
}
}
}
return this;
},toggleClass:function(a,b){
var c=typeof a,d=typeof b=="boolean";
if(f.isFunction(a)){
return this.each(function(c){
f(this).toggleClass(a.call(this,c,this.className,b),b);
});
}
return this.each(function(){
if(c==="string"){
var e,g=0,h=f(this),i=b,j=a.split(p);
while(e=j[g++]){
i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e);
}
}else{
if(c==="undefined"||c==="boolean"){
this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||"";
}
}
});
},hasClass:function(a){
var b=" "+a+" ",c=0,d=this.length;
for(;c<d;c++){
if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1){
return !0;
}
}
return !1;
},val:function(a){
var c,d,e,g=this[0];
if(!arguments.length){
if(g){
c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];
if(c&&"get" in c&&(d=c.get(g,"value"))!==b){
return d;
}
d=g.value;
return typeof d=="string"?d.replace(q,""):d==null?"":d;
}
return b;
}
e=f.isFunction(a);
return this.each(function(d){
var g=f(this),h;
if(this.nodeType===1){
e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){
return a==null?"":a+"";
})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];
if(!c||!("set" in c)||c.set(this,h,"value")===b){
this.value=h;
}
}
});
}}),f.extend({valHooks:{option:{get:function(a){
var b=a.attributes.value;
return !b||b.specified?a.value:a.text;
}},select:{get:function(a){
var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";
if(g<0){
return null;
}
c=j?g:0,d=j?g+1:i.length;
for(;c<d;c++){
e=i[c];
if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){
b=f(e).val();
if(j){
return b;
}
h.push(b);
}
}
if(j&&!h.length&&i.length){
return f(i[g]).val();
}
return h;
},set:function(a,b){
var c=f.makeArray(b);
f(a).find("option").each(function(){
this.selected=f.inArray(f(this).val(),c)>=0;
}),c.length||(a.selectedIndex=-1);
return c;
}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){
var g,h,i,j=a.nodeType;
if(!a||j===3||j===8||j===2){
return b;
}
if(e&&c in f.attrFn){
return f(a)[c](d);
}
if(!("getAttribute" in a)){
return f.prop(a,c,d);
}
i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));
if(d!==b){
if(d===null){
f.removeAttr(a,c);
return b;
}
if(h&&"set" in h&&i&&(g=h.set(a,d,c))!==b){
return g;
}
a.setAttribute(c,""+d);
return d;
}
if(h&&"get" in h&&i&&(g=h.get(a,c))!==null){
return g;
}
g=a.getAttribute(c);
return g===null?b:g;
},removeAttr:function(a,b){
var c,d,e,g,h=0;
if(a.nodeType===1){
d=(b||"").split(p),g=d.length;
for(;h<g;h++){
e=d[h].toLowerCase(),c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1);
}
}
},attrHooks:{type:{set:function(a,b){
if(r.test(a.nodeName)&&a.parentNode){
f.error("type property can't be changed");
}else{
if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){
var c=a.value;
a.setAttribute("type",b),c&&(a.value=c);
return b;
}
}
}},value:{get:function(a,b){
if(w&&f.nodeName(a,"button")){
return w.get(a,b);
}
return b in a?a.value:null;
},set:function(a,b,c){
if(w&&f.nodeName(a,"button")){
return w.set(a,b,c);
}
a.value=b;
}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){
var e,g,h,i=a.nodeType;
if(!a||i===3||i===8||i===2){
return b;
}
h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);
return d!==b?g&&"set" in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get" in g&&(e=g.get(a,c))!==null?e:a[c];
},propHooks:{tabIndex:{get:function(a){
var c=a.getAttributeNode("tabindex");
return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b;
}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){
var d,e=f.prop(a,c);
return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b;
},set:function(a,b,c){
var d;
b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));
return c;
}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){
var d;
d=a.getAttributeNode(c);
return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b;
},set:function(a,b,d){
var e=a.getAttributeNode(d);
e||(e=c.createAttribute(d),a.setAttributeNode(e));
return e.nodeValue=b+"";
}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){
f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){
if(c===""){
a.setAttribute(b,"auto");
return c;
}
}});
}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){
b===""&&(b="false"),w.set(a,b,c);
}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){
f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){
var d=a.getAttribute(c,2);
return d===null?b:d;
}});
}),f.support.style||(f.attrHooks.style={get:function(a){
return a.style.cssText.toLowerCase()||b;
},set:function(a,b){
return a.style.cssText=""+b;
}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){
var b=a.parentNode;
b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);
return null;
}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){
f.valHooks[this]={get:function(a){
return a.getAttribute("value")===null?"on":a.value;
}};
}),f.each(["radio","checkbox"],function(){
f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){
if(f.isArray(b)){
return a.checked=f.inArray(f(a).val(),b)>=0;
}
}});
});
var z=/\.(.*)$/,A=/^(?:textarea|input|select)$/i,B=/\./g,C=/ /g,D=/[^\w\s.|`]/g,E=/^([^\.]*)?(?:\.(.+))?$/,F=/\bhover(\.\S+)?/,G=/^key/,H=/^(?:mouse|contextmenu)|click/,I=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,J=function(a){
var b=I.exec(a);
b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));
return b;
},K=function(a,b){
return (!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||a.id===b[2])&&(!b[3]||b[3].test(a.className));
},L=function(a){
return f.event.special.hover?a:a.replace(F,"mouseenter$1 mouseleave$1");
};
f.event={add:function(a,c,d,e,g){
var h,i,j,k,l,m,n,o,p,q,r,s;
if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){
d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){
return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b;
},i.elem=a),c=L(c).split(" ");
for(k=0;k<c.length;k++){
l=E.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,namespace:n.join(".")},p),g&&(o.quick=J(g),!o.quick&&f.expr.match.POS.test(g)&&(o.isPositional=!0)),r=j[m];
if(!r){
r=j[m]=[],r.delegateCount=0;
if(!s.setup||s.setup.call(a,e,n,i)===!1){
a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i);
}
}
s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0;
}
a=null;
}
},global:{},remove:function(a,b,c,d){
var e=f.hasData(a)&&f._data(a),g,h,i,j,k,l,m,n,o,p,q;
if(!!e&&!!(m=e.events)){
b=L(b||"").split(" ");
for(g=0;g<b.length;g++){
h=E.exec(b[g])||[],i=h[1],j=h[2];
if(!i){
j=j?"."+j:"";
for(l in m){
f.event.remove(a,l+j,c,d);
}
return;
}
n=f.event.special[i]||{},i=(d?n.delegateType:n.bindType)||i,p=m[i]||[],k=p.length,j=j?new RegExp("(^|\\.)"+j.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;
if(c||j||d||n.remove){
for(l=0;l<p.length;l++){
q=p[l];
if(!c||c.guid===q.guid){
if(!j||j.test(q.namespace)){
if(!d||d===q.selector||d==="**"&&q.selector){
p.splice(l--,1),q.selector&&p.delegateCount--,n.remove&&n.remove.call(a,q);
}
}
}
}
}else{
p.length=0;
}
p.length===0&&k!==p.length&&((!n.teardown||n.teardown.call(a,j)===!1)&&f.removeEvent(a,i,e.handle),delete m[i]);
}
f.isEmptyObject(m)&&(o=e.handle,o&&(o.elem=null),f.removeData(a,["events","handle"],!0));
}
},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){
if(!e||e.nodeType!==3&&e.nodeType!==8){
var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;
h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());
if((!e||f.event.customEvent[h])&&!f.event.global[h]){
return;
}
c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"",(g||!e)&&c.preventDefault();
if(!e){
j=f.cache;
for(l in j){
j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);
}
return;
}
c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};
if(p.trigger&&p.trigger.apply(e,d)===!1){
return;
}
r=[[e,p.bindType||h]];
if(!g&&!p.noBubble&&!f.isWindow(e)){
s=p.delegateType||h,n=null;
for(m=e.parentNode;m;m=m.parentNode){
r.push([m,s]),n=m;
}
n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s]);
}
for(l=0;l<r.length;l++){
m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d);
if(c.isPropagationStopped()){
break;
}
}
c.type=h,c.isDefaultPrevented()||(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));
return c.result;
}
},dispatch:function(c){
c=f.event.fix(c||a.event);
var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=(f.event.special[c.type]||{}).handle,j=[],k,l,m,n,o,p,q,r,s,t,u;
g[0]=c,c.delegateTarget=this;
if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){
for(m=c.target;m!=this;m=m.parentNode||this){
o={},q=[];
for(k=0;k<e;k++){
r=d[k],s=r.selector,t=o[s],r.isPositional?t=(t||(o[s]=f(s))).index(m)>=0:t===b&&(t=o[s]=r.quick?K(m,r.quick):f(m).is(s)),t&&q.push(r);
}
q.length&&j.push({elem:m,matches:q});
}
}
d.length>e&&j.push({elem:this,matches:d.slice(e)});
for(k=0;k<j.length&&!c.isPropagationStopped();k++){
p=j[k],c.currentTarget=p.elem;
for(l=0;l<p.matches.length&&!c.isImmediatePropagationStopped();l++){
r=p.matches[l];
if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace)){
c.data=r.data,c.handleObj=r,n=(i||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()));
}
}
}
return c.result;
},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){
a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);
return a;
}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "),filter:function(a,d){
var e,f,g,h=d.button,i=d.fromElement;
a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);
return a;
}},fix:function(a){
if(a[f.expando]){
return a;
}
var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;
a=f.Event(g);
for(d=i.length;d;){
e=i[--d],a[e]=g[e];
}
a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);
return h.filter?h.filter(a,g):a;
},special:{ready:{setup:f.bindReady},focus:{delegateType:"focusin",noBubble:!0},blur:{delegateType:"focusout",noBubble:!0},beforeunload:{setup:function(a,b,c){
f.isWindow(this)&&(this.onbeforeunload=c);
},teardown:function(a,b){
this.onbeforeunload===b&&(this.onbeforeunload=null);
}}},simulate:function(a,b,c,d){
var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});
d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault();
}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){
a.removeEventListener&&a.removeEventListener(b,c,!1);
}:function(a,b,c){
a.detachEvent&&a.detachEvent("on"+b,c);
},f.Event=function(a,b){
if(!(this instanceof f.Event)){
return new f.Event(a,b);
}
a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?N:M):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0;
},f.Event.prototype={preventDefault:function(){
this.isDefaultPrevented=N;
var a=this.originalEvent;
!a||(a.preventDefault?a.preventDefault():a.returnValue=!1);
},stopPropagation:function(){
this.isPropagationStopped=N;
var a=this.originalEvent;
!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0);
},stopImmediatePropagation:function(){
this.isImmediatePropagationStopped=N,this.stopPropagation();
},isDefaultPrevented:M,isPropagationStopped:M,isImmediatePropagationStopped:M},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){
f.event.special[a]=f.event.special[b]={delegateType:b,bindType:b,handle:function(a){
var b=this,c=a.relatedTarget,d=a.handleObj,e=d.selector,g,h;
if(!c||d.origType===a.type||c!==b&&!f.contains(b,c)){
g=a.type,a.type=d.origType,h=d.handler.apply(this,arguments),a.type=g;
}
return h;
}};
}),f.support.submitBubbles||(f.event.special.submit={setup:function(){
if(f.nodeName(this,"form")){
return !1;
}
f.event.add(this,"click._submit keypress._submit",function(a){
var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;
d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){
this.parentNode&&f.event.simulate("submit",this.parentNode,a,!0);
}),d._submit_attached=!0);
});
},teardown:function(){
if(f.nodeName(this,"form")){
return !1;
}
f.event.remove(this,"._submit");
}}),f.support.changeBubbles||(f.event.special.change={setup:function(){
if(A.test(this.nodeName)){
if(this.type==="checkbox"||this.type==="radio"){
f.event.add(this,"propertychange._change",function(a){
a.originalEvent.propertyName==="checked"&&(this._just_changed=!0);
}),f.event.add(this,"click._change",function(a){
this._just_changed&&(this._just_changed=!1,f.event.simulate("change",this,a,!0));
});
}
return !1;
}
f.event.add(this,"beforeactivate._change",function(a){
var b=a.target;
A.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){
this.parentNode&&!a.isSimulated&&f.event.simulate("change",this.parentNode,a,!0);
}),b._change_attached=!0);
});
},handle:function(a){
var b=a.target;
if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox"){
return a.handleObj.handler.apply(this,arguments);
}
},teardown:function(){
f.event.remove(this,"._change");
return A.test(this.nodeName);
}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){
var d=0,e=function(a){
f.event.simulate(b,a.target,f.event.fix(a),!0);
};
f.event.special[b]={setup:function(){
d++===0&&c.addEventListener(a,e,!0);
},teardown:function(){
--d===0&&c.removeEventListener(a,e,!0);
}};
}),f.fn.extend({on:function(a,c,d,e,g){
var h,i;
if(typeof a=="object"){
typeof c!="string"&&(d=c,c=b);
for(i in a){
this.on(i,c,d,a[i],g);
}
return this;
}
d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));
if(e===!1){
e=M;
}else{
if(!e){
return this;
}
}
g===1&&(h=e,e=function(a){
f().off(a);
return h.apply(this,arguments);
},e.guid=h.guid||(h.guid=f.guid++));
return this.each(function(){
f.event.add(this,a,e,d,c);
});
},one:function(a,b,c,d){
return this.on.call(this,a,b,c,d,1);
},off:function(a,c,d){
if(a&&a.preventDefault&&a.handleObj){
var e=a.handleObj;
f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);
return this;
}
if(typeof a=="object"){
for(var g in a){
this.off(g,c,a[g]);
}
return this;
}
if(c===!1||typeof c=="function"){
d=c,c=b;
}
d===!1&&(d=M);
return this.each(function(){
f.event.remove(this,a,d,c);
});
},bind:function(a,b,c){
return this.on(a,null,b,c);
},unbind:function(a,b){
return this.off(a,null,b);
},live:function(a,b,c){
f(this.context).on(a,this.selector,b,c);
return this;
},die:function(a,b){
f(this.context).off(a,this.selector||"**",b);
return this;
},delegate:function(a,b,c,d){
return this.on(b,a,c,d);
},undelegate:function(a,b,c){
return arguments.length==1?this.off(a,"**"):this.off(b,a,c);
},trigger:function(a,b){
return this.each(function(){
f.event.trigger(a,b,this);
});
},triggerHandler:function(a,b){
if(this[0]){
return f.event.trigger(a,b,this[0],!0);
}
},toggle:function(a){
var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){
var e=(f._data(this,"lastToggle"+a.guid)||0)%d;
f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();
return b[e].apply(this,arguments)||!1;
};
e.guid=c;
while(d<b.length){
b[d++].guid=c;
}
return this.click(e);
},hover:function(a,b){
return this.mouseenter(a).mouseleave(b||a);
}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){
f.fn[b]=function(a,c){
c==null&&(c=a,a=null);
return arguments.length>0?this.bind(b,a,c):this.trigger(b);
},f.attrFn&&(f.attrFn[b]=!0),G.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),H.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks);
}),function(){
function x(a,b,c,e,f,g){
for(var h=0,i=e.length;h<i;h++){
var j=e[h];
if(j){
var k=!1;
j=j[a];
while(j){
if(j[d]===c){
k=e[j.sizset];
break;
}
if(j.nodeType===1){
g||(j[d]=c,j.sizset=h);
if(typeof b!="string"){
if(j===b){
k=!0;
break;
}
}else{
if(m.filter(b,[j]).length>0){
k=j;
break;
}
}
}
j=j[a];
}
e[h]=k;
}
}
}
function w(a,b,c,e,f,g){
for(var h=0,i=e.length;h<i;h++){
var j=e[h];
if(j){
var k=!1;
j=j[a];
while(j){
if(j[d]===c){
k=e[j.sizset];
break;
}
j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);
if(j.nodeName.toLowerCase()===b){
k=j;
break;
}
j=j[a];
}
e[h]=k;
}
}
}
var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;
[0,0].sort(function(){
i=!1;
return 0;
});
var m=function(b,d,e,f){
e=e||[],d=d||c;
var h=d;
if(d.nodeType!==1&&d.nodeType!==9){
return [];
}
if(!b||typeof b!="string"){
return e;
}
var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;
do{
a.exec(""),i=a.exec(x);
if(i){
x=i[3],w.push(i[1]);
if(i[2]){
l=i[3];
break;
}
}
}while(i);
if(w.length>1&&p.exec(b)){
if(w.length===2&&o.relative[w[0]]){
j=y(w[0]+w[1],d,f);
}else{
j=o.relative[w[0]]?[d]:m(w.shift(),d);
while(w.length){
b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f);
}
}
}else{
!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);
if(d){
n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;
while(w.length){
q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v);
}
}else{
k=w=[];
}
}
k||(k=j),k||m.error(q||b);
if(g.call(k)==="[object Array]"){
if(!u){
e.push.apply(e,k);
}else{
if(d&&d.nodeType===1){
for(t=0;k[t]!=null;t++){
k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);
}
}else{
for(t=0;k[t]!=null;t++){
k[t]&&k[t].nodeType===1&&e.push(j[t]);
}
}
}
}else{
s(k,e);
}
l&&(m(l,h,e,f),m.uniqueSort(e));
return e;
};
m.uniqueSort=function(a){
if(u){
h=i,a.sort(u);
if(h){
for(var b=1;b<a.length;b++){
a[b]===a[b-1]&&a.splice(b--,1);
}
}
}
return a;
},m.matches=function(a,b){
return m(a,null,null,b);
},m.matchesSelector=function(a,b){
return m(b,null,null,[a]).length>0;
},m.find=function(a,b,c){
var d,e,f,g,h,i;
if(!a){
return [];
}
for(e=0,f=o.order.length;e<f;e++){
h=o.order[e];
if(g=o.leftMatch[h].exec(a)){
i=g[1],g.splice(1,1);
if(i.substr(i.length-1)!=="\\"){
g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);
if(d!=null){
a=a.replace(o.match[h],"");
break;
}
}
}
}
d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);
return {set:d,expr:a};
},m.filter=function(a,c,d,e){
var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);
while(a&&c.length){
for(h in o.filter){
if((f=o.leftMatch[h].exec(a))!=null&&f[2]){
k=o.filter[h],l=f[1],g=!1,f.splice(1,1);
if(l.substr(l.length-1)==="\\"){
continue;
}
s===r&&(r=[]);
if(o.preFilter[h]){
f=o.preFilter[h](f,s,d,r,e,t);
if(!f){
g=i=!0;
}else{
if(f===!0){
continue;
}
}
}
if(f){
for(n=0;(j=s[n])!=null;n++){
j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));
}
}
if(i!==b){
d||(s=r),a=a.replace(o.match[h],"");
if(!g){
return [];
}
break;
}
}
}
if(a===q){
if(g==null){
m.error(a);
}else{
break;
}
}
q=a;
}
return s;
},m.error=function(a){
throw "Syntax error, unrecognized expression: "+a;
};
var n=m.getText=function(a){
var b,c,d=a.nodeType,e="";
if(d){
if(d===1){
if(typeof a.textContent=="string"){
return a.textContent;
}
if(typeof a.innerText=="string"){
return a.innerText.replace(k,"");
}
for(a=a.firstChild;a;a=a.nextSibling){
e+=n(a);
}
}else{
if(d===3||d===4){
return a.nodeValue;
}
}
}else{
for(b=0;c=a[b];b++){
c.nodeType!==8&&(e+=n(c));
}
}
return e;
},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){
return a.getAttribute("href");
},type:function(a){
return a.getAttribute("type");
}},relative:{"+":function(a,b){
var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;
d&&(b=b.toLowerCase());
for(var f=0,g=a.length,h;f<g;f++){
if(h=a[f]){
while((h=h.previousSibling)&&h.nodeType!==1){
}
a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b;
}
}
e&&m.filter(b,a,!0);
},">":function(a,b){
var c,d=typeof b=="string",e=0,f=a.length;
if(d&&!l.test(b)){
b=b.toLowerCase();
for(;e<f;e++){
c=a[e];
if(c){
var g=c.parentNode;
a[e]=g.nodeName.toLowerCase()===b?g:!1;
}
}
}else{
for(;e<f;e++){
c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);
}
d&&m.filter(b,a,!0);
}
},"":function(a,b,c){
var d,f=e++,g=x;
typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c);
},"~":function(a,b,c){
var d,f=e++,g=x;
typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c);
}},find:{ID:function(a,b,c){
if(typeof b.getElementById!="undefined"&&!c){
var d=b.getElementById(a[1]);
return d&&d.parentNode?[d]:[];
}
},NAME:function(a,b){
if(typeof b.getElementsByName!="undefined"){
var c=[],d=b.getElementsByName(a[1]);
for(var e=0,f=d.length;e<f;e++){
d[e].getAttribute("name")===a[1]&&c.push(d[e]);
}
return c.length===0?null:c;
}
},TAG:function(a,b){
if(typeof b.getElementsByTagName!="undefined"){
return b.getElementsByTagName(a[1]);
}
}},preFilter:{CLASS:function(a,b,c,d,e,f){
a=" "+a[1].replace(j,"")+" ";
if(f){
return a;
}
for(var g=0,h;(h=b[g])!=null;g++){
h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));
}
return !1;
},ID:function(a){
return a[1].replace(j,"");
},TAG:function(a,b){
return a[1].replace(j,"").toLowerCase();
},CHILD:function(a){
if(a[1]==="nth"){
a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");
var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);
a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0;
}else{
a[2]&&m.error(a[0]);
}
a[0]=e++;
return a;
},ATTR:function(a,b,c,d,e,f){
var g=a[1]=a[1].replace(j,"");
!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");
return a;
},PSEUDO:function(b,c,d,e,f){
if(b[1]==="not"){
if((a.exec(b[3])||"").length>1||/^\w/.test(b[3])){
b[3]=m(b[3],null,null,c);
}else{
var g=m.filter(b[3],c,d,!0^f);
d||e.push.apply(e,g);
return !1;
}
}else{
if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0])){
return !0;
}
}
return b;
},POS:function(a){
a.unshift(!0);
return a;
}},filters:{enabled:function(a){
return a.disabled===!1&&a.type!=="hidden";
},disabled:function(a){
return a.disabled===!0;
},checked:function(a){
return a.checked===!0;
},selected:function(a){
a.parentNode&&a.parentNode.selectedIndex;
return a.selected===!0;
},parent:function(a){
return !!a.firstChild;
},empty:function(a){
return !a.firstChild;
},has:function(a,b,c){
return !!m(c[3],a).length;
},header:function(a){
return /h\d/i.test(a.nodeName);
},text:function(a){
var b=a.getAttribute("type"),c=a.type;
return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null);
},radio:function(a){
return a.nodeName.toLowerCase()==="input"&&"radio"===a.type;
},checkbox:function(a){
return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type;
},file:function(a){
return a.nodeName.toLowerCase()==="input"&&"file"===a.type;
},password:function(a){
return a.nodeName.toLowerCase()==="input"&&"password"===a.type;
},submit:function(a){
var b=a.nodeName.toLowerCase();
return (b==="input"||b==="button")&&"submit"===a.type;
},image:function(a){
return a.nodeName.toLowerCase()==="input"&&"image"===a.type;
},reset:function(a){
var b=a.nodeName.toLowerCase();
return (b==="input"||b==="button")&&"reset"===a.type;
},button:function(a){
var b=a.nodeName.toLowerCase();
return b==="input"&&"button"===a.type||b==="button";
},input:function(a){
return /input|select|textarea|button/i.test(a.nodeName);
},focus:function(a){
return a===a.ownerDocument.activeElement;
}},setFilters:{first:function(a,b){
return b===0;
},last:function(a,b,c,d){
return b===d.length-1;
},even:function(a,b){
return b%2===0;
},odd:function(a,b){
return b%2===1;
},lt:function(a,b,c){
return b<c[3]-0;
},gt:function(a,b,c){
return b>c[3]-0;
},nth:function(a,b,c){
return c[3]-0===b;
},eq:function(a,b,c){
return c[3]-0===b;
}},filter:{PSEUDO:function(a,b,c,d){
var e=b[1],f=o.filters[e];
if(f){
return f(a,c,b,d);
}
if(e==="contains"){
return (a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;
}
if(e==="not"){
var g=b[3];
for(var h=0,i=g.length;h<i;h++){
if(g[h]===a){
return !1;
}
}
return !0;
}
m.error(e);
},CHILD:function(a,b){
var c,e,f,g,h,i,j,k=b[1],l=a;
switch(k){
case "only":
case "first":
while(l=l.previousSibling){
if(l.nodeType===1){
return !1;
}
}
if(k==="first"){
return !0;
}
l=a;
case "last":
while(l=l.nextSibling){
if(l.nodeType===1){
return !1;
}
}
return !0;
case "nth":
c=b[2],e=b[3];
if(c===1&&e===0){
return !0;
}
f=b[0],g=a.parentNode;
if(g&&(g[d]!==f||!a.nodeIndex)){
i=0;
for(l=g.firstChild;l;l=l.nextSibling){
l.nodeType===1&&(l.nodeIndex=++i);
}
g[d]=f;
}
j=a.nodeIndex-e;
return c===0?j===0:j%c===0&&j/c>=0;
}
},ID:function(a,b){
return a.nodeType===1&&a.getAttribute("id")===b;
},TAG:function(a,b){
return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b;
},CLASS:function(a,b){
return (" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1;
},ATTR:function(a,b){
var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];
return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1;
},POS:function(a,b,c,d){
var e=b[2],f=o.setFilters[e];
if(f){
return f(a,c,b,d);
}
}}},p=o.match.POS,q=function(a,b){
return "\\"+(b-0+1);
};
for(var r in o.match){
o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));
}
var s=function(a,b){
a=Array.prototype.slice.call(a,0);
if(b){
b.push.apply(b,a);
return b;
}
return a;
};
try{
Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType;
}
catch(t){
s=function(a,b){
var c=0,d=b||[];
if(g.call(a)==="[object Array]"){
Array.prototype.push.apply(d,a);
}else{
if(typeof a.length=="number"){
for(var e=a.length;c<e;c++){
d.push(a[c]);
}
}else{
for(;a[c];c++){
d.push(a[c]);
}
}
}
return d;
};
}
var u,v;
c.documentElement.compareDocumentPosition?u=function(a,b){
if(a===b){
h=!0;
return 0;
}
if(!a.compareDocumentPosition||!b.compareDocumentPosition){
return a.compareDocumentPosition?-1:1;
}
return a.compareDocumentPosition(b)&4?-1:1;
}:(u=function(a,b){
if(a===b){
h=!0;
return 0;
}
if(a.sourceIndex&&b.sourceIndex){
return a.sourceIndex-b.sourceIndex;
}
var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;
if(g===i){
return v(a,b);
}
if(!g){
return -1;
}
if(!i){
return 1;
}
while(j){
e.unshift(j),j=j.parentNode;
}
j=i;
while(j){
f.unshift(j),j=j.parentNode;
}
c=e.length,d=f.length;
for(var k=0;k<c&&k<d;k++){
if(e[k]!==f[k]){
return v(e[k],f[k]);
}
}
return k===c?v(a,f[k],-1):v(e[k],b,1);
},v=function(a,b,c){
if(a===b){
return c;
}
var d=a.nextSibling;
while(d){
if(d===b){
return -1;
}
d=d.nextSibling;
}
return 1;
}),function(){
var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;
a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){
if(typeof c.getElementById!="undefined"&&!d){
var e=c.getElementById(a[1]);
return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[];
}
},o.filter.ID=function(a,b){
var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");
return a.nodeType===1&&c&&c.nodeValue===b;
}),e.removeChild(a),e=a=null;
}(),function(){
var a=c.createElement("div");
a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){
var c=b.getElementsByTagName(a[1]);
if(a[1]==="*"){
var d=[];
for(var e=0;c[e];e++){
c[e].nodeType===1&&d.push(c[e]);
}
c=d;
}
return c;
}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){
return a.getAttribute("href",2);
}),a=null;
}(),c.querySelectorAll&&function(){
var a=m,b=c.createElement("div"),d="__sizzle__";
b.innerHTML="<p class='TEST'></p>";
if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){
m=function(b,e,f,g){
e=e||c;
if(!g&&!m.isXML(e)){
var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);
if(h&&(e.nodeType===1||e.nodeType===9)){
if(h[1]){
return s(e.getElementsByTagName(b),f);
}
if(h[2]&&o.find.CLASS&&e.getElementsByClassName){
return s(e.getElementsByClassName(h[2]),f);
}
}
if(e.nodeType===9){
if(b==="body"&&e.body){
return s([e.body],f);
}
if(h&&h[3]){
var i=e.getElementById(h[3]);
if(!i||!i.parentNode){
return s([],f);
}
if(i.id===h[3]){
return s([i],f);
}
}
try{
return s(e.querySelectorAll(b),f);
}
catch(j){
}
}else{
if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){
var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);
l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);
try{
if(!q||p){
return s(e.querySelectorAll("[id='"+n+"'] "+b),f);
}
}
catch(r){
}
finally{
l||k.removeAttribute("id");
}
}
}
}
return a(b,e,f,g);
};
for(var e in a){
m[e]=a[e];
}
b=null;
}
}(),function(){
var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;
if(b){
var d=!b.call(c.createElement("div"),"div"),e=!1;
try{
b.call(c.documentElement,"[test!='']:sizzle");
}
catch(f){
e=!0;
}
m.matchesSelector=function(a,c){
c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");
if(!m.isXML(a)){
try{
if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){
var f=b.call(a,c);
if(f||!d||a.document&&a.document.nodeType!==11){
return f;
}
}
}
catch(g){
}
}
return m(c,null,null,[a]).length>0;
};
}
}(),function(){
var a=c.createElement("div");
a.innerHTML="<div class='test e'></div><div class='test'></div>";
if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){
a.lastChild.className="e";
if(a.getElementsByClassName("e").length===1){
return;
}
o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){
if(typeof b.getElementsByClassName!="undefined"&&!c){
return b.getElementsByClassName(a[1]);
}
},a=null;
}
}(),c.documentElement.contains?m.contains=function(a,b){
return a!==b&&(a.contains?a.contains(b):!0);
}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){
return !!(a.compareDocumentPosition(b)&16);
}:m.contains=function(){
return !1;
},m.isXML=function(a){
var b=(a?a.ownerDocument||a:0).documentElement;
return b?b.nodeName!=="HTML":!1;
};
var y=function(a,b,c){
var d,e=[],f="",g=b.nodeType?[b]:b;
while(d=o.match.PSEUDO.exec(a)){
f+=d[0],a=a.replace(o.match.PSEUDO,"");
}
a=o.relative[a]?a+"*":a;
for(var h=0,i=g.length;h<i;h++){
m(a,g[h],e,c);
}
return m.filter(f,e);
};
m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains;
}();
var O=/Until$/,P=/^(?:parents|prevUntil|prevAll)/,Q=/,/,R=/^.[^:#\[\.,]*$/,S=Array.prototype.slice,T=f.expr.match.POS,U={children:!0,contents:!0,next:!0,prev:!0};
f.fn.extend({find:function(a){
var b=this,c,d;
if(typeof a!="string"){
return f(a).filter(function(){
for(c=0,d=b.length;c<d;c++){
if(f.contains(b[c],this)){
return !0;
}
}
});
}
var e=this.pushStack("","find",a),g,h,i;
for(c=0,d=this.length;c<d;c++){
g=e.length,f.find(a,this[c],e);
if(c>0){
for(h=g;h<e.length;h++){
for(i=0;i<g;i++){
if(e[i]===e[h]){
e.splice(h--,1);
break;
}
}
}
}
}
return e;
},has:function(a){
var b=f(a);
return this.filter(function(){
for(var a=0,c=b.length;a<c;a++){
if(f.contains(this,b[a])){
return !0;
}
}
});
},not:function(a){
return this.pushStack(W(this,a,!1),"not",a);
},filter:function(a){
return this.pushStack(W(this,a,!0),"filter",a);
},is:function(a){
return !!a&&(typeof a=="string"?T.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0);
},closest:function(a,b){
var c=[],d,e,g=this[0];
if(f.isArray(a)){
var h=1;
while(g&&g.ownerDocument&&g!==b){
for(d=0;d<a.length;d++){
f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});
}
g=g.parentNode,h++;
}
return c;
}
var i=T.test(a)||typeof a!="string"?f(a,b||this.context):0;
for(d=0,e=this.length;d<e;d++){
g=this[d];
while(g){
if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){
c.push(g);
break;
}
g=g.parentNode;
if(!g||!g.ownerDocument||g===b||g.nodeType===11){
break;
}
}
}
c=c.length>1?f.unique(c):c;
return this.pushStack(c,"closest",a);
},index:function(a){
if(!a){
return this[0]&&this[0].parentNode?this.prevAll().length:-1;
}
if(typeof a=="string"){
return f.inArray(this[0],f(a));
}
return f.inArray(a.jquery?a[0]:a,this);
},add:function(a,b){
var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);
return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d));
},andSelf:function(){
return this.add(this.prevObject);
}}),f.each({parent:function(a){
var b=a.parentNode;
return b&&b.nodeType!==11?b:null;
},parents:function(a){
return f.dir(a,"parentNode");
},parentsUntil:function(a,b,c){
return f.dir(a,"parentNode",c);
},next:function(a){
return f.nth(a,2,"nextSibling");
},prev:function(a){
return f.nth(a,2,"previousSibling");
},nextAll:function(a){
return f.dir(a,"nextSibling");
},prevAll:function(a){
return f.dir(a,"previousSibling");
},nextUntil:function(a,b,c){
return f.dir(a,"nextSibling",c);
},prevUntil:function(a,b,c){
return f.dir(a,"previousSibling",c);
},siblings:function(a){
return f.sibling(a.parentNode.firstChild,a);
},children:function(a){
return f.sibling(a.firstChild);
},contents:function(a){
return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes);
}},function(a,b){
f.fn[a]=function(c,d){
var e=f.map(this,b,c),g=S.call(arguments);
O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());
return this.pushStack(e,a,g.join(","));
};
}),f.extend({filter:function(a,b,c){
c&&(a=":not("+a+")");
return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b);
},dir:function(a,c,d){
var e=[],g=a[c];
while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d))){
g.nodeType===1&&e.push(g),g=g[c];
}
return e;
},nth:function(a,b,c,d){
b=b||1;
var e=0;
for(;a;a=a[c]){
if(a.nodeType===1&&++e===b){
break;
}
}
return a;
},sibling:function(a,b){
var c=[];
for(;a;a=a.nextSibling){
a.nodeType===1&&a!==b&&c.push(a);
}
return c;
}});
var Y="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",Z=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,_=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,ba=/<([\w:]+)/,bb=/<tbody/i,bc=/<|&#?\w+;/,bd=/<(?:script|style)/i,be=/<(?:script|object|embed|option|style)/i,bf=new RegExp("<(?:"+Y.replace(" ","|")+")","i"),bg=/checked\s*(?:[^=]|=\s*.checked.)/i,bh=/\/(java|ecma)script/i,bi=/^\s*<!(?:\[CDATA\[|\-\-)/,bj={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bk=X(c);
bj.optgroup=bj.option,bj.tbody=bj.tfoot=bj.colgroup=bj.caption=bj.thead,bj.th=bj.td,f.support.htmlSerialize||(bj._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){
if(f.isFunction(a)){
return this.each(function(b){
var c=f(this);
c.text(a.call(this,b,c.text()));
});
}
if(typeof a!="object"&&a!==b){
return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));
}
return f.text(this);
},wrapAll:function(a){
if(f.isFunction(a)){
return this.each(function(b){
f(this).wrapAll(a.call(this,b));
});
}
if(this[0]){
var b=f(a,this[0].ownerDocument).eq(0).clone(!0);
this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){
var a=this;
while(a.firstChild&&a.firstChild.nodeType===1){
a=a.firstChild;
}
return a;
}).append(this);
}
return this;
},wrapInner:function(a){
if(f.isFunction(a)){
return this.each(function(b){
f(this).wrapInner(a.call(this,b));
});
}
return this.each(function(){
var b=f(this),c=b.contents();
c.length?c.wrapAll(a):b.append(a);
});
},wrap:function(a){
return this.each(function(){
f(this).wrapAll(a);
});
},unwrap:function(){
return this.parent().each(function(){
f.nodeName(this,"body")||f(this).replaceWith(this.childNodes);
}).end();
},append:function(){
return this.domManip(arguments,!0,function(a){
this.nodeType===1&&this.appendChild(a);
});
},prepend:function(){
return this.domManip(arguments,!0,function(a){
this.nodeType===1&&this.insertBefore(a,this.firstChild);
});
},before:function(){
if(this[0]&&this[0].parentNode){
return this.domManip(arguments,!1,function(a){
this.parentNode.insertBefore(a,this);
});
}
if(arguments.length){
var a=f(arguments[0]);
a.push.apply(a,this.toArray());
return this.pushStack(a,"before",arguments);
}
},after:function(){
if(this[0]&&this[0].parentNode){
return this.domManip(arguments,!1,function(a){
this.parentNode.insertBefore(a,this.nextSibling);
});
}
if(arguments.length){
var a=this.pushStack(this,"after",arguments);
a.push.apply(a,f(arguments[0]).toArray());
return a;
}
},remove:function(a,b){
for(var c=0,d;(d=this[c])!=null;c++){
if(!a||f.filter(a,[d]).length){
!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);
}
}
return this;
},empty:function(){
for(var a=0,b;(b=this[a])!=null;a++){
b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));
while(b.firstChild){
b.removeChild(b.firstChild);
}
}
return this;
},clone:function(a,b){
a=a==null?!1:a,b=b==null?a:b;
return this.map(function(){
return f.clone(this,a,b);
});
},html:function(a){
if(a===b){
return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Z,""):null;
}
if(typeof a=="string"&&!bd.test(a)&&(f.support.leadingWhitespace||!$.test(a))&&!bj[(ba.exec(a)||["",""])[1].toLowerCase()]){
a=a.replace(_,"<$1></$2>");
try{
for(var c=0,d=this.length;c<d;c++){
this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a);
}
}
catch(e){
this.empty().append(a);
}
}else{
f.isFunction(a)?this.each(function(b){
var c=f(this);
c.html(a.call(this,b,c.html()));
}):this.empty().append(a);
}
return this;
},replaceWith:function(a){
if(this[0]&&this[0].parentNode){
if(f.isFunction(a)){
return this.each(function(b){
var c=f(this),d=c.html();
c.replaceWith(a.call(this,b,d));
});
}
typeof a!="string"&&(a=f(a).detach());
return this.each(function(){
var b=this.nextSibling,c=this.parentNode;
f(this).remove(),b?f(b).before(a):f(c).append(a);
});
}
return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this;
},detach:function(a){
return this.remove(a,!0);
},domManip:function(a,c,d){
var e,g,h,i,j=a[0],k=[];
if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bg.test(j)){
return this.each(function(){
f(this).domManip(a,c,d,!0);
});
}
if(f.isFunction(j)){
return this.each(function(e){
var g=f(this);
a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d);
});
}
if(this[0]){
i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;
if(g){
c=c&&f.nodeName(g,"tr");
for(var l=0,m=this.length,n=m-1;l<m;l++){
d.call(c?bl(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h);
}
}
k.length&&f.each(k,br);
}
return this;
}}),f.buildFragment=function(a,b,d){
var e,g,h,i,j=a[0];
b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!be.test(j)&&(f.support.checkClone||!bg.test(j))&&!f.support.unknownElems&&bf.test(j)&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);
return {fragment:e,cacheable:g};
},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){
f.fn[a]=function(c){
var d=[],e=f(c),g=this.length===1&&this[0].parentNode;
if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){
e[b](this[0]);
return this;
}
for(var h=0,i=e.length;h<i;h++){
var j=(h>0?this.clone(!0):this).get();
f(e[h])[b](j),d=d.concat(j);
}
return this.pushStack(d,a,e.selector);
};
}),f.extend({clone:function(a,b,c){
var d=a.cloneNode(!0),e,g,h;
if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){
bn(a,d),e=bo(a),g=bo(d);
for(h=0;e[h];++h){
g[h]&&bn(e[h],g[h]);
}
}
if(b){
bm(a,d);
if(c){
e=bo(a),g=bo(d);
for(h=0;e[h];++h){
bm(e[h],g[h]);
}
}
}
e=g=null;
return d;
},clean:function(a,b,d,e){
var g;
b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);
var h=[],i;
for(var j=0,k;(k=a[j])!=null;j++){
typeof k=="number"&&(k+="");
if(!k){
continue;
}
if(typeof k=="string"){
if(!bc.test(k)){
k=b.createTextNode(k);
}else{
k=k.replace(_,"<$1></$2>");
var l=(ba.exec(k)||["",""])[1].toLowerCase(),m=bj[l]||bj._default,n=m[0],o=b.createElement("div");
b===c?bk.appendChild(o):X(b).appendChild(o),o.innerHTML=m[1]+k+m[2];
while(n--){
o=o.lastChild;
}
if(!f.support.tbody){
var p=bb.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];
for(i=q.length-1;i>=0;--i){
f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i]);
}
}
!f.support.leadingWhitespace&&$.test(k)&&o.insertBefore(b.createTextNode($.exec(k)[0]),o.firstChild),k=o.childNodes;
}
}
var r;
if(!f.support.appendChecked){
if(k[0]&&typeof (r=k.length)=="number"){
for(i=0;i<r;i++){
bq(k[i]);
}
}else{
bq(k);
}
}
k.nodeType?h.push(k):h=f.merge(h,k);
}
if(d){
g=function(a){
return !a.type||bh.test(a.type);
};
for(j=0;h[j];j++){
if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript")){
e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);
}else{
if(h[j].nodeType===1){
var s=f.grep(h[j].getElementsByTagName("script"),g);
h.splice.apply(h,[j+1,0].concat(s));
}
d.appendChild(h[j]);
}
}
}
return h;
},cleanData:function(a){
var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;
for(var h=0,i;(i=a[h])!=null;h++){
if(i.nodeName&&f.noData[i.nodeName.toLowerCase()]){
continue;
}
c=i[f.expando];
if(c){
b=d[c];
if(b&&b.events){
for(var j in b.events){
e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);
}
b.handle&&(b.handle.elem=null);
}
g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c];
}
}
}});
var bs=/alpha\([^)]*\)/i,bt=/opacity=([^)]*)/,bu=/([A-Z]|^ms)/g,bv=/^-?\d+(?:px)?$/i,bw=/^-?\d/,bx=/^([\-+])=([\-+.\de]+)/,by={position:"absolute",visibility:"hidden",display:"block"},bz=["Left","Right"],bA=["Top","Bottom"],bB,bC,bD;
f.fn.css=function(a,c){
if(arguments.length===2&&c===b){
return this;
}
return f.access(this,a,c,!0,function(a,c,d){
return d!==b?f.style(a,c,d):f.css(a,c);
});
},f.extend({cssHooks:{opacity:{get:function(a,b){
if(b){
var c=bB(a,"opacity","opacity");
return c===""?"1":c;
}
return a.style.opacity;
}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){
if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){
var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];
c=f.cssProps[i]||i;
if(d===b){
if(k&&"get" in k&&(g=k.get(a,!1,e))!==b){
return g;
}
return j[c];
}
h=typeof d,h==="string"&&(g=bx.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");
if(d==null||h==="number"&&isNaN(d)){
return;
}
h==="number"&&!f.cssNumber[i]&&(d+="px");
if(!k||!("set" in k)||(d=k.set(a,d))!==b){
try{
j[c]=d;
}
catch(l){
}
}
}
},css:function(a,c,d){
var e,g;
c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");
if(g&&"get" in g&&(e=g.get(a,!0,d))!==b){
return e;
}
if(bB){
return bB(a,c);
}
},swap:function(a,b,c){
var d={};
for(var e in b){
d[e]=a.style[e],a.style[e]=b[e];
}
c.call(a);
for(e in b){
a.style[e]=d[e];
}
}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){
f.cssHooks[b]={get:function(a,c,d){
var e;
if(c){
if(a.offsetWidth!==0){
return bE(a,b,d);
}
f.swap(a,by,function(){
e=bE(a,b,d);
});
return e;
}
},set:function(a,b){
if(!bv.test(b)){
return b;
}
b=parseFloat(b);
if(b>=0){
return b+"px";
}
}};
}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){
return bt.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":"";
},set:function(a,b){
var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";
c.zoom=1;
if(b>=1&&f.trim(g.replace(bs,""))===""){
c.removeAttribute("filter");
if(d&&!d.filter){
return;
}
}
c.filter=bs.test(g)?g.replace(bs,e):g+" "+e;
}}),f(function(){
f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){
var c;
f.swap(a,{display:"inline-block"},function(){
b?c=bB(a,"margin-right","marginRight"):c=a.style.marginRight;
});
return c;
}});
}),c.defaultView&&c.defaultView.getComputedStyle&&(bC=function(a,c){
var d,e,g;
c=c.replace(bu,"-$1").toLowerCase();
if(!(e=a.ownerDocument.defaultView)){
return b;
}
if(g=e.getComputedStyle(a,null)){
d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));
}
return d;
}),c.documentElement.currentStyle&&(bD=function(a,b){
var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;
f===null&&g&&(e=g[b])&&(f=e),!bv.test(f)&&bw.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));
return f===""?"auto":f;
}),bB=bC||bD,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){
var b=a.offsetWidth,c=a.offsetHeight;
return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none";
},f.expr.filters.visible=function(a){
return !f.expr.filters.hidden(a);
});
var bF=/%20/g,bG=/\[\]$/,bH=/\r?\n/g,bI=/#.*$/,bJ=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bK=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bL=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bM=/^(?:GET|HEAD)$/,bN=/^\/\//,bO=/\?/,bP=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bQ=/^(?:select|textarea)/i,bR=/\s+/,bS=/([?&])_=[^&]*/,bT=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bU=f.fn.load,bV={},bW={},bX,bY,bZ=["*/"]+["*"];
try{
bX=e.href;
}
catch(b$){
bX=c.createElement("a"),bX.href="",bX=bX.href;
}
bY=bT.exec(bX.toLowerCase())||[],f.fn.extend({load:function(a,c,d){
if(typeof a!="string"&&bU){
return bU.apply(this,arguments);
}
if(!this.length){
return this;
}
var e=a.indexOf(" ");
if(e>=0){
var g=a.slice(e,a.length);
a=a.slice(0,e);
}
var h="GET";
c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));
var i=this;
f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){
c=a.responseText,a.isResolved()&&(a.done(function(a){
c=a;
}),i.html(g?f("<div>").append(c.replace(bP,"")).find(g):c)),d&&i.each(d,[c,b,a]);
}});
return this;
},serialize:function(){
return f.param(this.serializeArray());
},serializeArray:function(){
return this.map(function(){
return this.elements?f.makeArray(this.elements):this;
}).filter(function(){
return this.name&&!this.disabled&&(this.checked||bQ.test(this.nodeName)||bK.test(this.type));
}).map(function(a,b){
var c=f(this).val();
return c==null?null:f.isArray(c)?f.map(c,function(a,c){
return {name:b.name,value:a.replace(bH,"\r\n")};
}):{name:b.name,value:c.replace(bH,"\r\n")};
}).get();
}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){
f.fn[b]=function(a){
return this.bind(b,a);
};
}),f.each(["get","post"],function(a,c){
f[c]=function(a,d,e,g){
f.isFunction(d)&&(g=g||e,e=d,d=b);
return f.ajax({type:c,url:a,data:d,success:e,dataType:g});
};
}),f.extend({getScript:function(a,c){
return f.get(a,b,c,"script");
},getJSON:function(a,b,c){
return f.get(a,b,c,"json");
},ajaxSetup:function(a,b){
b?cb(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),cb(a,b);
return a;
},ajaxSettings:{url:bX,isLocal:bL.test(bY[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bZ},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:b_(bV),ajaxTransport:b_(bW),ajax:function(a,c){
function w(a,c,l,m){
if(s!==2){
s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;
var o,r,u,w=c,x=l?cd(d,v,l):b,y,z;
if(a>=200&&a<300||a===304){
if(d.ifModified){
if(y=v.getResponseHeader("Last-Modified")){
f.lastModified[k]=y;
}
if(z=v.getResponseHeader("Etag")){
f.etag[k]=z;
}
}
if(a===304){
w="notmodified",o=!0;
}else{
try{
r=ce(d,x),w="success",o=!0;
}
catch(A){
w="parsererror",u=A;
}
}
}else{
u=w;
if(!w||a){
w="error",a<0&&(a=0);
}
}
v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"));
}
}
typeof a=="object"&&(c=a,a=b),c=c||{};
var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){
if(!s){
var c=a.toLowerCase();
a=m[c]=m[c]||a,l[a]=b;
}
return this;
},getAllResponseHeaders:function(){
return s===2?n:null;
},getResponseHeader:function(a){
var c;
if(s===2){
if(!o){
o={};
while(c=bJ.exec(n)){
o[c[1].toLowerCase()]=c[2];
}
}
c=o[a.toLowerCase()];
}
return c===b?null:c;
},overrideMimeType:function(a){
s||(d.mimeType=a);
return this;
},abort:function(a){
a=a||"abort",p&&p.abort(a),w(0,a);
return this;
}};
h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){
if(a){
var b;
if(s<2){
for(b in a){
j[b]=[j[b],a[b]];
}
}else{
b=a[v.status],v.then(b,b);
}
}
return this;
},d.url=((a||d.url)+"").replace(bI,"").replace(bN,bY[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bR),d.crossDomain==null&&(r=bT.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bY[1]&&r[2]==bY[2]&&(r[3]||(r[1]==="http:"?80:443))==(bY[3]||(bY[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),ca(bV,d,c,v);
if(s===2){
return !1;
}
t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bM.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");
if(!d.hasContent){
d.data&&(d.url+=(bO.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;
if(d.cache===!1){
var x=f.now(),y=d.url.replace(bS,"$1_="+x);
d.url=y+(y===d.url?(bO.test(d.url)?"&":"?")+"_="+x:"");
}
}
(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bZ+"; q=0.01":""):d.accepts["*"]);
for(u in d.headers){
v.setRequestHeader(u,d.headers[u]);
}
if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){
v.abort();
return !1;
}
for(u in {success:1,error:1,complete:1}){
v[u](d[u]);
}
p=ca(bW,d,c,v);
if(!p){
w(-1,"No Transport");
}else{
v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){
v.abort("timeout");
},d.timeout));
try{
s=1,p.send(l,w);
}
catch(z){
s<2?w(-1,z):f.error(z);
}
}
return v;
},param:function(a,c){
var d=[],e=function(a,b){
b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b);
};
c===b&&(c=f.ajaxSettings.traditional);
if(f.isArray(a)||a.jquery&&!f.isPlainObject(a)){
f.each(a,function(){
e(this.name,this.value);
});
}else{
for(var g in a){
cc(g,a[g],c,e);
}
}
return d.join("&").replace(bF,"+");
}}),f.extend({active:0,lastModified:{},etag:{}});
var cf=f.now(),cg=/(\=)\?(&|$)|\?\?/i;
f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){
return f.expando+"_"+cf++;
}}),f.ajaxPrefilter("json jsonp",function(b,c,d){
var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";
if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cg.test(b.url)||e&&cg.test(b.data))){
var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";
b.jsonp!==!1&&(j=j.replace(cg,l),b.url===j&&(e&&(k=k.replace(cg,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){
g=[a];
},d.always(function(){
a[h]=i,g&&f.isFunction(i)&&a[h](g[0]);
}),b.converters["script json"]=function(){
g||f.error(h+" was not called");
return g[0];
},b.dataTypes[0]="json";
return "script";
}
}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){
f.globalEval(a);
return a;
}}}),f.ajaxPrefilter("script",function(a){
a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1);
}),f.ajaxTransport("script",function(a){
if(a.crossDomain){
var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;
return {send:function(f,g){
d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){
if(c||!d.readyState||/loaded|complete/.test(d.readyState)){
d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success");
}
},e.insertBefore(d,e.firstChild);
},abort:function(){
d&&d.onload(0,1);
}};
}
});
var ch=a.ActiveXObject?function(){
for(var a in cj){
cj[a](0,1);
}
}:!1,ci=0,cj;
f.ajaxSettings.xhr=a.ActiveXObject?function(){
return !this.isLocal&&ck()||cl();
}:ck,function(a){
f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials" in a});
}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){
if(!c.crossDomain||f.support.cors){
var d;
return {send:function(e,g){
var h=c.xhr(),i,j;
c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);
if(c.xhrFields){
for(j in c.xhrFields){
h[j]=c.xhrFields[j];
}
}
c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");
try{
for(j in e){
h.setRequestHeader(j,e[j]);
}
}
catch(k){
}
h.send(c.hasContent&&c.data||null),d=function(a,e){
var j,k,l,m,n;
try{
if(d&&(e||h.readyState===4)){
d=b,i&&(h.onreadystatechange=f.noop,ch&&delete cj[i]);
if(e){
h.readyState!==4&&h.abort();
}else{
j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;
try{
k=h.statusText;
}
catch(o){
k="";
}
!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204);
}
}
}
catch(p){
e||g(-1,p);
}
m&&g(j,k,m,l);
},!c.async||h.readyState===4?d():(i=++ci,ch&&(cj||(cj={},f(a).unload(ch)),cj[i]=d),h.onreadystatechange=d);
},abort:function(){
d&&d(0,1);
}};
}
});
var cm={},cn,co,cp=/^(?:toggle|show|hide)$/,cq=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cr,cs=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],ct;
f.fn.extend({show:function(a,b,c){
var d,e;
if(a||a===0){
return this.animate(cw("show",3),a,b,c);
}
for(var g=0,h=this.length;g<h;g++){
d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cx(d.nodeName)));
}
for(g=0;g<h;g++){
d=this[g];
if(d.style){
e=d.style.display;
if(e===""||e==="none"){
d.style.display=f._data(d,"olddisplay")||"";
}
}
}
return this;
},hide:function(a,b,c){
if(a||a===0){
return this.animate(cw("hide",3),a,b,c);
}
var d,e,g=0,h=this.length;
for(;g<h;g++){
d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));
}
for(g=0;g<h;g++){
this[g].style&&(this[g].style.display="none");
}
return this;
},_toggle:f.fn.toggle,toggle:function(a,b,c){
var d=typeof a=="boolean";
f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){
var b=d?a:f(this).is(":hidden");
f(this)[b?"show":"hide"]();
}):this.animate(cw("toggle",3),a,b,c);
return this;
},fadeTo:function(a,b,c,d){
return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d);
},animate:function(a,b,c,d){
function g(){
e.queue===!1&&f._mark(this);
var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;
b.animatedProperties={};
for(i in a){
g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";
if(h==="hide"&&d||h==="show"&&!d){
return b.complete.call(this);
}
c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cx(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1));
}
b.overflow!=null&&(this.style.overflow="hidden");
for(i in a){
j=new f.fx(this,b,i),h=a[i],cp.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=cq.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));
}
return !0;
}
var e=f.speed(b,c,d);
if(f.isEmptyObject(a)){
return this.each(e.complete,[!1]);
}
a=f.extend({},a);
return e.queue===!1?this.each(g):this.queue(e.queue,g);
},stop:function(a,c,d){
typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);
return this.each(function(){
function h(a,b,c){
var e=b[c];
f.removeData(a,c,!0),e.stop(d);
}
var b,c=!1,e=f.timers,g=f._data(this);
d||f._unmark(!0,this);
if(a==null){
for(b in g){
g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);
}
}else{
g[b=a+".run"]&&g[b].stop&&h(this,g,b);
}
for(b=e.length;b--;){
e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));
}
(!d||!c)&&f.dequeue(this,a);
});
}}),f.each({slideDown:cw("show",1),slideUp:cw("hide",1),slideToggle:cw("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){
f.fn[a]=function(a,c,d){
return this.animate(b,a,c,d);
};
}),f.extend({speed:function(a,b,c){
var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};
d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;
if(d.queue==null||d.queue===!0){
d.queue="fx";
}
d.old=d.complete,d.complete=function(a){
f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this);
};
return d;
},easing:{linear:function(a,b,c,d){
return c+d*a;
},swing:function(a,b,c,d){
return (-Math.cos(a*Math.PI)/2+0.5)*d+c;
}},timers:[],fx:function(a,b,c){
this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{};
}}),f.fx.prototype={update:function(){
this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this);
},cur:function(){
if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){
return this.elem[this.prop];
}
var a,b=f.css(this.elem,this.prop);
return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a;
},custom:function(a,c,d){
function h(a){
return e.step(a);
}
var e=this,g=f.fx;
this.startTime=ct||cu(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){
e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start);
},h()&&f.timers.push(h)&&!cr&&(cr=setInterval(g.tick,g.interval));
},show:function(){
var a=f._data(this.elem,"fxshow"+this.prop);
this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show();
},hide:function(){
this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0);
},step:function(a){
var b,c,d,e=ct||cu(),g=!0,h=this.elem,i=this.options;
if(a||e>=i.duration+this.startTime){
this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;
for(b in i.animatedProperties){
i.animatedProperties[b]!==!0&&(g=!1);
}
if(g){
i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){
h.style["overflow"+b]=i.overflow[a];
}),i.hide&&f(h).hide();
if(i.hide||i.show){
for(b in i.animatedProperties){
f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);
}
}
d=i.complete,d&&(i.complete=!1,d.call(h));
}
return !1;
}
i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();
return !0;
}},f.extend(f.fx,{tick:function(){
var a,b=f.timers,c=0;
for(;c<b.length;c++){
a=b[c],!a()&&b[c]===a&&b.splice(c--,1);
}
b.length||f.fx.stop();
},interval:13,stop:function(){
clearInterval(cr),cr=null;
},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){
f.style(a.elem,"opacity",a.now);
},_default:function(a){
a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now;
}}}),f.each(["width","height"],function(a,b){
f.fx.step[b]=function(a){
f.style(a.elem,b,Math.max(0,a.now));
};
}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){
return f.grep(f.timers,function(b){
return a===b.elem;
}).length;
});
var cy=/^t(?:able|d|h)$/i,cz=/^(?:body|html)$/i;
"getBoundingClientRect" in c.documentElement?f.fn.offset=function(a){
var b=this[0],c;
if(a){
return this.each(function(b){
f.offset.setOffset(this,a,b);
});
}
if(!b||!b.ownerDocument){
return null;
}
if(b===b.ownerDocument.body){
return f.offset.bodyOffset(b);
}
try{
c=b.getBoundingClientRect();
}
catch(d){
}
var e=b.ownerDocument,g=e.documentElement;
if(!c||!f.contains(g,b)){
return c?{top:c.top,left:c.left}:{top:0,left:0};
}
var h=e.body,i=cA(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;
return {top:n,left:o};
}:f.fn.offset=function(a){
var b=this[0];
if(a){
return this.each(function(b){
f.offset.setOffset(this,a,b);
});
}
if(!b||!b.ownerDocument){
return null;
}
if(b===b.ownerDocument.body){
return f.offset.bodyOffset(b);
}
var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;
while((b=b.parentNode)&&b!==i&&b!==h){
if(f.support.fixedPosition&&k.position==="fixed"){
break;
}
c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cy.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c;
}
if(k.position==="relative"||k.position==="static"){
l+=i.offsetTop,m+=i.offsetLeft;
}
f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));
return {top:l,left:m};
},f.offset={bodyOffset:function(a){
var b=a.offsetTop,c=a.offsetLeft;
f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);
return {top:b,left:c};
},setOffset:function(a,b,c){
var d=f.css(a,"position");
d==="static"&&(a.style.position="relative");
var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;
j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using" in b?b.using.call(a,k):e.css(k);
}},f.fn.extend({position:function(){
if(!this[0]){
return null;
}
var a=this[0],b=this.offsetParent(),c=this.offset(),d=cz.test(b[0].nodeName)?{top:0,left:0}:b.offset();
c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;
return {top:c.top-d.top,left:c.left-d.left};
},offsetParent:function(){
return this.map(function(){
var a=this.offsetParent||c.body;
while(a&&!cz.test(a.nodeName)&&f.css(a,"position")==="static"){
a=a.offsetParent;
}
return a;
});
}}),f.each(["Left","Top"],function(a,c){
var d="scroll"+c;
f.fn[d]=function(c){
var e,g;
if(c===b){
e=this[0];
if(!e){
return null;
}
g=cA(e);
return g?"pageXOffset" in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d];
}
return this.each(function(){
g=cA(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c;
});
};
}),f.each(["Height","Width"],function(a,c){
var d=c.toLowerCase();
f.fn["inner"+c]=function(){
var a=this[0];
return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null;
},f.fn["outer"+c]=function(a){
var b=this[0];
return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null;
},f.fn[d]=function(a){
var e=this[0];
if(!e){
return a==null?null:this;
}
if(f.isFunction(a)){
return this.each(function(b){
var c=f(this);
c[d](a.call(this,b,c[d]()));
});
}
if(f.isWindow(e)){
var g=e.document.documentElement["client"+c],h=e.document.body;
return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g;
}
if(e.nodeType===9){
return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);
}
if(a===b){
var i=f.css(e,d),j=parseFloat(i);
return f.isNumeric(j)?j:i;
}
return this.css(d,typeof a=="string"?a:a+"px");
};
}),a.jQuery=a.$=f;
})(window);
(function($){
var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},s={"array":function(x){
var a=["["],b,f,i,l=x.length,v;
for(i=0;i<l;i+=1){
v=x[i];
f=s[typeof v];
if(f){
v=f(v);
if(typeof v=="string"){
if(b){
a[a.length]=",";
}
a[a.length]=v;
b=true;
}
}
}
a[a.length]="]";
return a.join("");
},"boolean":function(x){
return String(x);
},"null":function(x){
return "null";
},"number":function(x){
return isFinite(x)?String(x):"null";
},"object":function(x){
if(x){
if(x instanceof Array){
return s.array(x);
}
var a=["{"],b,f,i,v;
for(i in x){
v=x[i];
f=s[typeof v];
if(f){
v=f(v);
if(typeof v=="string"){
if(b){
a[a.length]=",";
}
a.push(s.string(i),":",v);
b=true;
}
}
}
a[a.length]="}";
return a.join("");
}
return "null";
},"string":function(x){
if(/["\\\x00-\x1f]/.test(x)){
x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){
var c=m[b];
if(c){
return c;
}
c=b.charCodeAt();
return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16);
});
}
return "\""+x+"\"";
}};
$.toJSON=function(v){
var f=isNaN(v)?s[typeof v]:s["number"];
if(f){
return f(v);
}
};
$.parseJSON=function(v,safe){
if(safe===undefined){
safe=$.parseJSON.safe;
}
if(safe&&!/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/.test(v)){
return undefined;
}
return eval("("+v+")");
};
$.parseJSON.safe=false;
})(jQuery);
var VectorModel=function(){
this.init();
};
var linearGradients=new Object();
VectorModel.prototype={init:function(){
this.svg_capable=document.implementation.hasFeature("org.w3c.dom.svg","1.1")||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Structure","1.1");
this.vml_capable=(document.all&&!(navigator.userAgent.indexOf("Opera")>=0))?true:false;
if(this.vml_capable){
document.namespaces.add("v","urn:schemas-microsoft-com:vml");
document.createStyleSheet().addRule("v\\:*","behavior:url(#default#VML); position:absolute");
var me=this;
document.createElementNS=function(ns,_65c){
return me.createElement(_65c);
};
}
},createElement:function(_65d){
if(this.svg_capable){
var _65e=document.createElementNS("http://www.w3.org/2000/svg",_65d);
if(_65d=="rect"){
_65e.applyGradient=function(_65f){
if(_65f.type=="LinearGradient"){
var _660=_65e.parentNode;
if(!document.getElementById(_65f.id)){
var _661=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");
_661.id=_65f.id;
var _662=(_65f.angle+90)%360;
if(_662<0){
_662=_662%360+360;
}
var _663="X";
var _664=0;
var _665=0;
var _666=100;
var _667=100;
if((_662-45)%180/180>0&&(_662-45)%180/180<0.5){
_663="Y";
}
if(_663=="Y"){
if(_662>225){
_666=((_662-225))/90*100;
_667=0;
_664=100-_666;
_665=100;
}else{
_664=((_662-45))/90*100;
_665=0;
_666=100-_664;
_667=100;
}
}else{
if(_662<45||_662>=315){
_667=((_662+225)%90)/90*100;
_666=0;
_665=100-_667;
_664=100;
}else{
_665=((_662+45)%90)/90*100;
_664=0;
_667=100-_665;
_666=100;
}
}
_661.setAttribute("x1",_664+"%");
_661.setAttribute("y1",_665+"%");
_661.setAttribute("x2",_666+"%");
_661.setAttribute("y2",_667+"%");
var _668=document.createElementNS("http://www.w3.org/2000/svg","stop");
_668.setAttribute("offset","0%");
_668.setAttribute("stop-color",_65f.endColor);
_661.appendChild(_668);
var _669=document.createElementNS("http://www.w3.org/2000/svg","stop");
_669.setAttribute("offset","100%");
_669.setAttribute("stop-color",_65f.startColor);
_661.appendChild(_669);
if(!_660.defs){
_660.appendChild(document.createElementNS("http://www.w3.org/2000/svg","defs"));
}
_660.getElementsByTagName("defs")[0].appendChild(_661);
this.setAttribute("fill","url(#"+_65f.id+")");
}
}
};
}
return _65e;
}else{
if(this.vml_capable){
if(_65d=="svg"){
return createVMLSurface();
}else{
if(_65d=="g"){
return createVMLGroup();
}else{
if(_65d=="circle"){
return createVMLCircle();
}else{
if(_65d=="ellipse"){
return createVMLEllipse();
}else{
if(_65d=="rect"){
return createVMLRectangle();
}else{
if(_65d=="line"){
return createVMLLine();
}else{
if(_65d=="path"){
return createVMLPath();
}else{
if(_65d=="linearGradient"){
return createVMLLinearGradient();
}else{
if(_65d=="stop"){
return createVMLStop();
}else{
if(_65d=="defs"){
return createVMLDefs();
}else{
if(_65d=="polyline"){
return createVMLPolyLine();
}
}
}
}
}
}
}
}
}
}
}
}else{
}
}
}};
var createVMLSurface=function(){
var _66a=document.createElement("div");
_66a.style.position="absolute";
_66a.style.left="0px";
_66a.style.top="0px";
_66a.setAttribute=function(key,_66c){
if(key=="width"){
this.style.width=_66c;
}else{
if(key=="height"){
this.style.height=_66c;
}else{
if(key=="x"){
this.style.left=_66c;
}else{
if(key=="y"){
this.style.top=_66c;
}
}
}
}
};
return _66a;
};
var createVMLGroup=function(){
var _66d=document.createElement("div");
_66d.style.position="absolute";
_66d.style.left="0px";
_66d.style.top="0px";
_66d.defs={};
_66d.setAttribute=function(key,_66f){
if(key=="width"){
this.style.width=_66f;
}else{
if(key=="height"){
this.style.height=_66f;
}else{
if(key=="x"){
this.style.left=_66f;
}else{
if(key=="y"){
this.style.top=_66f;
}else{
if(key=="transform"){
var reg=/scale\s*\(\s*(\d+\.\d+)\s*(\d+\.\d+)\s*\)/i;
var ar=reg.exec(_66f);
var _672=1;
var _673=1;
if(ar){
_672=ar[1];
_673=ar[2];
}
for(var i=0;i<this.childNodes.length;i++){
var _675=this.childNodes[i];
var _676=parseInt(_675.style.width);
var _677=parseInt(_675.style.height);
var left=parseInt(_675.style.left);
var top=parseInt(_675.style.top);
_675.style.width=_676*_672+"px";
_675.style.height=_677*_673+"px";
_675.style.left=left*_672+"px";
_675.style.top=top*_673+"px";
}
}
}
}
}
}
};
return _66d;
};
var createVMLCircle=function(){
var _67a=document.createElement("v:oval");
_67a.leftPos=0;
_67a.topPos=0;
_67a.rVal=0;
_67a.setAttribute=function(key,_67c){
if(key=="cx"){
if(this.rVal==0){
this.leftPos=parseInt(_67c);
}else{
this.leftPos=parseInt(_67c)-parseInt(this.rVal)+"px";
this.style.left=this.leftPos;
}
}else{
if(key=="cy"){
if(this.rVal==0){
this.topPos=parseInt(_67c);
}else{
this.topPos=parseInt(_67c)-parseInt(this.rVal)+"px";
this.style.top=this.topPos;
}
}else{
if(key=="stroke"){
this.strokecolor=_67c;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_67c)/1.2+"pt";
}else{
if(key=="fill"){
this.fillcolor=_67c;
}else{
if(key=="r"){
this.rVal=parseInt(_67c);
var last=(this.style.width)?parseInt(this.style.width):0;
this.style.width=this.rVal*2+"px";
this.style.height=this.rVal*2+"px";
if(last==0){
this.leftPos=this.leftPos-this.rVal;
this.topPos=this.topPos-this.rVal;
this.style.left=this.leftPos+"px";
this.style.top=this.topPos+"px";
}else{
this.style.left=this.leftPos+parseInt(last)/2-this.rVal;
this.style.top=this.topPos+parseInt(last)/2-this.rVal;
}
}
}
}
}
}
}
};
_67a.getAttribute=function(key){
if(key=="cx"){
var x=(parseInt(this.style.left)+parseInt(this.style.width)/2)?(parseInt(this.style.left)+parseInt(this.style.width)/2)+"px":0+"px";
return x;
}else{
if(key=="cy"){
var y=(parseInt(this.style.top)+parseInt(this.style.height)/2)?(parseInt(this.style.top)+parseInt(this.style.height)/2)+"px":0+"px";
return y;
}else{
if(key=="stroke"){
return this.strokecolor;
}else{
if(key=="stroke-width"){
return parseFloat(this.strokecolor)*1.2+"px";
}else{
if(key=="fill"){
return this.fillcolor;
}else{
if(key=="r"){
return parseInt(this.style.width)/2;
}
}
}
}
}
}
};
return _67a;
};
var createVMLEllipse=function(){
var _681=document.createElement("v:oval");
_681.leftPos=0;
_681.topPos=0;
_681.rxVal=0;
_681.ryVal=0;
_681.applyLinGradient=function(_682){
var _683=_682.stops[0];
var _684=_682.stops[_682.stops.length-1];
this.fillcolor=_683.stopColor;
var fill=document.createElement("v:fill");
fill.type="gradient";
fill.color2=_684.stopColor;
if(_682.y1==0){
var rads=Math.atan((_682.x2-_682.x1)/_682.y2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}else{
if(_682.y1>0){
var rads=Math.atan((_682.y2-_682.y1)/_682.x2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}
}
this.appendChild(fill);
};
_681.setAttribute=function(key,_689){
if(key=="cx"){
if(this.rxVal==0){
this.leftPos=parseInt(_689);
}else{
this.leftPos=parseInt(_689)-parseInt(this.rxVal)+"px";
this.style.left=this.leftPos;
}
}else{
if(key=="cy"){
if(this.ryVal==0){
this.topPos=parseInt(_689);
}else{
this.topPos=parseInt(_689)-parseInt(this.ryVal)+"px";
this.style.top=this.topPos;
}
}else{
if(key=="stroke"){
this.strokecolor=_689;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_689)/1.2+"pt";
}else{
if(key=="fill"){
if(_689.substring(0,3)=="url"){
var _68a=_689.substring(5,_689.length-1);
this.applyLinGradient(linearGradients[_68a]);
}else{
this.fillcolor=_689;
}
return;
}else{
if(key=="fill"){
this.fillcolor=_689;
}else{
if(key=="rx"){
this.rxVal=parseInt(_689);
var last=(this.style.width)?parseInt(this.style.width):0;
this.style.width=this.rxVal*2+"px";
if(last==0){
this.leftPos=this.leftPos-this.rxVal;
this.style.left=this.leftPos+"px";
}else{
this.style.left=this.leftPos+parseInt(last)/2-this.rxVal;
}
}else{
if(key=="ry"){
this.ryVal=parseInt(_689);
var last=(this.style.height)?parseInt(this.style.height):0;
this.style.height=this.ryVal*2+"px";
if(last==0){
this.topPos=this.topPos-this.ryVal;
this.style.top=this.topPos+"px";
}else{
this.style.top=this.topPos+parseInt(last)/2-this.ryVal;
}
}
}
}
}
}
}
}
}
};
_681.getAttribute=function(key){
if(key=="cx"){
var x=(parseInt(this.style.left)+parseInt(this.style.width)/2)?(parseInt(this.style.left)+parseInt(this.style.width)/2)+"px":0+"px";
return x;
}else{
if(key=="cy"){
var y=(parseInt(this.style.top)+parseInt(this.style.height)/2)?(parseInt(this.style.top)+parseInt(this.style.height)/2)+"px":0+"px";
return y;
}else{
if(key=="stroke"){
return this.strokecolor;
}else{
if(key=="stroke-width"){
return parseFloat(this.strokecolor)*1.2+"px";
}else{
if(key=="fill"){
if(value.substring(0,3)=="url"){
var _68f=value.substring(5,value.length-1);
this.applyLinGradient(linearGradients[_68f]);
}else{
this.fillcolor=value;
}
return;
}else{
if(key=="rx"){
return parseInt(this.style.width)/2;
}else{
if(key=="ry"){
return parseInt(this.style.height)/2;
}
}
}
}
}
}
}
};
return _681;
};
var LinearGradient=function(id,_691,_692,_693){
this.init(id,_691,_692,_693);
};
LinearGradient.prototype={init:function(id,_695,_696,_697){
this.id=id;
this.type="LinearGradient";
this.startColor=_695;
this.endColor=_696;
this.angle=_697;
}};
var createVMLRectangle=function(){
var _698=document.createElement("v:roundrect");
_698.rxy=0;
_698.applyGradient=function(_699){
if(_699.type=="LinearGradient"){
this.fillcolor=_699.startColor;
var fill=document.createElement("v:fill");
fill.type="gradient";
fill.color2=_699.endColor;
fill.angle=_699.angle;
this.appendChild(fill);
}
};
_698.applyLinGradient=function(_69b){
var _69c=_69b.stops[0];
var _69d=_69b.stops[_69b.stops.length-1];
this.fillcolor=_69c.stopColor;
var fill=document.createElement("v:fill");
fill.type="gradient";
fill.color2=_69d.stopColor;
if(_69b.y1==0){
var rads=Math.atan((_69b.x2-_69b.x1)/_69b.y2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}else{
if(_69b.y1>0){
var rads=Math.atan((_69b.y2-_69b.y1)/_69b.x2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}
}
this.appendChild(fill);
};
_698.setAttribute=function(key,_6a2){
if(key=="x"){
this.style.left=parseInt(_6a2)+"px";
return;
}else{
if(key=="y"){
this.style.top=parseInt(_6a2)+"px";
return;
}else{
if(key=="stroke"){
this.strokecolor=_6a2;
return;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_6a2)/1.2+"pt";
return;
}else{
if(key=="fill"){
if(_6a2.substring(0,3)=="url"){
var _6a3=_6a2.substring(5,_6a2.length-1);
this.applyLinGradient(linearGradients[_6a3]);
}else{
this.fillcolor=_6a2;
}
return;
}else{
if(key=="width"||key=="height"||key=="rx"||key=="ry"){
if(key=="width"){
this.style.width=parseInt(_6a2)+"px";
}else{
if(key=="height"){
this.style.height=parseInt(_6a2)+"px";
}else{
if(key=="rx"||key=="ry"){
if(parseInt(_6a2)){
this.rxy=parseInt(_6a2);
}
}
}
}
try{
if(this.rxy!=0){
var dim=parseInt(this.style.width);
var dimy=parseInt(this.style.height);
if(!dim){
dim=0;
}
if(!dimy){
dimy=0;
}
if(dimy<dim){
dim=dimy;
}
var _6a6=this.rxy/dim;
this.arcsize=_6a6;
}else{
this.arcsize=0;
}
}
catch(e){
}
return;
}
}
}
}
}
}
};
_698.getAttribute=function(key){
if(key=="x"){
var x=parseInt(this.style.left)?parseInt(this.style.left)+"px":0+"px";
return x;
}else{
if(key=="y"){
var y=parseInt(this.style.top)?parseInt(this.style.top)+"px":0+"px";
return y;
}else{
if(key=="stroke"){
return this.strokecolor;
}else{
if(key=="stroke-width"){
return parseFloat(this.strokecolor)*1.2+"px";
}else{
if(key=="fill"){
return this.fillcolor;
}else{
if(key=="width"){
return parseInt(this.style.width);
}else{
if(key=="height"){
return parseInt(this.style.height);
}
}
}
}
}
}
}
};
return _698;
};
var createVMLLine=function(){
var _6aa=document.createElement("v:line");
_6aa.setAttribute=function(key,_6ac){
if(key=="x1"){
this.x1=_6ac;
this.y1=this.y1?this.y1:0;
this.from=this.x1+" "+this.y1;
return;
}else{
if(key=="y1"){
this.y1=_6ac;
this.x1=this.x1?this.x1:0;
this.from=this.x1+" "+this.y1;
return;
}else{
if(key=="x2"){
this.x2=_6ac;
this.y2=this.y2?this.y2:0;
this.to=this.x2+" "+this.y2;
return;
}else{
if(key=="y2"){
this.y2=_6ac;
this.x2=this.x2?this.x2:0;
this.to=this.x2+" "+this.y2;
return;
}else{
if(key=="stroke"){
this.strokecolor=_6ac;
return;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_6ac)/1.2+"pt";
return;
}else{
if(key=="fill"){
this.fillcolor=_6ac;
return;
}
}
}
}
}
}
}
};
_6aa.getAttribute=function(key){
if(key=="x1"){
if(!this.x1){
return 0;
}
return x1;
}else{
if(key=="y1"){
if(!this.y1){
return 0;
}
return y1;
}else{
if(key=="x2"){
if(!this.x2){
return 0;
}
return x2;
}else{
if(key=="y2"){
if(!this.y2){
return 0;
}
return y2;
}else{
if(key=="stroke"){
return this.strokecolor;
}else{
if(key=="stroke-width"){
return parseFloat(this.strokecolor)*1.2+"px";
}else{
if(key=="fill"){
return this.fillcolor;
}else{
if(key=="width"){
return parseInt(this.style.width);
}else{
if(key=="height"){
return parseInt(this.style.height);
}
}
}
}
}
}
}
}
}
};
return _6aa;
};
var createVMLPolyLine=function(){
var _6ae=document.createElement("v:polyline");
_6ae.applyLinGradient=function(_6af){
var _6b0=_6af.stops[0];
var _6b1=_6af.stops[_6af.stops.length-1];
this.fillcolor=_6b0.stopColor;
var fill=document.createElement("v:fill");
fill.type="gradient";
fill.color2=_6b1.stopColor;
if(_6af.y1==0){
var rads=Math.atan((_6af.x2-_6af.x1)/_6af.y2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}else{
if(_6af.y1>0){
var rads=Math.atan((_6af.y2-_6af.y1)/_6af.x2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}
}
this.appendChild(fill);
};
_6ae.setAttribute=function(key,_6b6){
if(key=="points"){
this.points=_6b6;
}else{
if(key=="stroke"){
this.strokecolor=_6b6;
return;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_6b6)/1.2+"pt";
return;
}else{
if(key=="fill"){
if(_6b6.substring(0,3)=="url"){
var _6b7=_6b6.substring(5,_6b6.length-1);
this.applyLinGradient(linearGradients[_6b7]);
}else{
this.fillcolor=_6b6;
}
return;
}
}
}
}
};
return _6ae;
};
var createVMLPath=function(){
var _6b8=document.createElement("v:shape");
_6b8.style.width="21600";
_6b8.style.height="21600";
_6b8.coordsize="21600, 21600";
_6b8.style.position="absolute";
_6b8.applyLinGradient=function(_6b9){
var _6ba=_6b9.stops[0];
var _6bb=_6b9.stops[_6b9.stops.length-1];
this.fillcolor=_6ba.stopColor;
var fill=document.createElement("v:fill");
fill.type="gradient";
fill.color2=_6bb.stopColor;
if(_6b9.y1==0){
var rads=Math.atan((_6b9.x2-_6b9.x1)/_6b9.y2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}else{
if(_6b9.y1>0){
var rads=Math.atan((_6b9.y2-_6b9.y1)/_6b9.x2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}
}
this.appendChild(fill);
};
_6b8.setAttribute=function(key,_6c0){
if(key=="d"){
var _6c1=0;
var _6c2=0;
_6c0=_6c0.replace(/(\d*)((\.*\d*)(e ?-?\d*))/g,"$1");
var _6c3=_6c0.match(/([MLHVCSQTAZ].*?)(?=[MLHVCSQTAZ]|$)/gi);
var _6c4="";
for(var i=0;i<_6c3.length;i++){
var _6c6=_6c3[i].substring(0,1);
var _6c7=_6c3[i].substring(1,_6c3[i].length);
switch(_6c6){
case "M":
var _6c8=_6c7.split(",");
_6c1=parseInt(_6c8[0]);
_6c2=parseInt(_6c8[1]);
break;
case "A":
var _6c6="ae";
var args=_6c7.split(/[, ]+/);
args[0]=parseInt(args[0]);
args[1]=parseInt(args[1]);
args[2]=parseInt(args[2]);
args[3]=parseInt(args[3]);
args[4]=parseInt(args[4]);
args[5]=parseInt(args[5]);
_6c7=args[4]+" "+args[5]+" "+args[2]*2+" "+args[3]*2+" 0 360";
break;
case "l":
var _6c8=_6c7.split(",");
_6c8[0]=parseInt(_6c8[0])+parseInt(_6c1);
_6c8[1]=parseInt(_6c8[1])+parseInt(_6c2);
_6c1=parseInt(_6c8[0]);
_6c2=parseInt(_6c8[1]);
_6c7=_6c8[0]+","+_6c8[1]+" ";
break;
case "L":
var _6c8=_6c7.split(",");
_6c1=parseInt(_6c8[0]);
_6c2=parseInt(_6c8[1]);
break;
default:
}
_6c4+=_6c6+_6c7;
}
this.path=_6c4;
return;
}else{
if(key=="stroke"){
this.strokecolor=_6c0;
return;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_6c0)/1.2+"pt";
return;
}else{
if(key=="fill"){
if(_6c0.substring(0,3)=="url"){
var _6ca=_6c0.substring(5,_6c0.length-1);
this.applyLinGradient(linearGradients[_6ca]);
}else{
this.fillcolor=_6c0;
}
return;
}
}
}
}
};
_6b8.getAttribute=function(key){
alert("not implemented");
};
return _6b8;
};
var createVMLLinearGradient=function(){
return new LinGradient();
};
var createVMLStop=function(){
var _6cc=new Object();
_6cc.setAttribute=function(key,_6ce){
if(key=="offset"){
this.offset=_6ce;
}else{
if(key=="stop-color"){
this.stopColor=_6ce;
}
}
};
return _6cc;
};
var createVMLDefs=function(){
var _6cf=new Object();
_6cf=document.createElement("defs");
_6cf.appendChild=function(_6d0){
};
return _6cf;
};
var LinGradient=function(){
this.init();
};
LinGradient.prototype={init:function(){
this.stops=new Array();
},setAttribute:function(key,_6d2){
if(key=="id"){
this.id=_6d2;
linearGradients[this.id]=this;
}else{
if(key=="x1"){
this.x1=_6d2.substring(0,_6d2.length-1);
}else{
if(key=="y1"){
this.y1=_6d2.substring(0,_6d2.length-1);
}else{
if(key=="x2"){
this.x2=_6d2.substring(0,_6d2.length-1);
}else{
if(key=="y2"){
this.y2=_6d2.substring(0,_6d2.length-1);
}
}
}
}
}
},appendChild:function(stop){
this.stops.push(stop);
}};
function showHoleMenu(_6d4){
if((sign==null)||(sign.images==null)){
return;
}
log("showHoleMenu()");
var _6d5=$$("sign_image_editor").style;
if((_6d5.visibility=="hidden")&&(sign.images.length==0)){
pick_image();
return;
}
hideTextMenu();
var ofs=getOffset($$("sign_background_area"));
_6d5.left=ofs.x+ofs.w+1-$$("sign_image_editor").offsetWidth+"px";
_6d5.top=ofs.y-5+"px";
_6d5.visibility="visible";
var ofs=getOffset($$("sign_image_editor"));
for(var i=sign.images.length;i<1;i++){
$$("img_"+i).style.visibility="visible";
}
lastDragObject=$$("img_0");
ofs=getOffset(lastDragObject);
var _6d8=ofs.x-8;
for(var x=0;x<3;x++){
var _6da=ofs.y-8;
for(var y=0;y<3;y++){
var zoom=$$("zoom_"+x+"x"+y);
if(zoom){
if(_6d4){
zoom.style.left=_6d8+"px";
zoom.style.top=_6da+"px";
}
zoom.style.visibility="visible";
}
_6da+=ofs.h/2;
}
_6d8+=ofs.w/2;
}
}
function removeImage(){
if((sign==null)||(sign.images==null)){
return;
}
sign.delete_image(0);
hideHoleMenu();
text_changed();
if(lastDragObject){
lastDragObject.image_index=-1;
}
$$("img_0").image.image_name="";
$$("img_0").image.change_image();
}
function hideHoleMenu(){
if((sign==null)||(sign.images==null)){
return;
}
hideTextMenu();
log("hideHoleMenu()");
$$("sign_image_editor").style.visibility="hidden";
for(var i=sign.images.length;i<1;i++){
$$("img_"+i).style.visibility="hidden";
}
for(var x=0;x<3;x++){
for(var y=0;y<3;y++){
if((x!=1)||(y!=1)){
$$("zoom_"+x+"x"+y).style.visibility="hidden";
}
}
}
}
function pick_image(){
log("si: pick_image");
hideHoleMenu();
iPanel.openIFrame("imagelist_frame","InternalFramePanel",$$("pre_language").innerHTML+"/image/pick_image?sign_type=plastic",900,600);
}
function change_sign_image(_6e0,_6e1){
log("si: change_sign_image");
doClose();
var img=$$("img_0");
img.name=_6e0;
img.black_and_white=_6e1;
img.image.image_name=_6e0;
img.image.black_and_white=_6e1;
if(sign.images.length==0){
lastDragObject=img;
var _6e3=getOffset($$("sign"));
var _6e4=Math.min(_6e3.w,_6e3.h);
img.style.left=(_6e3.x+(_6e3.w-_6e4*0.4)/2).toFixed(0)+"px";
img.style.top=(_6e3.y+(_6e3.h-_6e4*0.4)/2).toFixed(0)+"px";
img.image.resize(_6e4*0.4,_6e4*0.4);
img.style.visibility="visible";
}
img.image.change_image();
update_image_position();
showHoleMenu(true);
}
var ExtSignImage=Class.create({image_name:"",black_and_white:true,initialize:function(_6e5,_6e6,_6e7,_6e8,_6e9,_6ea,_6eb,_6ec){
log("esi: init");
var _6ed=$$(_6e5);
while(_6ed.childNodes.length>=1){
_6ed.removeChild(_6ed.firstChild);
}
this.border_style=_6ea;
this.border=new SignForm(_6e5);
this.image_name=_6e6+"";
this.black_and_white=_6e7;
_6ed.name=_6e6;
_6ed.style.textAlign="left";
this.image=document.createElement("img");
this.image.style.width="0px";
this.image.style.height="0px";
this.image.style.zIndex="3000";
this.image.position="absolute";
this.pare=_6ed;
this.text_color=null;
this.resize(_6eb,_6ec);
this.set_style(_6e8,_6e9,this.border_style);
_6ed.appendChild(this.image);
},update_thumbnail:function(){
if($$("image_thumbnail")){
var _6ee=this.image_name;
if(_6ee==""){
_6ee="-1";
}
$$("image_thumbnail").src="/image/get/"+_6ee+"?width=80"+"&height=80"+"&text_color=000"+"&background_color=fff";
}
},change_image:function(){
log("esi: change_image");
this.resize(this.pare.clientWidth,this.pare.clientHeight);
this.reload();
this.update_thumbnail();
},set_style:function(_6ef,_6f0,_6f1){
log("esi: set_style");
if((_6f0!=this.background_color)||(_6ef!=this.text_color)){
this.background_color=_6f0;
this.text_color=_6ef;
this.change_image();
sign.update_image(0,_6ef);
}
if(this.border_style!=_6f1){
this.border_style=_6f1;
this.resize(this.pare.clientWidth,this.pare.clientHeight);
lastDragObject=this.pare;
update_image_position();
text_changed();
}
},reload:function(){
log("esi: reload");
if(this.image_name.length==0){
return;
}
var w=(((this.image.style.width+"").replace("px","")*1)/1).toFixed(0)*1;
var h=(((this.image.style.height+"").replace("px","")*1)/1).toFixed(0)*1;
if((w>=5)&&(w<=1000)&&(h>=5)&&(h<=800)){
var src=$$("pre_language").innerHTML+"/image/get/"+this.image_name+"?width="+w+"&height="+h;
if((sign.get_sign_type()!="aluminium_sign")||this.black_and_white){
src+="&text_color="+this.text_color.replace("#","")+"&background_color="+this.background_color.replace("#","");
}
this.image.src=src;
}
},resize:function(_6f5,_6f6){
log("esi: resize");
var _6f7=1;
if(this.border){
if(this.border_style&&(this.border_style!="none")){
var _6f8=this.border_style.split(",");
var h=_6f6;
_6f7=0.82;
if(_6f8[0]=="triangle_top"){
h*=0.866;
_6f7=0.48;
}
this.border.set_style(_6f8[0],_6f8[1],_6f5,h,null,this.text_color);
}else{
this.border.hide();
}
}
var w=(_6f5*_6f7).toFixed(0);
var h=(_6f6*_6f7).toFixed(0);
if(w>5){
this.pare.style.width=_6f5+"px";
this.image.style.paddingLeft=(_6f5*(1-_6f7)*0.5).toFixed(0)+"px";
this.image.style.width=w+"px";
}
if(h>5){
this.pare.style.height=_6f6+"px";
this.image.style.paddingTop=(_6f6*(1-_6f7)*0.5).toFixed(0)+"px";
this.image.style.height=h+"px";
}
}});
var fonts=[];
fonts["amerika sans"]="AMERIKA0";
fonts["apple garamond"]="APPLEGA0";
fonts["borisblackbloxx"]="BORISBL0";
fonts["caesar"]="CAESAR0";
fonts["daniel"]="DANIEL0";
fonts["day roman"]="DAYROMA0";
fonts["diogenes"]="DIOGENE0";
fonts["eurofurence"]="EUROFUR0";
fonts["existence light"]="EXISTEN0";
fonts["exmouth"]="EXMOUTH0";
fonts["fiolex girls"]="FIOLEXG0";
fonts["geosanslight"]="GEOSANS0";
fonts["jjstencil solid"]="JJSTENC0";
fonts["kronika"]="KRONIKA0";
fonts["old london"]="OLDLOND0";
fonts["old script"]="OLDSCRI0";
fonts["pad thai"]="PADTHAI0";
fonts["paper cuts"]="PAPERCU0";
fonts["rocky aoe"]="ROCKYAO0";
fonts["romanserif"]="ROMANSE0";
fonts["san remo"]="SANREMO0";
fonts["sf slapstick comic"]="SFSLAPS0";
fonts["starrytype"]="STARRYT0";
fonts["stencilia-a"]="STENCIL0";
fonts["stonehenge"]="STONEHE0";
fonts["street corner"]="STREETC0";
fonts["tintin"]="TINTIN0";
fonts["traveling _typewriter"]="TRAVELI0";
fonts["walkway bold"]="WALKWAY0";
fonts["arial rounded mt bold"]="ARIALRO0";
fonts["dymaxionscript"]="DYMAXIO0";
fonts["gill sans ultra bold"]="GILLSAN0";
fonts["gothice"]="GOTHICE0";
fonts["impossible - 0"]="IMPOSSI0";
fonts["vineta bt"]="VINETAB0";
var font_names=[];
font_names["arial"]="Arial";
font_names["arial black"]="Arial Black";
font_names["comic sans ms"]="Comic Sans MS";
font_names["courier new"]="Courier New";
font_names["georgia"]="Georgia";
font_names["impact"]="Impact";
font_names["tahoma"]="Tahoma";
font_names["times new roman"]="Times New Roman";
font_names["trebuchet ms"]="Trebuchet MS";
font_names["amerika sans"]="Amerika Sans";
font_names["apple garamond"]="Apple Garamond";
font_names["borisblackbloxx"]="BorisBlackBloxx";
font_names["caesar"]="Caesar";
font_names["daniel"]="Daniel";
font_names["day roman"]="Day Roman";
font_names["diogenes"]="Diogenes";
font_names["eurofurence"]="Eurofurence";
font_names["existence light"]="Existence Light";
font_names["exmouth"]="Exmouth";
font_names["fiolex girls"]="Fiolex Girls";
font_names["geosanslight"]="GeosansLight";
font_names["jjstencil solid"]="JJStencil Solid";
font_names["kronika"]="Kronika";
font_names["old london"]="Old London";
font_names["old script"]="Old Script";
font_names["pad thai"]="Pad Thai";
font_names["paper cuts"]="Paper Cuts";
font_names["rocky aoe"]="ROCKY AOE";
font_names["romanserif"]="RomanSerif";
font_names["san remo"]="San Remo";
font_names["sf slapstick comic"]="SF Slapstick Comic";
font_names["starrytype"]="StarryType";
font_names["stencilia-a"]="Stencilia-A";
font_names["stonehenge"]="Stonehenge";
font_names["street corner"]="Street Corner";
font_names["tintin"]="Tintin";
font_names["traveling _typewriter"]="Traveling _Typewriter";
font_names["walkway bold"]="Walkway Bold";
font_names["arial rounded mt bold"]="Arial Rounded Mt Bold";
font_names["dymaxionscript"]="DymaxionScript";
font_names["gill sans ultra bold"]="Gill Sans Ultra Bold";
font_names["gothice"]="GothicE";
font_names["impossible - 0"]="Impossible - 0";
font_names["vineta bt"]="Vineta Bt";
var saved_mouse_up_count;
function createCSSRule(rule,_6fc){
var _6fd="\n"+rule+"{\n";
for(var _6fe in _6fc){
_6fd+="\t"+_6fe+": "+_6fc[_6fe]+";\n";
}
_6fd+="}\n";
var _6ff=$$("delayed_fonts");
if($.browser.msie){
_6ff.styleSheet.cssText+=_6fd;
}else{
_6ff.appendChild(document.createTextNode(_6fd));
}
}
function download_font(_700){
var _701=(typeof (_700)!="undefined")?_700:$$("font_family").value.toLowerCase();
if(fonts[_701]&&(fonts[_701].length>0)){
var _702={};
_702["font-family"]=_701;
_702["font-style"]="normal";
_702["font-weight"]="normal";
var ext=$.browser.msie?"eot":"ttf";
_702["src"]="url(/signomatic/fonts/"+fonts[_701]+"."+ext+");";
createCSSRule("@font-face",_702);
fonts[_701]="";
}
}
function update_font_allowed_styles(_704){
if(!$$("engraved_sign")){
var _705=["arial","comic sans ms","courier new","georgia","tahoma","times new roman","trebuchet ms"];
var _706=["arial","courier new","georgia","times new roman","trebuchet ms"];
_704=_704.toLowerCase();
if(_705.indexOf(_704)==-1){
$(".cmd_bold").each(function(){
$(this).removeClass("selected");
$(this).addClass("disabled");
});
}else{
$(".cmd_bold").each(function(){
$(this).removeClass("disabled");
});
}
if(_706.indexOf(_704)==-1){
$(".cmd_em").each(function(){
$(this).removeClass("selected");
$(this).addClass("disabled");
});
}else{
$(".cmd_em").each(function(){
$(this).removeClass("disabled");
});
}
}
}
function font_updated(){
var font=$$("font_family").value;
if(font){
if(font.indexOf(",")>0){
font=font.split(",")[0];
}
update_font_allowed_styles(font);
}
}
function select_font(_708){
$$("font_family").value=_708.toLowerCase();
update_font_allowed_styles(_708);
if($$("font_name_field")){
$$("font_name_field").innerHTML=font_names[_708.toLowerCase()];
}
if($$("font_examples")){
$$("font_examples").style.visibility="hidden";
download_font();
}
}
function get_selected_font(_709){
}
function show_font_examples(){
var ofs=getOffset($$("font_family_table"));
$$("font_examples").style.left=(ofs.x+ofs.w-650)+"px";
$$("font_examples").style.top=ofs.y+ofs.h-1+"px";
$$("font_examples").style.visibility="visible";
var fi=$$("font_image_0");
if(!fi.img||(fi.img.length==0)){
var _70c=0;
while(fi){
fi.src="/images/fonts/"+fi.getAttribute("filename")+".png";
_70c++;
fi=$$("font_image_"+_70c);
}
}
}
function showTextMenu(){
if(!$$("sign_text_position")){
return;
}
if(sign==null){
return;
}
log("showTextMenu()");
var _70d=$$("sign_text_position").style;
var ofs=getOffset($$("sign_background_area"));
_70d.left=ofs.x+ofs.w+1-$$("sign_text_position").offsetWidth+"px";
_70d.top=ofs.y-5+"px";
_70d.visibility="visible";
saved_mouse_up_count=mouse_up_count;
}
function hideTextMenu(){
if(!$$("sign_text_position")){
return;
}
if(sign==null){
return;
}
if(saved_mouse_up_count==mouse_up_count){
return;
}
log("hideTextMenu()");
$$("sign_text_position").style.visibility="hidden";
}
function centerText(){
$$("sign_text").style.left="0px";
$$("sign_text").style.top="0px";
update_text_position();
}
function show_help(){
$$("help").style.display="block";
var ofs=getOffset($$("signomatic_help"));
var ofs2=getOffset($$("help"));
$$("help").style.left=ofs.x+"px";
$$("help").style.top=(ofs.y+ofs.h)+"px";
$$("help").style.display="block";
}
function toggleHangTypeMilitary(){
if($$("sign_colors").value=="#e8cca1,#8c4a20"){
if($("#hang_type_military").attr("checked")){
$("#hang_type_military").attr("checked",false);
}
$("#hang_type_military").attr("disabled",true);
}else{
$("#hang_type_military").attr("disabled",false);
}
}
var simpleeditor=Class.create({used_row_count:0,initialize:function(){
this.nrOfEditRows=0;
},removeChildren:function(_id){
var cell=$$(_id);
if(cell.hasChildNodes()){
while(cell.childNodes.length>=1){
cell.removeChild(cell.firstChild);
}
}
},setup:function(_713){
log("sedit: init");
this.nrOfEditRows=0;
this.removeChildren("editor_text_row");
this.removeChildren("editor_size_row");
this.removeChildren("editor_style_row");
var _714=null;
for(var i=0;i<Math.max(4,_713.row_count);i++){
var _716=_713.row_text(i);
var size=_716.between("fontSize = '","mm");
if(size==""){
size=_716.between("font-size: ","mm");
}
if(!sign.single_text_color()){
_714=_713.row_color(i)||_714||_713.text_color();
}
this.addRow(stripHTML(_716),size,_716.indexOf("<strong>")>0,_716.indexOf("<em>")>0,_716.indexOf("border-bottom")>0,_716.between("text-align: ",";"),_714);
}
setCheckedValue("row_cnt",_713.row_count);
var font=_713.font_family();
if(font){
if(font.indexOf(",")>0){
font=font.split(",")[0];
}
font=font.toLowerCase();
if(!is_font_ok(font_names[font])){
font="Arial";
}
if(!setSelectedValue("font_family",font)){
select_font(font);
}
download_font();
font_updated();
}
setSelectedValue("sign_border",_713.sign_border());
setSelectedValue("sign_style",_713.sign_style());
setSelectedValue("sign_colors",_713.colors());
setSelectedValue("sign_text_colors",_713.text_color());
setSelectedValue("sign_background_colors",_713.background_color());
if(_713.images.length>0){
setSelectedValue("image_border",_713.images[0].border);
if($$("image_color")){
$$("image_color").value=_713.images[0].color;
}
}
},getContent:function(_719){
var _71a=getCheckedValue("row_cnt")*1;
var _71b="";
var i;
if(_71a!=this.used_row_count){
this.used_row_count=_71a;
for(i=1;i<=_71a;i++){
$$("text"+i).style.background="url(/images/layout/signomatic_textFieldBgr.png)";
}
for(i=_71a+1;i<=this.nrOfEditRows;i++){
$$("text"+i).style.background="url(/images/layout/signomatic_textFieldBgr_hover.png)";
}
}
for(i=1;i<=_71a;i++){
var txt=$$("text"+i).value;
var _71e=$$("size"+i).value||"12";
_71e=_71e.replace(",",".");
if(!(((_71e*1)>0)&&((_71e*1)<1000))){
_71e=12;
}
var _71f=Math.min(_71e,Math.round(sign.max_height()/1.8));
var _720=(_71f*1.38*_719).toFixed(0)*1;
if((_720<sign.min_font_size())&&(txt.replaceAll(" ","").replaceAll("&nbsp;","")!="")){
_720=sign.min_font_size();
}
var _721=[];
text_align="center";
var _722=false;
var _723=0;
var _724="";
$("#editor_row"+i+" .cmd").each(function(){
var _725=$(this);
if(_725.hasClass("cmd_color")){
_724=";color: "+this.childNodes[0].style.backgroundColor;
}else{
if(_725.hasClass("selected")){
if(_725.hasClass("cmd_justify")){
text_align=this.id.substring(4);
}else{
if(_725.hasClass("cmd_u")){
_723=(_720/18).toFixed(1)*1;
}else{
if(_725.hasClass("cmd_em")){
_721.push("em");
_722=true;
}else{
_721.push(this.id.substring(4));
}
}
}
}
}
});
if(txt==""){
_723=0;
}
var _726="";
if(sign.is_vector_type()||(_720<5)||((_720<15)&&(_71a>=3))){
_726=";letter-spacing: 0px";
}
var _727="";
if((_722)&&(text_align!="left")&&(text_align!="right")){
_727=";_margin-left: "+_720+"px";
}
_71b+="<div "+"fontSize = '"+_71e+"mm' "+"style='text-align: "+text_align+_727+_726+_724+"; font-size: "+_720+"mm; font-family: "+$$("font_family").value+";'>";
if(_723>0){
_71b+="<p><span style='border-bottom: solid "+sign.text_color()+" "+_723+"mm;'>";
}else{
_71b+="<p>";
}
_721.reverse();
for(var j=0;j<_721.length;j++){
_71b+="<"+_721[j]+">";
}
txt=txt.replaceAll("&#","#%/").replaceAll("&","??amp;").replaceAll("??amp;","&amp;").replaceAll(" ","&nbsp;").replaceAll(String.fromCharCode(160),"&nbsp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll("#%/","&#");
if(txt.length==0){
txt="";
}
_71b+=txt;
_721.reverse();
for(var j=0;j<_721.length;j++){
_71b+="</"+_721[j].split(" ")[0]+">";
}
if(_723>0){
_71b+="</span>";
}
_71b+="</p></div>";
}
return _71b;
},PrepareRow:function(_row,_72a,_72b,_72c,_72d,_72e){
log("sedit: preparerow");
var _72f=this;
if(_72d=="center"){
_72d="";
}
$("#editor_row"+_row+" .cmd").each(function(){
var _730=$(this);
if($.browser.msie){
$("span",_730).mouseover(function(){
this.className="hvr";
}).mouseout(function(){
this.className="";
});
}
if(_730.hasClass("cmd_color")){
this.childNodes[0].style.backgroundColor=_72e;
}
if((_72a)&&(this.id=="cmd-strong")){
_730.addClass("selected");
}
if((_72b)&&(this.id=="cmd-em")){
_730.addClass("selected");
}
if((_72c)&&(this.id=="cmd-u")){
_730.addClass("selected");
}
if(this.id==("cmd-"+_72d)){
_730.addClass("selected");
}
_730.click(function(){
if(_730.hasClass("cmd_color")){
_72f.showTextColorMenu(_row);
return;
}
if(_730.hasClass("disabled")){
return;
}
if(_730.hasClass("cmd_justify")&&!_730.hasClass("selected")){
var _731=this.parentNode.id;
$("#"+_731+" .cmd_justify").each(function(){
$(this).removeClass("selected");
});
}
_730.toggleClass("selected");
return false;
});
});
},showCharMap:function(_row){
log("sedit: showcharmap");
$$("charmap").style.display="block";
var ofs=getOffset($$("charmap_link_"+_row));
var ofs2=getOffset($$("charmap"));
$$("charmap").style.left=ofs.x-(ofs2.w/2).toFixed(0)+"px";
$$("charmap").style.top=(ofs.y+ofs.h)+"px";
$$("charmap").row=_row;
$$("charmap").style.display="block";
var ofs=getOffset($$("charmap"));
$$("charmap_close").style.display="block";
$$("charmap_close").style.left=(ofs.x+ofs.w-130)+"px";
$$("charmap_close").style.top=(ofs.y-$$("charmap_close").offsetHeight)+"px";
},hideCharMap:function(){
$$("charmap").style.display="none";
$$("charmap_close").style.display="none";
},showTextColorMenu:function(_row){
log("sedit: showTextColorMenu");
$$("color_menu").style.display="block";
var ofs=getOffset($$("text_color_"+_row));
var ofs2=getOffset($$("color_menu"));
$$("color_menu").style.left=ofs.x-(ofs2.w/2).toFixed(0)+10+"px";
$$("color_menu").style.top=(ofs.y+ofs.h)+"px";
$$("color_menu").row=_row;
$$("color_menu").style.display="block";
this.selected_color_item=$$("text_color_"+_row).childNodes[0];
$$("color_menu").selected_row=_row;
},set_color_item_color:function(_738){
this.selected_color_item.style.background=_738;
},setMinRowCount:function(_cnt){
log("sedit: setMinRowCount");
if(getCheckedValue("row_cnt")<_cnt){
setCheckedValue("row_cnt",_cnt);
}
},addRow:function(_txt,_73b,_73c,_73d,_73e,_73f,_740){
log("sedit: addRow");
if(typeof (_txt)=="undefined"){
_txt="";
}
if(typeof (_73b)=="undefined"){
_73b="";
}
if(typeof (_740)=="undefined"){
_740=sign.row_color(sign.row_count-1);
}
if(_txt=="&nbsp;"){
_txt="";
}
var _741=document.createElement("div");
_741.className="editor_row";
this.nrOfEditRows+=1;
var cnt=this.nrOfEditRows;
_741.innerHTML=cnt+"&nbsp;"+"<INPUT TYPE=RADIO "+"NAME=\"row_cnt\""+"VALUE=\""+cnt+"\""+((cnt==1)?"checked ":"")+">&nbsp;"+"<input id=\"text"+cnt+"\" class=\"signomatic_text\" type=\"text\" onkeydown=\"simpleedit.setMinRowCount("+cnt+");\" value=\""+_txt.replaceAll("\"","&quot;")+"\"/>"+"&nbsp;"+"<a class=\"mycmd\" id=\"charmap_link_"+cnt+"\" title=\"Specialtecken\" onclick=\"simpleedit.showCharMap("+cnt+");\"><img src=\"/images/layout/signomatic_characterDropDownBtn.png\"></a>";
$$("editor_text_row").appendChild(_741);
var _741=document.createElement("div");
_741.className="editor_row";
_741.innerHTML="<input id=\"size"+cnt+"\" class=\"text_height\" type=\"text\" value=\""+_73b+"\" /><span class=\"mm\">mm</span>";
$$("editor_size_row").appendChild(_741);
var _741=document.createElement("div");
_741.id="editor_row"+cnt;
_741.className="editor_row";
var _743="<a class=\"cmd cmd_bold\" id=\"cmd-strong\" title=\"Fet\"><span style=\"background-position:-0px 0px\"></span></a><a class=\"cmd cmd_em\" id=\"cmd-em\" title=\"Kursiv\"><span style=\"background-position:-18px 0px\"></span></a>";
if($$("engraved_sign")){
_743+="<a class=\"cmd cmd_u\" id=\"cmd-u\" title=\"Understruken\"><span style=\"background-position:-36px 0px\"></span></a>";
}
_743+="<div class=\"sep\"></div><a class=\"cmd cmd_justify\" id=\"cmd-left\" title=\"V\u221a\xa7nster justerat\"><span style=\"background-position:-72px 0px\"></span></a><a class=\"cmd cmd_justify\" id=\"cmd-center\" title=\"Center justerat\"><span style=\"background-position:-90px 0px\"></span></a><a class=\"cmd cmd_justify\" id=\"cmd-right\" title=\"H\u221a\u2202ger justerat\"><span style=\"background-position:-108px 0px\"></span></a>";
if(_740){
_743+="<div class=\"sep\"></div><a class=\"cmd cmd_color\" id=\"text_color_"+cnt+"\" title=\"F\u221a\xa7rg\"><div></div></a>";
}
_743+="<br>";
_741.innerHTML=_743;
$$("editor_style_row").appendChild(_741);
$$("text_rows").style.height=cnt*25+45+"px";
this.PrepareRow(cnt,_73c,_73d,_73e,_73f,_740);
if(cnt>4){
setCheckedValue("row_cnt",cnt);
}
posScale();
}});
var charmap=[["&nbsp;","&#160;",true,"no-break space"],["&amp;","&#38;",true,"ampersand"],["&quot;","&#34;",true,"quotation mark"],["&cent;","&#162;",true,"cent sign"],["&euro;","&#8364;",true,"euro sign"],["&pound;","&#163;",true,"pound sign"],["&yen;","&#165;",true,"yen sign"],["&copy;","&#169;",true,"copyright sign"],["&reg;","&#174;",true,"registered sign"],["&trade;","&#8482;",true,"trade mark sign"],["&permil;","&#8240;",true,"per mille sign"],["&micro;","&#181;",true,"micro sign"],["&middot;","&#183;",true,"middle dot"],["&bull;","&#8226;",true,"bullet"],["&hellip;","&#8230;",true,"three dot leader"],["&prime;","&#8242;",true,"minutes / feet"],["&Prime;","&#8243;",true,"seconds / inches"],["&sect;","&#167;",true,"section sign"],["&para;","&#182;",true,"paragraph sign"],["&szlig;","&#223;",true,"sharp s / ess-zed"],["&lsaquo;","&#8249;",true,"single left-pointing angle quotation mark"],["&rsaquo;","&#8250;",true,"single right-pointing angle quotation mark"],["&laquo;","&#171;",true,"left pointing guillemet"],["&raquo;","&#187;",true,"right pointing guillemet"],["&lsquo;","&#8216;",true,"left single quotation mark"],["&rsquo;","&#8217;",true,"right single quotation mark"],["&ldquo;","&#8220;",true,"left double quotation mark"],["&rdquo;","&#8221;",true,"right double quotation mark"],["&sbquo;","&#8218;",true,"single low-9 quotation mark"],["&bdquo;","&#8222;",true,"double low-9 quotation mark"],["&lt;","&#60;",true,"less-than sign"],["&gt;","&#62;",true,"greater-than sign"],["&le;","&#8804;",true,"less-than or equal to"],["&ge;","&#8805;",true,"greater-than or equal to"],["&ndash;","&#8211;",true,"en dash"],["&mdash;","&#8212;",true,"em dash"],["&macr;","&#175;",true,"macron"],["&oline;","&#8254;",true,"overline"],["&curren;","&#164;",true,"currency sign"],["&brvbar;","&#166;",true,"broken bar"],["&uml;","&#168;",true,"diaeresis"],["&iexcl;","&#161;",true,"inverted exclamation mark"],["&iquest;","&#191;",true,"turned question mark"],["&circ;","&#710;",true,"circumflex accent"],["&tilde;","&#732;",true,"small tilde"],["&deg;","&#176;",true,"degree sign"],["&minus;","&#8722;",true,"minus sign"],["&plusmn;","&#177;",true,"plus-minus sign"],["&divide;","&#247;",true,"division sign"],["&frasl;","&#8260;",true,"fraction slash"],["&times;","&#215;",true,"multiplication sign"],["&sup1;","&#185;",true,"superscript one"],["&sup2;","&#178;",true,"superscript two"],["&sup3;","&#179;",true,"superscript three"],["&frac14;","&#188;",true,"fraction one quarter"],["&frac12;","&#189;",true,"fraction one half"],["&frac34;","&#190;",true,"fraction three quarters"],["&fnof;","&#402;",true,"function / florin"],["&int;","&#8747;",true,"integral"],["&sum;","&#8721;",true,"n-ary sumation"],["&infin;","&#8734;",true,"infinity"],["&radic;","&#8730;",true,"square root"],["&sim;","&#8764;",false,"similar to"],["&cong;","&#8773;",false,"approximately equal to"],["&asymp;","&#8776;",true,"almost equal to"],["&ne;","&#8800;",true,"not equal to"],["&equiv;","&#8801;",true,"identical to"],["&isin;","&#8712;",false,"element of"],["&notin;","&#8713;",false,"not an element of"],["&ni;","&#8715;",false,"contains as member"],["&prod;","&#8719;",true,"n-ary product"],["&and;","&#8743;",false,"logical and"],["&or;","&#8744;",false,"logical or"],["&not;","&#172;",true,"not sign"],["&cap;","&#8745;",true,"intersection"],["&cup;","&#8746;",false,"union"],["&part;","&#8706;",true,"partial differential"],["&forall;","&#8704;",false,"for all"],["&exist;","&#8707;",false,"there exists"],["&empty;","&#8709;",false,"diameter"],["&nabla;","&#8711;",false,"backward difference"],["&lowast;","&#8727;",false,"asterisk operator"],["&prop;","&#8733;",false,"proportional to"],["&ang;","&#8736;",false,"angle"],["&acute;","&#180;",true,"acute accent"],["&cedil;","&#184;",true,"cedilla"],["&ordf;","&#170;",true,"feminine ordinal indicator"],["&ordm;","&#186;",true,"masculine ordinal indicator"],["&dagger;","&#8224;",true,"dagger"],["&Dagger;","&#8225;",true,"double dagger"],["&Agrave;","&#192;",true,"A - grave"],["&Aacute;","&#193;",true,"A - acute"],["&Acirc;","&#194;",true,"A - circumflex"],["&Atilde;","&#195;",true,"A - tilde"],["&Auml;","&#196;",true,"A - diaeresis"],["&Aring;","&#197;",true,"A - ring above"],["&AElig;","&#198;",true,"ligature AE"],["&Ccedil;","&#199;",true,"C - cedilla"],["&Egrave;","&#200;",true,"E - grave"],["&Eacute;","&#201;",true,"E - acute"],["&Ecirc;","&#202;",true,"E - circumflex"],["&Euml;","&#203;",true,"E - diaeresis"],["&Igrave;","&#204;",true,"I - grave"],["&Iacute;","&#205;",true,"I - acute"],["&Icirc;","&#206;",true,"I - circumflex"],["&Iuml;","&#207;",true,"I - diaeresis"],["&ETH;","&#208;",true,"ETH"],["&Ntilde;","&#209;",true,"N - tilde"],["&Ograve;","&#210;",true,"O - grave"],["&Oacute;","&#211;",true,"O - acute"],["&Ocirc;","&#212;",true,"O - circumflex"],["&Otilde;","&#213;",true,"O - tilde"],["&Ouml;","&#214;",true,"O - diaeresis"],["&Oslash;","&#216;",true,"O - slash"],["&OElig;","&#338;",true,"ligature OE"],["&Scaron;","&#352;",true,"S - caron"],["&Ugrave;","&#217;",true,"U - grave"],["&Uacute;","&#218;",true,"U - acute"],["&Ucirc;","&#219;",true,"U - circumflex"],["&Uuml;","&#220;",true,"U - diaeresis"],["&Yacute;","&#221;",true,"Y - acute"],["&Yuml;","&#376;",true,"Y - diaeresis"],["&THORN;","&#222;",true,"THORN"],["&agrave;","&#224;",true,"a - grave"],["&aacute;","&#225;",true,"a - acute"],["&acirc;","&#226;",true,"a - circumflex"],["&atilde;","&#227;",true,"a - tilde"],["&auml;","&#228;",true,"a - diaeresis"],["&aring;","&#229;",true,"a - ring above"],["&aelig;","&#230;",true,"ligature ae"],["&ccedil;","&#231;",true,"c - cedilla"],["&egrave;","&#232;",true,"e - grave"],["&eacute;","&#233;",true,"e - acute"],["&ecirc;","&#234;",true,"e - circumflex"],["&euml;","&#235;",true,"e - diaeresis"],["&igrave;","&#236;",true,"i - grave"],["&iacute;","&#237;",true,"i - acute"],["&icirc;","&#238;",true,"i - circumflex"],["&iuml;","&#239;",true,"i - diaeresis"],["&eth;","&#240;",true,"eth"],["&ntilde;","&#241;",true,"n - tilde"],["&ograve;","&#242;",true,"o - grave"],["&oacute;","&#243;",true,"o - acute"],["&ocirc;","&#244;",true,"o - circumflex"],["&otilde;","&#245;",true,"o - tilde"],["&ouml;","&#246;",true,"o - diaeresis"],["&oslash;","&#248;",true,"o slash"],["&oelig;","&#339;",true,"ligature oe"],["&scaron;","&#353;",true,"s - caron"],["&ugrave;","&#249;",true,"u - grave"],["&uacute;","&#250;",true,"u - acute"],["&ucirc;","&#251;",true,"u - circumflex"],["&uuml;","&#252;",true,"u - diaeresis"],["&yacute;","&#253;",true,"y - acute"],["&thorn;","&#254;",true,"thorn"],["&yuml;","&#255;",true,"y - diaeresis"],["&Alpha;","&#913;",true,"Alpha"],["&Beta;","&#914;",true,"Beta"],["&Gamma;","&#915;",true,"Gamma"],["&Delta;","&#916;",true,"Delta"],["&Epsilon;","&#917;",true,"Epsilon"],["&Zeta;","&#918;",true,"Zeta"],["&Eta;","&#919;",true,"Eta"],["&Theta;","&#920;",true,"Theta"],["&Iota;","&#921;",true,"Iota"],["&Kappa;","&#922;",true,"Kappa"],["&Lambda;","&#923;",true,"Lambda"],["&Mu;","&#924;",true,"Mu"],["&Nu;","&#925;",true,"Nu"],["&Xi;","&#926;",true,"Xi"],["&Omicron;","&#927;",true,"Omicron"],["&Pi;","&#928;",true,"Pi"],["&Rho;","&#929;",true,"Rho"],["&Sigma;","&#931;",true,"Sigma"],["&Tau;","&#932;",true,"Tau"],["&Upsilon;","&#933;",true,"Upsilon"],["&Phi;","&#934;",true,"Phi"],["&Chi;","&#935;",true,"Chi"],["&Psi;","&#936;",true,"Psi"],["&Omega;","&#937;",true,"Omega"],["&alpha;","&#945;",true,"alpha"],["&beta;","&#946;",true,"beta"],["&gamma;","&#947;",true,"gamma"],["&delta;","&#948;",true,"delta"],["&epsilon;","&#949;",true,"epsilon"],["&zeta;","&#950;",true,"zeta"],["&eta;","&#951;",true,"eta"],["&theta;","&#952;",true,"theta"],["&iota;","&#953;",true,"iota"],["&kappa;","&#954;",true,"kappa"],["&lambda;","&#955;",true,"lambda"],["&mu;","&#956;",true,"mu"],["&nu;","&#957;",true,"nu"],["&xi;","&#958;",true,"xi"],["&omicron;","&#959;",true,"omicron"],["&pi;","&#960;",true,"pi"],["&rho;","&#961;",true,"rho"],["&sigmaf;","&#962;",true,"final sigma"],["&sigma;","&#963;",true,"sigma"],["&tau;","&#964;",true,"tau"],["&upsilon;","&#965;",true,"upsilon"],["&phi;","&#966;",true,"phi"],["&chi;","&#967;",true,"chi"],["&psi;","&#968;",true,"psi"],["&omega;","&#969;",true,"omega"],["&alefsym;","&#8501;",false,"alef symbol"],["&piv;","&#982;",false,"pi symbol"],["&real;","&#8476;",false,"real part symbol"],["&thetasym;","&#977;",false,"theta symbol"],["&upsih;","&#978;",false,"upsilon - hook symbol"],["&weierp;","&#8472;",false,"Weierstrass p"],["&image;","&#8465;",false,"imaginary part"],["&larr;","&#8592;",true,"leftwards arrow"],["&uarr;","&#8593;",true,"upwards arrow"],["&rarr;","&#8594;",true,"rightwards arrow"],["&darr;","&#8595;",true,"downwards arrow"],["&harr;","&#8596;",true,"left right arrow"],["&crarr;","&#8629;",false,"carriage return"],["&lArr;","&#8656;",false,"leftwards double arrow"],["&uArr;","&#8657;",false,"upwards double arrow"],["&rArr;","&#8658;",false,"rightwards double arrow"],["&dArr;","&#8659;",false,"downwards double arrow"],["&hArr;","&#8660;",false,"left right double arrow"],["&there4;","&#8756;",false,"therefore"],["&sub;","&#8834;",false,"subset of"],["&sup;","&#8835;",false,"superset of"],["&nsub;","&#8836;",false,"not a subset of"],["&sube;","&#8838;",false,"subset of or equal to"],["&supe;","&#8839;",false,"superset of or equal to"],["&oplus;","&#8853;",false,"circled plus"],["&otimes;","&#8855;",false,"circled times"],["&perp;","&#8869;",false,"perpendicular"],["&sdot;","&#8901;",false,"dot operator"],["&lceil;","&#8968;",false,"left ceiling"],["&rceil;","&#8969;",false,"right ceiling"],["&lfloor;","&#8970;",false,"left floor"],["&rfloor;","&#8971;",false,"right floor"],["&lang;","&#9001;",false,"left-pointing angle bracket"],["&rang;","&#9002;",false,"right-pointing angle bracket"],["&loz;","&#9674;",true,"lozenge"],["&spades;","&#9824;",false,"black spade suit"],["&clubs;","&#9827;",true,"black club suit"],["&hearts;","&#9829;",true,"black heart suit"],["&diams;","&#9830;",true,"black diamond suit"],["&ensp;","&#8194;",false,"en space"],["&emsp;","&#8195;",false,"em space"],["&thinsp;","&#8201;",false,"thin space"],["&zwnj;","&#8204;",false,"zero width non-joiner"],["&zwj;","&#8205;",false,"zero width joiner"],["&lrm;","&#8206;",false,"left-to-right mark"],["&rlm;","&#8207;",false,"right-to-left mark"],["&shy;","&#173;",false,"soft hyphen"]];
function renderCharMapHTML(){
log("renderCharMapHTML");
var _744=20,_745=20,_746=20,i;
var html="<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\""+(_745*_744)+"\"><tr height=\""+_746+"\">";
var cols=-1;
for(i=0;i<charmap.length;i++){
if(charmap[i][2]==true){
cols++;
html+=""+"<td class=\"charmap\">"+"<a onmouseover=\"previewChar('"+charmap[i][1].substring(1,charmap[i][1].length)+"','"+charmap[i][0].substring(1,charmap[i][0].length)+"','"+charmap[i][3]+"');\" onfocus=\"previewChar('"+charmap[i][1].substring(1,charmap[i][1].length)+"','"+charmap[i][0].substring(1,charmap[i][0].length)+"','"+charmap[i][3]+"');\" href=\"javascript:void(0)\" onclick=\"insertChar('"+charmap[i][1].substring(2,charmap[i][1].length-1)+"');\" onclick=\"return false;\" onmousedown=\"return false;\" title=\""+charmap[i][3]+"\">"+charmap[i][1]+"</a></td>";
if((cols+1)%_744==0){
html+="</tr><tr height=\""+_746+"\">";
}
}
}
if(cols%_744>0){
var padd=_744-(cols%_744);
for(var i=0;i<padd-1;i++){
html+="<td width=\""+_745+"\" height=\""+_746+"\" class=\"charmap\">&nbsp;</td>";
}
}
html+="</tr></table>";
return html;
}
function insertChar(chr){
simpleedit.hideCharMap();
$$("text"+$$("charmap").row).value+="&#"+chr+";";
}
function previewChar(_74c,_74d,_74e){
var elmA=document.getElementById("codeA");
var elmV=document.getElementById("codeV");
var elmN=document.getElementById("codeN");
if(_74c=="#160;"){
elmV.innerHTML="__";
}else{
elmV.innerHTML="&"+_74c;
}
elmA.innerHTML="&amp;"+_74d;
elmN.innerHTML=_74e;
}
var signForm;
var simpleedit=null;
var font_size_changer=1;
var back_text="";
var text_changed_disabled=true;
var sign;
var old_font_divider=1;
saved_text_width=0;
saved_text_height=0;
font_divider=1;
var sign_data_index=0;
function show_single_sign(){
if(sign_data_index<sign_data.length){
var i=sign_data_index;
if(sign_data[i].length>10){
sign=new Sign(sign_data[i]);
var _753=sign.price;
signcode=jQuery.parseJSON(sign_data[i]);
signForm=new SignForm("sign"+i);
$$("sign"+i).sign_form=signForm;
if(!$$("sign"+i+"_background_area").onclick){
$$("sign"+i+"_background_area").onclick=function(){
sign=new Sign(sign_data[i]);
sign.save_to_cookie();
sign.edit();
};
}
text_changed(sign.text(),"sign"+i);
position_sign_images("sign"+i);
calculatePrice();
_753=sign.price;
setTimeout("text_changed(sign.text(), 'sign"+i+"');",250);
if(sign.fixed_price!=0){
$$("sign"+i+"_background_area").style.background="url(/images/signs/"+sign.sign_model+".gif) no-repeat top center";
}
if($$("sign"+i+"_description")){
var desc=$$("translate_dimensions").innerHTML+": "+local_measurement(signcode.width)+" x "+local_measurement(signcode.height)+" "+local_measurement_str()+".";
if(sign.get_sign_type()=="product"){
desc="";
}
$$("sign"+i+"_description").innerHTML=desc+" "+$$("translate_price").innerHTML+": "+local_price(_753)+".";
}
}
$$("img_0").id="";
sign_data_index++;
setTimeout("show_single_sign();",250);
}
}
function init_js_sign(){
log("init_js_sign");
$(".price").each(function(){
this.innerHTML=local_price(this.innerHTML);
});
try{
text_changed_disabled=true;
prepareHiddenSign();
text_changed_disabled=false;
}
catch(e){
log("init_js_sign_failed");
return;
}
view_mode=typeof (sign_data)!="undefined";
if(view_mode){
log("view mode");
sign_data_index=0;
setTimeout("show_single_sign();",300);
return;
}
log("skyltomaten mode");
signForm=new SignForm("sign");
simpleedit=new simpleeditor();
simpleedit.setup(sign);
if(!sizeOK()){
sign.fixed_height=0;
sign.fixed_width=0;
sign.save_to_cookie();
}
if(sign.get_sign_type()=="aluminium_sign"){
if(sign.fixed_width!=0){
sign.fixed_width=round_mm_width(sign.fixed_width);
}
if(sign.fixed_height==0){
sign.fixed_height=round_mm_height(sign.fixed_height);
}
}
text_changed();
document.onkeydown=keyHandler;
if($$("sign_format_width")){
if(sign.fixed_width>0){
setCheckedValue("sign_format_width_types","fixed");
set_current_sign_width();
}
if((sign.fixed_height>0)||($$("sign_format_width_radio"))){
setCheckedValue("sign_format_height_types","fixed");
set_current_sign_height();
}
}
setCheckedValue("sign_format_hang_types",sign.hang_type());
try{
sign_height_changed();
sign_width_changed();
}
catch(e){
}
sign_hang_type_changed();
position_sign_images("sign");
set_sign_image("sign");
var ofs=getOffset($$("sign_background_area"));
$$("sign_scale").style.left="80%";
posScale();
hideHoleMenu();
calculatePrice();
backup_text="";
log("startup done");
text_updated_timer=setInterval(function(){
if(backup_text!=getContent()){
backup_text=getContent();
sign.text(backup_text);
}
},500);
$(".sign_object").each(function(){
var _756=$(this);
_756.mouseover(function(){
_756.addClass("sign_object_hover");
}).mouseout(function(){
this.className="sign_object";
});
});
$(".button").each(function(){
var _757=$(this);
if($.browser.msie){
_757.mouseover(function(){
_757.addClass("hvr");
}).mouseout(function(){
this.className="button";
});
}
});
$(".small_square").each(function(){
this.onclick=function(){
$$("sign_background_area").style.background=this.style.background;
};
});
}
function getContent(){
if(typeof (tinyMCE)!="undefined"){
return tinyMCE.get("text0").getContent();
}else{
if(!view_mode){
if($$("sign_colors")){
sign.colors($$("sign_colors").value);
}
if(sign.get_sign_type()=="name_sign"){
toggleHangTypeMilitary();
}else{
if($$("sign_background_colors")){
sign.colors($$("sign_background_colors").value+","+$$("sign_text_colors").value);
}else{
if($$("sign_text_colors")){
sign.colors(sign.v_background_color+","+$$("sign_text_colors").value);
}
}
}
if(sign.get_sign_type()=="text"){
sign.fixed_width=0;
sign.fixed_height=0;
}
if(sign.hang_type()=="hanging"){
$$("sign_hanging_container").style.backgroundColor=sign.background_color();
if(sign.width<150){
$$("sign_hanging_container").style.backgroundColor=sign.background_color();
$$("sign_hanging_container").style.visibility="visible";
}else{
$$("sign_hanging_container").style.visibility="hidden";
}
}
if(sign.hang_type()=="suction_cups"){
$$("sign_suction_cup_container").style.backgroundColor=sign.background_color();
$$("sign_suction_cup_left").style.backgroundColor=sign.background_color();
$$("sign_suction_cup_right").style.backgroundColor=sign.background_color();
if(sign.v_sign_style!="oval"&&sign.v_sign_style!="thorny"){
if(sign.height<200&&sign.width<150){
$$("sign_suction_cup_container").style.display="block";
$$("sign_suction_cup_left").style.display="none";
$$("sign_suction_cup_right").style.display="none";
}else{
if(sign.height<200&&sign.width>=150){
$$("sign_suction_cup_left").style.display="block";
$$("sign_suction_cup_right").style.display="block";
$$("sign_suction_cup_container").style.display="none";
}else{
$$("sign_suction_cup_container").style.display="none";
$$("sign_suction_cup_left").style.display="none";
$$("sign_suction_cup_right").style.display="none";
}
}
}else{
$$("sign_suction_cup_container").style.display="none";
$$("sign_suction_cup_left").style.display="none";
$$("sign_suction_cup_right").style.display="none";
}
}else{
$$("sign_suction_cup_container").style.display="none";
$$("sign_suction_cup_left").style.display="none";
$$("sign_suction_cup_right").style.display="none";
}
var _758=[];
if(sign.get_sign_type()=="plastic_sign"&&!sign.is_wood_sign()){
_758.push("none","screw","tape","tape_and_screw","hanging","magnet_rug","table_stand","suction_cups");
}else{
if(sign.get_sign_type()=="plastic_sign"&&sign.is_wood_sign()){
_758.push("none","screw","hanging");
}else{
if(sign.get_sign_type()=="aluminium_sign"){
_758.push("none","screw","bockad","pole","wall_distance");
}else{
if(sign.get_sign_type()=="acryl_sign"){
_758.push("none","screw","wall_distance");
}else{
if(sign.get_sign_type()=="name_sign"){
_758.push("needle","magnet","military","pen_holder","leather_pocket");
}else{
if(sign.get_sign_type()=="text"){
}
}
}
}
}
}
if(jQuery.inArray(sign.v_hang_type,_758)>0){
sign.v_hang_type=sign.v_hang_type;
}else{
sign.v_hang_type="";
}
if(sign.sign_type=="plastic_sign"){
var _759=["","none","round","oval","thorny"];
var _75a=jQuery.inArray(sign.v_sign_style,_759);
if(_75a>0){
if($$("hang_type_hanging")){
$$("hang_type_hanging").style.display="";
}
if($$("hang_type_suction_cups")){
$$("hang_type_suction_cups").style.display="";
}
var _75b=["","none","round"];
var _75c=jQuery.inArray(sign.v_sign_style,_75b);
var _75d=140;
if((_75c>0)&&(sign.width>=_75d)){
if($$("hang_type_table_stand")){
$$("hang_type_table_stand").style.display="";
}
}else{
if($$("hang_type_table_stand")){
$$("hang_type_table_stand").style.display="none";
}
if(sign.v_hang_type=="table_stand"){
sign.v_hang_type="";
$(".sign_format_hang_types").attr("checked",false);
}
}
}else{
if($$("hang_type_hanging")){
$$("hang_type_hanging").style.display="none";
}
if($$("hang_type_suction_cups")){
$$("hang_type_suction_cups").style.display="none";
}
if(sign.v_hang_type=="hanging"||sign.v_hang_type=="suction_cups"){
sign.v_hang_type="";
$(".sign_format_hang_types").attr("checked",false);
}
}
}
if(!sign.get_sign_type()=="product"){
if(sign.text_color()=="#fff"){
$$("sign_background_area").style.background="#ccc";
$$("sign_hanging_container").style.backgroundImage="url(/images/hanging_cccccc.png)";
}else{
$$("sign_background_area").style.background="#f0f0ee";
$$("sign_hanging_container").style.backgroundImage="url(/images/hanging.png)";
}
}
sign.sign_style($$("sign_style").value);
if($$("sign_border")){
sign.sign_border($$("sign_border").value);
if($$("sign_border_color")){
$$("sign_border_color").style.display=sign.sign_border()=="none"?"none":"block";
}
}else{
sign.sign_border("none");
}
if($$("img_0").image){
var _75e=$$("image_border")?$$("image_border").value:"none";
var _75f=$$("image_color")?$$("image_color").value:sign.text_color();
$$("img_0").image.set_style(_75f,sign.background_color(),_75e);
}
return simpleedit.getContent(font_size_changer);
}else{
return sign.text();
}
}
}
var sign_images=new Array();
function keyHandler(e){
var _761=0;
try{
_761=e.keyCode?e.keyCode:e.charCode;
}
catch(e){
if(window.event){
_761=window.event.keyCode;
}
}
if(_761==119){
submit_sign();
return false;
}
return true;
}
function get_key(e){
var key;
if(window.event){
key=window.event.keyCode;
}else{
if(e){
key=e.which;
}else{
return "";
}
}
if(key==32){
return " ";
}
if((key==null)||(key<65)||((key>=112)&&(key<=130))){
return "";
}
if(key>=96&&key<=106){
return (key-96).toString();
}
return String.fromCharCode(key);
}
function numbersonly(e){
var key=get_key(e);
return (key=="")||(("0123456789").indexOf(key)>-1);
}
function getTextSize(text,_767){
var test=$$("hidden_get_text_width");
test.style.height="10px";
test.style.height="auto";
test.innerHTML=text;
test.style.paddingLeft=_767+"mm";
test.style.paddingRight=_767+"mm";
var _769=new Object();
_769.x=test.clientWidth+1;
_769.y=test.clientHeight+1;
return _769;
}
function getCheckedDescription(_76a){
var _76b=document.forms["sign_form"].elements[_76a];
if(!_76b){
return null;
}
var _76c=_76b.length;
if(_76c==undefined){
if(_76b.checked){
return _76b.getAttribute("description");
}else{
return null;
}
}
for(var i=0;i<_76c;i++){
if(_76b[i].checked){
return _76b[i].getAttribute("description");
}
}
return "";
}
function getCheckedValue(_76e){
if(document.forms["sign_form"]){
var _76f=document.forms["sign_form"].elements[_76e];
}
if(!_76f){
return null;
}
var _770=_76f.length;
if(_770==undefined){
if(_76f.checked){
return _76f.value;
}else{
return null;
}
}
for(var i=0;i<_770;i++){
if(_76f[i].checked){
return _76f[i].value;
}
}
return "";
}
function setCheckedValue(_772,_773){
log("setCheckedValue");
if(_773==null){
return;
}
var _774=document.forms["sign_form"].elements[_772];
if(!_774){
return false;
}
var _775=_774.length;
if(_775==undefined){
_774.checked=(_774.value==_773.toString());
return false;
}
var _776=false;
for(var i=0;i<_775;i++){
_774[i].checked=false;
if((_773)&&(_774[i].value==_773.toString())){
_774[i].checked=true;
_776=true;
}
}
return true;
}
function setSelectedValue(_778,_779){
var _77a=$$(_778);
if(!_77a){
return false;
}
if(!_779){
return false;
}
if(!_77a.options){
return false;
}
for(var i=0;i<_77a.options.length;i++){
var _77c=_77a.options[i].value+"";
_779=_779.toLowerCase();
if(_77c.toLowerCase().match(_779)){
_77a.value=_77a.options[i].value;
return true;
}
}
return false;
}
function set_sign_image(_77d){
var _77e=$$(_77d+"_background_image");
if(_77e){
var pos=getOffset($$("sign_hanging_container"));
_77e.style.top=pos.y+pos.h+"px";
}
}
function position_sign_images(_780){
$$(_780+"_text").style.left=sign.text_position().x*font_divider+"mm";
$$(_780+"_text").style.top=sign.text_position().y*font_divider+"mm";
if(!sign.images){
return;
}
log("position_sign_images");
var _781=$$(_780);
log("getOfs");
var _782=getOffset(_781);
log("getOfs done");
var ofs=null;
if(!view_mode){
ofs=getOffset($$("sign_image_editor"));
for(var i=0;i<3;i++){
for(var j=0;j<3;j++){
makeDraggable($$("zoom_"+i+"x"+j));
}
}
}
var _786,_787,x,y;
for(var i=0;i<1;i++){
var _78a=$$("img_"+i);
var _78b;
if(i<sign.images.length){
_78a.image_index=i;
_78a.name=sign.images[i].name;
_78a.black_and_white=sign.images[i].bw;
_786=millimetersToPixels(sign.images[i].w);
_787=millimetersToPixels(sign.images[i].h);
x=millimetersToPixels(sign.images[i].x)+_782.x;
y=millimetersToPixels(sign.images[i].y)+_782.y;
_78b=sign.images[i].border;
color=sign.images[i].color||sign.text_color();
}else{
if(ofs==null){
return;
}
_78a.image_index=-1;
_78a.name="";
_78a.black_and_white=true;
var _786=50;
var _787=50;
var x=ofs.x+5;
var y=ofs.y+5;
_78b="none";
color="#000";
}
var _78c=new ExtSignImage("img_"+i,_78a.name,_78a.black_and_white,color,sign.background_color(),_78b,_786,_787);
if(!view_mode){
makeDraggable(_78a);
}
_78a.image=_78c;
_78a.style.zIndex=1000;
_78a.style.left=x+"px";
_78a.style.top=y+"px";
}
log("position_sign_images done");
}
function update_text_position(){
sign.text_position(pxToMM($$("sign_text").offsetLeft,3),pxToMM($$("sign_text").offsetTop,3));
$$("sign_text").style.left=(sign.text_position().x*font_divider).toFixed(2)+"mm";
$$("sign_text").style.top=(sign.text_position().y*font_divider).toFixed(2)+"mm";
var _78d=getOffset($$("sign"));
if(!$$("sign_text_position")){
return;
}
$$("text_pos_x").value=sign.text_position().x.toFixed(0);
$$("text_pos_y").value=sign.text_position().y.toFixed(0);
}
function update_image_position(){
log("update_image_position");
var _78e=getOffset($$("sign"));
var main=lastDragObject;
if(!main){
return;
}
if((main.image_index>=0)){
var _790=sign.images.length;
sign.delete_image(main.image_index);
if(_790==sign.images.length){
alert("error");
}
}
var _791=getPosition(main);
main.image_index=sign.add_image(main.name,main.black_and_white,main.image.border_style,pxToMM(_791.x-_78e.x,3),pxToMM(_791.y-_78e.y,3),pxToMM(_791.w,3),pxToMM(_791.h,3),$$("image_color")?$$("image_color").value:sign.text_color());
if($$("image_pos_x")){
$$("image_pos_x").value=pxToMM(_791.x-_78e.x);
$$("image_pos_y").value=pxToMM(_791.y-_78e.y);
$$("image_pos_x_neg").value=pxToMM((_78e.x+_78e.w)-(_791.x+_791.w));
$$("image_pos_y_neg").value=pxToMM((_78e.y+_78e.h)-(_791.y+_791.h));
$$("image_width").value=pxToMM(_791.w);
$$("image_height").value=pxToMM(_791.h);
}
}
var relative_mm_value=115;
function millimetersToPixels(_792){
return Math.round(_792*($$("hidden_sign").clientWidth*font_divider)/relative_mm_value);
}
function pxToMM(_px,_dec){
if(!_dec){
_dec=0;
}
var _795=(_px*relative_mm_value/($$("hidden_sign").clientWidth*font_divider)).toFixed(_dec)*1;
return _795;
}
function textRowSpacing(){
return 0;
}
function rowFillSpace(){
if(sign.fixed_height==0){
return 0;
}
return (sign.fixed_height-signTextHeight())/(sign.row_count*2/font_divider);
}
function signTextHeight(){
return pxToMM(saved_text_height);
}
function signHeight(){
if(sign.fixed_height>0){
return sign.fixed_height;
}
return Math.max(signTextHeight(),sign.min_height());
}
function signHeightStr(){
return local_measurement_string(signHeight());
}
function signTextWidth(){
return pxToMM(saved_text_width);
}
function signWidth(){
if(sign.fixed_width>0){
return Math.max(sign.fixed_width,sign.min_width());
}
return Math.max(signTextWidth(),sign.min_width());
}
function signWidthStr(){
return local_measurement_string(signWidth());
}
function signHeightChanged(){
$$("sign_height").style.marginTop="0px";
$$("sign_height").style.height=$$("sign").clientHeight+"px";
var _796=Math.round($$("sign").clientHeight/2).toFixed(0)-12;
if(_796<0){
_796=0;
}
$$("sign_height_text").style.paddingTop=_796+"px";
$$("sign_width").innerHTML=signWidthStr();
calculatePrice();
}
function change_text_size(_797){
var _798=_797.indexOf("mm;");
if(_798>=0){
var _799=_797.indexOf(" ",_798-5)+1;
var _79a=(_797.substring(_799,_798));
_79a=(_79a*1)*font_divider;
_797=_797.substring(0,_799)+_79a+"mm ;"+_797.substring(_798+3);
return change_text_size(_797);
}
return _797;
}
function round_mm_width(_79b){
if(sign.get_sign_type()!="aluminium_sign"){
return _79b;
}
if(_79b==0){
return _79b;
}
if(_79b<=200){
return 200;
}
if(_79b<=300){
return 300;
}
if(_79b<=400){
return 400;
}
if(_79b<=500){
return 500;
}
if(_79b<=600){
return 600;
}
if(_79b<=700){
return 700;
}
if(_79b<=800){
return 800;
}
if(_79b<=1000){
return 1000;
}
if(_79b<=1250){
return 1250;
}
return 1500;
}
function round_width(_79c){
return millimetersToPixels(round_mm_width(pxToMM(_79c)));
}
function round_mm_height(_79d){
if(sign.get_sign_type()!="aluminium_sign"){
return _79d;
}
if(_79d==0){
return _79d;
}
if(_79d<=100){
return 100;
}
if(_79d<=150){
return 150;
}
if(_79d<=200){
return 200;
}
if(_79d<=300){
return 300;
}
if(_79d<=400){
return 400;
}
if(_79d<=500){
return 500;
}
return 600;
}
function round_height(_79e){
return millimetersToPixels(round_mm_height(pxToMM(_79e)));
}
function getMaxFontSize(_79f){
var _7a0=0;
var _7a1=3;
while((_7a0=_79f.indexOf("font-size: ",_7a0))!=-1){
var _7a2=_79f.substring(_7a0+11,_79f.indexOf("mm",_7a0+11));
if(_7a2>_7a1){
_7a1=_7a2;
}
_7a0++;
}
return _7a1;
}
function only_numbers(_7a3){
var text=stripHTML(_7a3).replaceAll("&nbsp;","").replaceAll("-","");
for(var i=0;i<text.length;i++){
var ch=text.charAt(i);
if((ch<"0")||(ch>"9")){
return false;
}
}
return true;
}
function only_uppercase(_7a7){
var text=stripHTML(_7a7).replaceAll("&nbsp;","");
return text==text.toUpperCase();
}
function padded_sign_text(_7a9,_7aa){
result="";
for(var i=0;i<_7a9.length;i++){
result+=change_text_size(_7a9[i].replace("<p></p>","<p>&nbsp; </p>"));
}
var _7ac=getTextSize(result,0);
var _7ad=pxToMM(_7ac.x);
var _7ae=pxToMM(_7ac.y);
var _7af=signForm.padding(_7ad,_7ae,sign.sign_border(),(sign.get_sign_type()=="name_sign")||(sign.get_sign_type()=="stamp")?0:1);
var pt=(_7af.top*font_divider)+"mm ";
var pr=(_7af.right*font_divider)+"mm ";
var pb=(_7af.bottom*font_divider)+"mm ";
var pl=(_7af.left*font_divider)+"mm";
var _7b4="";
if(!view_mode){
var _7b4="onmousedown='initDragDrop(this,event);' id='sign_text_hover' class='sign_object' onmouseover='$(this).addClass(\"sign_object_hover\");' onmouseout='this.className = \"sign_object\";'";
}else{
var _7b4="class='sign_object'";
}
result="<div style='padding: "+pt+pr+pb+pl+";'><div "+_7b4+">"+result+"</div></div>";
return result;
}
function create_sign_text(_7b5){
var _7b6=3;
for(var i=0;i<_7b5.length;i++){
_7b6=Math.max(_7b6,getMaxFontSize(_7b5[i]));
}
if(_7b6<=4){
_7b6=0;
}
var _7b8=sign.get_sign_type()=="text";
if(_7b8){
_7b6=0;
}
var m_w="mm "+((_7b6*0.1+6)*font_divider/2).toFixed(1)+"mm ";
var _7ba=0;
var _7bb=0;
if((_7b5.length>2)||!only_uppercase(_7b5.join())){
_7ba=((_7b6*0.04)*font_divider/2).toFixed(1);
_7bb=((_7b6*0.08)*font_divider/2).toFixed(1);
if(!only_uppercase(_7b5.join())){
_7ba=((_7b6*0.08+2)*font_divider/2).toFixed(1);
_7bb=((_7b6*0.27+2)*font_divider/2).toFixed(1);
}
}
var _7bc="<div style=\"margin:"+_7ba+m_w+_7bb+m_w+";\">";
var txt=_7b5;
txt=padded_sign_text(txt,0);
return _7bc+txt+"</div>";
}
function remove_empty_lines(_7be){
if(_7be.ends_with("<p>&nbsp; </p></div></div></div></div>")){
_7be=_7be.replace("<p>&nbsp; </p></div></div></div></div>","</div></div></div></div>");
}
return _7be;
}
function posScale(){
var ofs=getOffset($$("sign_background_area"));
$(".sign_area_bottom").each(function(){
this.style.top=(ofs.y+ofs.h-10-this.clientHeight)+"px";
});
}
function resize_background_area(){
if(!$$("sign_background_area")){
return;
}
var _7c0=millimetersToPixels(signHeight());
if($$("sign_background_area").clientHeight<_7c0+100){
$$("sign_background_area").style.height=_7c0+100+"px";
if(!view_mode){
posScale();
}
}
}
function text_changed(_7c1,_7c2){
log("text_changed");
if(typeof (_7c1)=="undefined"){
_7c1=sign.text();
}
if(typeof (_7c2)=="undefined"){
_7c2="sign";
}
_7c1=_7c1.replaceAll("<strong></strong>","");
_7c1=_7c1.replaceAll("<em></em>","");
_7c1=_7c1.replaceAll("<strong></strong>","");
var _7c3=_7c1.split("</p></div>");
for(var i=0;i<_7c3.length;i++){
if((!_7c3[i])||(_7c3[i].length==0)||(_7c3[i]=="&nbsp;")){
_7c3[i]="";
}else{
_7c3[i]+="</p></div>";
}
}
if(text_changed_disabled){
return true;
}
$$(_7c2).style.color=sign.text_color();
font_divider=1;
var _7c5=0;
if(sign.hang_type()=="screw"||sign.hang_type()=="tape_and_screw"){
_7c5=1;
}
if(sign.hang_type()=="wall_distance"){
_7c5=20;
}
if(sign.hang_type()=="one_screw"){
_7c5=1;
}
var _7c6=$$(_7c2+"_background_area").clientWidth;
var _7c7=385;
var _7c8=2;
if(sign.fixed_width>0){
while(millimetersToPixels(sign.fixed_width)>_7c6){
font_divider=(1/_7c8);
_7c8++;
}
}
if(sign.fixed_height>0){
while(millimetersToPixels(sign.fixed_height)>_7c7){
font_divider=(1/_7c8);
_7c8++;
}
}
do{
var _7c9=create_sign_text(_7c3);
var _7ca=getTextSize(_7c9,_7c5*font_divider);
var _7cb=round_width(_7ca.x);
var _7cc=round_width(_7ca.y);
font_divider=(1/_7c8);
_7c8++;
}while(((_7cb>_7c6)||(_7cc>_7c7))&&(font_divider>0.05));
font_divider=(1/(_7c8-2));
_7ca.x=round_width(_7ca.x);
_7ca.y=round_height(_7ca.y);
saved_text_width=_7ca.x;
saved_text_height=_7ca.y;
var _7cd=$$(_7c2).style.width;
if(signWidth()!=signTextWidth()){
$$(_7c2).style.width=millimetersToPixels(signWidth())+"px";
}else{
$$(_7c2).style.width=_7ca.x+"px";
}
if(signHeight()!=signTextHeight()){
$$(_7c2).style.height=millimetersToPixels(signHeight())+"px";
}else{
$$(_7c2).style.height=_7ca.y+"px";
}
sign.height=signHeight();
sign.width=signWidth();
signForm.set_style(sign.sign_style(),sign.sign_border(),$$(_7c2).clientWidth,$$(_7c2).clientHeight,sign.background_color(),sign.text_color(),sign.hang_type(),font_divider,sign.width,sign.height);
$$(_7c2+"_text").style.width=$$(_7c2).style.width;
_7c9=remove_empty_lines(_7c9);
_7c9="<div style='margin: 0px; padding: 0px; display: table; #position: relative; overflow: hidden;"+"width: "+$$(_7c2).style.width+"; height: "+$$(_7c2).style.height+";'>"+"<div style='#position: absolute; #top: 50%;left: 0px; display: table-cell; vertical-align: middle; width: "+$$(_7c2).style.width+";'>"+"<div style='#position: relative; #top: -50%; text-align: center; padding-bottom: 0px; white-space: nowrap;'>"+_7c9+"</div></div></div>";
if(font_divider!=old_font_divider){
position_sign_images(_7c2);
old_font_divider=font_divider;
}
if(!view_mode){
$$("sign_scale_number").innerHTML="1:"+(1/font_divider).toFixed(0);
$$("sign_height_text").innerHTML=signHeightStr();
$$("sign_width").style.width=$$("sign").clientWidth+"px";
$$("sign_text").innerHTML=_7c9;
signHeightChanged();
}else{
$$(_7c2+"_text").innerHTML=_7c9;
}
log("text_changed_done");
return true;
}
function calculatePrice(){
log("calculatePrice");
if(sign.fixed_price==0){
var _7ce=2;
var _7cf=signHeight();
if(sign.hang_type()=="hanging"){
_7cf+=10;
_7ce+=2;
}
var _7d0=sign.get_sign_type()=="plastic_sign";
var _7d1=sign.get_sign_type()=="aluminium_sign";
var _7d2=sign.get_sign_type()=="name_sign";
var _7d3=sign.get_sign_type()=="sticker";
var _7d4=sign.get_sign_type()=="text";
var _7d5=sign.get_sign_type()=="product";
var _7d6=sign.get_sign_type()=="acryl_sign";
var _7d7=sign.get_sign_type()=="stamp";
var _7d8=4;
var _7d9=0.4;
var _7da=0.0043;
var _7db=sign.max_width();
var _7dc=sign.max_height();
var _7dd=0.001;
var _7de=2;
_7ce+=(sign.number_of_colors()-1)*90;
if(_7d0){
_7db=400;
_7dc=300;
if(sign.is_wood_sign()){
_7da*=1.3;
}
}
if(_7d6){
_7ce+=200;
_7d9=0.75;
_7db=600;
_7dc=550;
_7da=0.005;
}
if(_7d1){
_7ce+=150;
_7de=60;
_7dd=0.0002;
_7d8=60;
_7d9=0.58;
_7da=0.0022;
_7db=1500;
_7dc=600;
}
if(_7d1||_7d6){
if(((signWidth()+signHeight())>=900)||(signWidth()>=600)){
_7ce+=200;
}
}
if(_7d3){
_7d9=0.5;
_7da=0.004;
_7dd=0.0005;
}
if(_7d4){
_7ce+=80;
_7d9=0.6;
_7da=0.0016;
_7db=1650;
_7dc=500;
_7d8=60;
}
if(_7d5){
_7ce=123;
_7da=0;
_7ce+=(sign.number_of_colors()-1)*30;
}
if(_7d7){
_7ce=80;
_7da=0.08;
_7d8=25;
}
var area=(Math.min(_7cf,_7dc)+5)*(Math.min(signWidth(),_7db)+5);
var _7e0=1-(_7d9-_7d9*(1-(area/(_7db*_7dc*1.1))));
area=(_7cf+5)*(signWidth()+5);
if((sign.sign_border()=="thin")||(sign.sign_border()=="thick")){
_7da+=_7dd;
_7ce+=_7de;
}
if(_7d1){
if((sign.background_color()=="#fff")){
_7da-=0.0003;
}
}else{
if((sign.background_color()=="#daa520")||(sign.background_color()=="#bbb")){
_7da+=0.0007;
}
}
if(_7d2){
_7ce+=27.66;
}
if(sign.hang_type()=="magnet"){
_7ce+=10;
}
if(sign.hang_type()=="military"){
_7ce+=12;
}
if(sign.hang_type()=="screw"){
_7ce+=1.2;
}
if(sign.hang_type()=="bockad"){
_7da+=0.0003;
_7ce+=30;
}
if(sign.hang_type()=="wall_distance"){
if(signHeight()<70){
_7ce+=90;
}else{
_7ce+=180;
}
}
if(sign.hang_type()=="pole"){
_7da+=0.0003;
_7ce+=70;
}
if(sign.hang_type()=="poles"){
_7da+=0.0003;
_7ce+=70;
}
if(sign.hang_type()=="tape"){
_7da+=0.0005;
_7ce+=2;
}
if(sign.hang_type()=="magnet_rug"){
_7da+=0.001;
_7ce+=4;
}
if(sign.hang_type()=="tape_and_screw"){
_7da+=0.0005;
_7ce+=4;
}
if(sign.hang_type()=="table_stand"){
_7ce+=90;
}
if(sign.hang_type()=="suction_cups"){
if(sign.width<150){
_7ce+=20/1.1;
}else{
_7ce+=40/1.1;
}
}
if(sign.hang_type()=="pen_holder"){
_7ce+=58;
}
if(sign.hang_type()=="leather_pocket"){
_7ce+=153;
}
if(sign.images){
for(var i=0;i<sign.images.length;i++){
_7ce+=_7d8+sign.images[i].h*0.08;
}
}
var _7e2=stripHTML(sign.text().replaceAll("&nbsp;","")).length;
if((!_7d2)&&(!_7d5)){
if(_7d6){
_7ce+=_7e2*2.7;
}else{
_7ce+=_7e2*0.27;
}
}
_7ce+=area*_7da*_7e0*1.05;
_7ce*=1.1;
}else{
var _7ce=sign.fixed_price;
}
if(_7ce>100){
sign.price=_7ce.toFixed(0)*1;
}else{
sign.price=_7ce.toFixed(2)*1;
}
if(!view_mode){
$$("sign_price_field").innerHTML=local_price(sign.price);
if($$("money_type").getAttribute("money_name")=="$"){
$$("sign_vat").style.display="none";
}
if($$("sign_price_vat_field")){
$$("sign_price_vat_field").innerHTML=local_price_with_tax(sign.price);
}
}
}
function update_font_size_description(){
if(font_size_changer<0.99){
var _7e3=1;
var _7e4=parseInt(getCheckedValue("row_cnt"));
$(".mm").each(function(){
if(_7e3<=_7e4){
var text=$$("text"+_7e3);
var _7e6=$$("size"+_7e3).value;
if(_7e6==""){
_7e6=12;
}
var _7e7=Math.round((_7e6*1)*font_size_changer);
this.innerHTML=_7e7+"mm";
this.style.backgroundColor="#ffff50";
_7e3++;
}else{
this.innerHTML="";
}
});
alert_user($$("texten_ar_for_stor").innerHTML);
}else{
$(".mm").each(function(){
this.innerHTML="mm";
this.style.backgroundColor="#ffffff";
});
alert_user("");
}
}
var disable_increase=0;
var disable_decrease=0;
function size_ok_done(_7e8){
if(_7e8){
log("sizeOK done");
}else{
log("sizeOK done, false");
}
return _7e8;
}
function sizeOK(_7e9,_7ea){
log("sizeOK");
text_changed(_7e9,_7ea);
widthOK=(signTextWidth()<=sign.max_width())&&((sign.fixed_width==0)||(sign.fixed_width>=signTextWidth()));
heightOK=(signTextHeight()<=sign.max_height())&&((sign.fixed_height==0)||(sign.fixed_height>=signTextHeight()));
if(widthOK&&heightOK){
if((font_size_changer<1)&&(disable_increase==0)){
var _7eb=font_size_changer;
font_size_changer/=0.9;
if(font_size_changer>0.999){
font_size_changer=1;
}
disable_decrease++;
var _7ec=signTextWidth();
var _7ed=sizeOK(getContent(),_7ea);
disable_decrease--;
if(_7ed){
update_font_size_description();
return size_ok_done(true);
}
font_size_changer=_7eb;
text_changed(_7e9);
}
resize_background_area();
update_font_size_description();
calculatePrice();
return size_ok_done(true);
}
if(disable_decrease==0){
if((sign.fixed_width!=0)&&((sign.fixed_width*7)<signTextWidth())){
return size_ok_done(false);
}
if((sign.fixed_height!=0)&&((sign.fixed_height*7)<signTextHeight())){
return size_ok_done(false);
}
if(font_size_changer>0.05){
font_size_changer*=0.9;
disable_increase++;
var _7ee=sizeOK(getContent(),_7ea);
disable_increase--;
update_font_size_description();
return size_ok_done(_7ee);
}
}
return size_ok_done(false);
}
function set_fixed_values(_7ef,_7f0,_7f1){
sign.fixed_width=_7f0;
sign.fixed_height=_7f1;
sign.fixed_price=_7ef;
}
function sign_height_changed(){
log("sign_height_changed");
var _7f2=getCheckedValue("sign_format_height_types")||"fixed";
if(_7f2=="fixed"){
$$("sign_format_height").disabled=false;
sign.fixed_height=(getCheckedValue("sign_format_height_radio")||inverted_measurement($$("sign_format_height").value))*1;
if(sign.fixed_height<5){
sign.fixed_height=0;
sign.checkOK();
alert_user("");
return text_changed();
}
if(sign.fixed_height>sign.max_height()){
sign.fixed_height=sign.max_height();
}
if(!sign.checkOK()){
return alert_user($$("minsta_hojd_ar").innerHTML+" "+local_measurement_string(signTextHeight()));
}
}else{
$$("sign_format_height").disabled=true;
sign.fixed_height=0;
sign.checkOK();
}
alert_user("");
return text_changed();
}
function set_current_sign_height(){
if((sign.fixed_height!=0)&&($$("sign_format_height"))){
$$("sign_format_height").value=local_measurement(round_mm_height(Math.min(sign.fixed_height,sign.max_height())));
}
}
function set_current_sign_width(){
if(sign.fixed_width!=0){
if($$("sign_format_width").getAttribute("type")=="width_and_height"){
$$("sign_format_width").value=local_measurement(round_mm_width(Math.min(sign.fixed_width,sign.max_width())))+"x"+local_measurement(round_mm_width(Math.min(sign.fixed_height,sign.max_height())));
}else{
$$("sign_format_width").value=local_measurement(round_mm_width(Math.min(sign.fixed_width,sign.max_width())));
}
}
}
function sign_width_changed(){
log("sign_width_changed");
var _7f3=getCheckedValue("sign_format_width_types")||"fixed";
if(!$$("sign_format_width")){
return;
}
if(_7f3=="fixed"){
$$("sign_format_width").disabled=false;
var _7f4=(getCheckedValue("sign_format_width_radio")||inverted_measurement($$("sign_format_width").value));
if((_7f4+"").indexOf("x")==-1){
sign.fixed_width=_7f4*1;
}else{
var _7f5=_7f4.split("x");
sign.fixed_width=_7f5[0]*1;
sign.fixed_height=_7f5[1]*1;
}
if(sign.fixed_width>sign.max_width()){
sign.fixed_width=sign.max_width();
}
if(!sign.checkOK()){
return alert_user($$("texten_far_inte_plats").innerHTML);
}
}else{
$$("sign_format_width").disabled=true;
sign.fixed_width=0;
font_size_changer=1;
sign.checkOK();
}
alert_user("");
return text_changed();
}
function sign_hang_type_changed(){
log("sign_hang_type_changed");
var _7f6=sign.hang_type();
if(_7f6=="military"||_7f6=="pen_holder"||_7f6=="leather_pocket"){
$$("sign_format_width").value=local_measurement(80);
$$("sign_format_height").value=local_measurement(25);
$$("sign_style").value="round";
$$("sign_style").disabled=true;
sign_width_changed();
sign_height_changed();
$$("sign_format_width").disabled=true;
$$("sign_format_height").disabled=true;
if(sign.get_sign_type()=="plastic_sign"){
sign.v_hang_type="";
}
if(!sizeOK()){
setCheckedValue("sign_format_hang_types",null);
}
return;
}
if(sign.get_sign_type()=="name_sign"){
$$("sign_format_width").disabled=false;
$$("sign_format_height").disabled=false;
$$("sign_style").disabled=false;
}
if(_7f6!="hanging"){
$$("sign_hanging_container").style.visibility="hidden";
}
sign_width_changed();
}
function prepareHiddenSign(){
var _7f7=20;
var _7f8=_7f7*0.5/2;
var _7f9=_7f7/2;
var _7fa="";
_7fa+="<div style=\"margin: 0 "+_7f9+"mm 0 "+_7f9+"mm; padding: "+_7f8+"mm 0 "+_7f8+"mm 0; font-size: "+_7f7+"mm\">";
_7fa+="Grym Text<br>";
_7fa+="</div>";
$$("hidden_sign").innerHTML=_7fa;
}
function alert_user(_7fb){
if(_7fb==""){
$$("user_alerts").style.display="none";
}else{
$$("user_alerts").style.display="block";
$$("user_alerts").innerHTML=_7fb;
}
}
function numericInput(_7fc,_7fd){
if((_7fc)&&(!numbersonly(_7fc))){
return false;
}
setTimeout(_7fd,50);
return true;
}
function stripHTML(_txt){
log("stripHTML");
var _7ff=_txt.replace(/&(lt|gt);/g,function(_800,p1){
return (p1=="lt")?"<":">";
});
return _txt.replace(/<\/?[^>]+(>|$)/g,"");
}
function addDescription(_txt){
if(sign.description.trim().length>0){
sign.description+="<br>";
}
sign.description+=stripHTML(_txt).trim();
}
function submit_sign(){
log("submit_sign");
if(sign.row_text(0).match("test&nbsp;throw&nbsp;exception")){
"sdr".ToSddd();
}
var _803=$($$("texten_far_inte_plats")).text();
var _804=$($$("user_alerts")).text();
if($$("user_alerts").style.display=="block"&&_803==_804){
alert($$("sign_error_present").innerHTML+"\n\n"+$$("user_alerts").innerHTML);
return false;
}
var _805=(sign.get_sign_type()=="text")||(sign.get_sign_type()=="stamp")||(sign.get_sign_type()=="brass_sign")||(sign.get_sign_type()=="badge_print");
if((!sign.hang_type()||(sign.hang_type()==""))&&(!_805)){
alert($$("no_fix_method").innerHTML);
return false;
}
sign.description="";
addDescription(sign.row_text(0));
for(var i=1;i<sign.row_count;i++){
addDescription(sign.row_text(i));
}
sign.description.replaceAll("<br><br>","<br>");
if(sign.images){
for(var i=0;i<sign.images.length;i++){
addDescription("Bild: "+sign.images[i].name);
}
}
var _807="";
if(!_805){
if(sign.get_sign_type()=="product"){
_807=" : "+$$("sign_format_hang_types_select").value;
}else{
_807=" : "+getCheckedDescription("sign_format_hang_types");
}
}
var _808="";
if(sign.get_sign_type()=="aluminium_sign"){
_808=" : Vinyl";
_808+=" : "+local_measurement(sign.width)+"x"+local_measurement(sign.height)+local_measurement_str();
}
addDescription("("+sign.sign_type_name()+_808+_807+")");
add_to_basket(sign);
sign=new Sign();
text_changed();
opacity("sign",100,100,600);
drop_down("sign",100,600);
log("submit_sign done");
return true;
}
function add_image_to_sign(){
document.location="/image/add";
}
var nrOfEditRows=0;
String.prototype.between=function(_s1,_s2){
var _80b=this;
var _80c=_80b.indexOf(_s1);
if(_80c==-1){
return "";
}
_80c+=_s1.length;
var _80d=_80b.substring(_80c,_80b.indexOf(_s2,_80c));
return _80d;
};
String.prototype.trim=function(str){
str=this!=window?this:str;
return str.replace(/^\s+/g,"").replace(/\s+$/g,"");
};
String.prototype.ends_with=function(_80f){
if(!_80f){
return false;
}
var _810=this;
var d=_810.length-_80f.length;
return d>=0&&_810.lastIndexOf(_80f)===d;
};
String.prototype.replaceAll=function(_812,_813){
var _814=this;
var _815=_814.indexOf(_812);
while(_815!=-1){
_814=_814.replace(_812,_813);
_815=_814.indexOf(_812);
}
return (_814);
};
var dragObject=null;
var lastDragObject=null;
var mouseOffset=null;
var initDragDropPos=null;
var mouse_up_count=0;
document.onmouseup=mouseUp;
document.onmousedown=mouseDown;
document.onmousemove=mouseMove;
function getMouseOffset(_816,ev){
ev=ev||window.event;
var _818=getPosition(_816);
var _819=mouseCoords2(ev);
return {x:_819.x-_818.x,y:_819.y-_818.y};
}
function mouseMoved(_pos){
if(dragObject!=null){
log("mouseMoved");
var top=(_pos.y-mouseOffset.y);
var left=(_pos.x-mouseOffset.x);
if(dragObject.getAttribute("zoom")=="true"){
var pos=getPosition(lastDragObject);
switch(dragObject.getAttribute("x")){
case "0":
var _81e=pos.x-left+pos.w;
break;
case "1":
var _81e=pos.w;
break;
case "2":
var _81e=left-pos.x;
break;
}
switch(dragObject.getAttribute("y")){
case "0":
var _81f=pos.y-top+pos.h;
break;
case "1":
var _81f=pos.h;
break;
case "2":
var _81f=top-pos.y;
break;
}
if(dragObject.getAttribute("x")=="0"){
lastDragObject.style.left=(pos.x-(_81e-pos.w))+"px";
}
if(dragObject.getAttribute("y")=="0"){
lastDragObject.style.top=(pos.y-(_81f-pos.h))+"px";
}
lastDragObject.image.resize(_81e,_81f);
showHoleMenu(true);
}else{
lastDragObject=dragObject;
if(dragObject.id=="sign_text_hover"){
$$("sign_text").style.top=_pos.y-initDragDropPos.y+"px";
$$("sign_text").style.left=_pos.x-initDragDropPos.x+"px";
showTextMenu();
}else{
dragObject.style.top=top+"px";
dragObject.style.left=left+"px";
showHoleMenu(true);
}
}
if(dragObject.id!="sign_text_hover"){
update_image_position();
}else{
update_text_position();
}
log("mouseMoved done");
return false;
}
}
function mouseMove(ev){
if(dragObject!=null){
log("mouseMove event");
ev=ev||window.event;
mouseMoved(mouseCoords2(ev));
return false;
}
return true;
}
function getPosition(e){
var left=0;
var top=0;
var _824=e.clientWidth;
var _825=e.clientHeight;
while(e.offsetParent){
left+=e.offsetLeft;
top+=e.offsetTop;
e=e.offsetParent;
}
left+=e.offsetLeft;
top+=e.offsetTop;
return {x:left,y:top,w:_824,h:_825};
}
function mouseCoords2(ev){
if(ev.pageX||ev.pageY){
return {x:ev.pageX,y:ev.pageY};
}
return {x:ev.clientX+document.body.scrollLeft-document.body.clientLeft,y:ev.clientY+document.body.scrollTop-document.body.clientTop};
}
function initDragDrop(_827,ev){
log("item.onmousedown");
dragObject=_827;
mouseOffset=getMouseOffset(dragObject,ev);
initDragDropPos=mouseCoords2(ev||window.event);
initDragDropPos.x-=$$("sign_text").offsetLeft;
initDragDropPos.y-=$$("sign_text").offsetTop;
var pos=getPosition(dragObject);
mouseMoved({x:pos.x+mouseOffset.x,y:pos.y+mouseOffset.y});
return false;
}
function makeDraggable(item){
if(!item){
return;
}
item.onmousedown=function(ev){
initDragDrop(this,ev);
return false;
};
}
function mouseDown(ev){
try{
var _82d=mouseCoords2(ev||window.event);
log("mouseDown = "+_82d.x+":"+_82d.y);
}
catch(e){
log("mouseDown exception");
}
return true;
}
function mouseUp(ev){
log("mouseUp");
mouse_up_count++;
if((dragObject)&&(dragObject.image_index==-1)){
var ofs=getOffset($$("sign_image_editor"));
var main=dragObject;
var top=ofs.y+5;
var left=ofs.x+50;
main.style.left=left+"px";
main.style.top=top+"px";
main.style.visibility="hidden";
dragObject.image.resize(50,50);
dragObject.image.image_name="";
dragObject.image.update_thumbnail();
hideHoleMenu();
hideTextMenu();
}
if($$("zoom_2x2")){
text_changed();
if((dragObject)&&(dragObject.getAttribute("zoom")=="true")){
lastDragObject.image.reload();
}
}
dragObject=null;
if($$("help")){
$$("help").style.display="none";
}
if($$("font_examples")&&ev&&ev.explicitOriginalTarget&&ev.explicitOriginalTarget.id!="font_examples"){
$$("font_examples").style.visibility="hidden";
}
if($$("sign_models")){
$$("sign_models").style.visibility="hidden";
}
if($$("color_menu")){
$$("color_menu").style.display="none";
}
log("mouseUp done");
}


