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":
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/text";
}else{
document.location.href="/schildautomat";
}
}
}
return;
case "en-GB":
if(this.get_sign_type()=="name_sign"){
document.location.href="/signomatic/badge";
}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="/signomatic/badge";
}else{
if(this.get_sign_type()=="aluminium_sign"){
document.location.href="/signomatic/aluminium";
}else{
if(this.get_sign_type()=="text"){
document.location.href="/signomatic/text";
}else{
document.location.href="/signomatic";
}
}
}
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/text";
}else{
document.location.href="/skiltomaten";
}
}
}
return;
case "fi-FI":
if(this.get_sign_type()=="name_sign"){
document.location.href="/kylttiautomaattis/nimikyltti";
}else{
if(this.get_sign_type()=="aluminium_sign"){
document.location.href="/kylttiautomaattis/alumiinikyltti";
}else{
if(this.get_sign_type()=="text"){
document.location.href="/kylttiautomaattis/teksti";
}else{
document.location.href="/kylttiautomaattis";
}
}
}
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{
if(this.get_sign_type()=="product"){
document.location.href="/skyltomaten/tshirt";
}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");
alert_user("");
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 får inte plats");
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(_2e){
if(typeof (_2e)!="undefined"){
log("sign: hang_type");
this.v_hang_type=_2e;
if(!this.checkOK()){
alert_user("Hålen får inte plats");
}
}
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;
if(typeof (_52)!="undefined"){
_54=_52;
}
var _55="#ccc";
var _56="#aaa";
if(_51=="wall_distance"){
_54=25;
_55="#ddd";
_56="#ccc";
_53.setAttribute("fill","url(#silver)");
}else{
_53.setAttribute("fill",_55);
_53.setAttribute("stroke",_56);
_53.setAttribute("stroke-width","1px");
}
_53.setAttribute("rx",(_54*_4e+1));
_53.setAttribute("ry",(_54*_4e+1));
_53.setAttribute("cx",_cx+1);
_53.setAttribute("cy",_cy+1);
return _53;
},createGradient:function(_57,_58,_59){
var _5a=vectorModel.createElement("linearGradient");
_5a.setAttribute("id",_57);
_5a.setAttribute("x1","0%");
_5a.setAttribute("y1","0%");
_5a.setAttribute("x2","100%");
_5a.setAttribute("y2","20%");
var _5b=vectorModel.createElement("stop");
_5b.setAttribute("offset","20%");
_5b.setAttribute("stop-color",_58);
_5b.setAttribute("stop-opacity","1");
var _5c=vectorModel.createElement("stop");
_5c.setAttribute("offset","100%");
_5c.setAttribute("stop-color",_59);
_5c.setAttribute("stop-opacity","1");
_5a.appendChild(_5b);
_5a.appendChild(_5c);
return _5a;
},padding:function(_w,_h,_5f,_60){
log("sf: padding");
var _61=[];
_61.left=0;
_61.top=0;
_61.right=0;
_61.bottom=0;
switch(sign.sign_style()){
case "round":
case "none":
if(_60==0){
break;
}
_61.left=_h*0.08;
_61.top=_h*0.08;
_61.right=_h*0.08;
_61.bottom=_h*0.08;
break;
case "arrow_left":
_61.top=_h*0.4;
_61.bottom=_h*0.4;
_61.left=_h*0.5;
break;
case "arrow_right":
_61.top=_h*0.4;
_61.bottom=_h*0.4;
_61.right=_h*0.5;
break;
case "rounded_sides":
_61.left=_h*0.35;
_61.right=_h*0.35;
break;
case "stop":
_61.top=_h*0.3;
_61.bottom=_h*0.3;
break;
case "star":
_61.top=_h*0.7;
_61.bottom=_h*0.3;
_61.right=_w*0.6;
_61.left=_w*0.6;
break;
case "oval":
if(sign.row_count==1){
_61.left=_w*0.05;
_61.right=_w*0.05;
_61.top=_h*0.25;
}else{
_61.left=_w*0.12;
_61.right=_w*0.12;
_61.top=_h*0.2;
}
_61.bottom=_h*0.2;
break;
case "thorny":
_61.left=_w*0.2;
_61.top=_h*0.2;
_61.right=_w*0.2;
_61.bottom=_h*0.2;
break;
}
var _62=Math.min(_w,_h);
var _63=0;
switch(_5f){
case "thin":
_63=_62*0.03;
break;
case "thick":
_63=_62*0.09;
break;
}
_61.left+=_63*2;
_61.top+=_63*2;
_61.right+=_63*2;
_61.bottom+=_63*2;
return _61;
},paint_star:function(_64,_w,_h){
log("sf: paint_star");
var _67=360/(this.jags*this.radiuses.length);
var _68=[];
var _69=0;
var x,y;
var _6c=0;
var _6d;
var _6e="";
var _6f=[];
_6f["xmin"]=0;
_6f["xmax"]=0;
_6f["ymin"]=0;
_6f["ymax"]=0;
for(var s=0;s<=this.jags*this.radiuses.length+1;s++){
if(_6c>this.radiuses.length-1){
_6c=0;
}
_6d=this.radiuses[_6c];
_6c++;
_69=s*_67+this.startRadius;
a=_69*Math.PI/180;
x=_6d*Math.cos(a);
y=_6d*Math.sin(a);
_68[s]={"x":x,"y":y};
if(x<_6f["xmin"]){
_6f["xmin"]=x;
}
if(x>_6f["xmax"]){
_6f["xmax"]=x;
}
if(y<_6f["ymin"]){
_6f["ymin"]=y;
}
if(y>_6f["ymax"]){
_6f["ymax"]=y;
}
}
for(i in _68){
x=(_68[i].x-_6f["xmin"])/(_6f["xmax"]-_6f["xmin"]);
y=(_68[i].y-_6f["ymin"])/(_6f["ymax"]-_6f["ymin"]);
_6e+=(x*_w+1+_64).toFixed(0)+","+(y*_h+1+_64).toFixed(0)+" ";
}
var _71=vectorModel.createElement("polyline");
_71.setAttribute("points",_6e);
return _71;
},hide:function(){
this.mySvg.style.visibility="hidden";
},update_hanging:function(_72,_73,_w,_h,_76,_77,_78){
var _79=Math.min(_77,_78);
var _7a=Math.min(Math.max(_79/9,8),24)*_76;
var h=((_7a*2.5)*0.9)+_73*0.8;
var x=(_7a*3)*_76;
switch(_72){
case "round":
x+=0.04*_w;
break;
}
this.myG.appendChild(this.createScrew(_76,x+_73,h,"screw",_7a));
this.myG.appendChild(this.createScrew(_76,_w-x,h,"screw",_7a));
},update_screws:function(_7d,_7e,_w,_h,_81,_82,_83){
log("sf: update_screws");
var _84=20;
var l=15;
var _86=100;
var h=_h/2+_7e/2;
if(_83=="one_screw"){
l=40;
this.myG.appendChild(this.createScrew(_81*2,20*_81+_7e,h,_83));
return;
}
if(_83=="wall_distance"){
_86=70;
if(_82<_86){
_84=30;
}
l+=_84;
}
r=l;
switch(_7d){
case "round":
if(_82>=_86){
l=_82/4;
if(_83=="wall_distance"){
l+=_84;
}
r=l;
this.myG.appendChild(this.createScrew(_81,l*_81+_7e,l*_81+_7e,_83));
this.myG.appendChild(this.createScrew(_81,_w-(r*_81),r*_81+_7e,_83));
h=_h-(l*_81);
}
break;
case "none":
if(_82>=_86){
l=_82/9+10;
if(_83=="wall_distance"){
l+=_84;
}
r=l;
this.myG.appendChild(this.createScrew(_81,l*_81+_7e,l*_81+_7e,_83));
this.myG.appendChild(this.createScrew(_81,_w-(r*_81),r*_81+_7e,_83));
h=_h-(l*_81);
}
break;
case "rounded_sides":
case "oval":
l=30;
if(_83=="wall_distance"){
l+=30;
}
r=l;
break;
case "triangle_top":
this.myG.appendChild(this.createScrew(_81,_w/2,15*_81));
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(_81,l*_81+_7e,h,_83));
this.myG.appendChild(this.createScrew(_81,_w-r*_81,h,_83));
},set_style:function(_88,_89,_w,_h,_8c,_8d,_8e,_8f,_90,_91){
log("sf: set_style");
if(_8c){
_8c=_8c.toLowerCase();
}
if(typeof (_91)=="undefined"){
_91=0;
}
this.width=_w;
this.height=_h;
var _92=Math.min(_w,_h);
if(_92<5){
return;
}
var _93=0;
switch(_89){
case "thin":
_93=_92*0.03;
break;
case "thick":
_93=_92*0.09;
break;
}
while(this.myG.childNodes.length>=1){
this.myG.removeChild(this.myG.firstChild);
}
var _94=_93/2;
_h-=_93+2;
_w-=_93+2;
var _95;
var d="";
this.style=_88;
log("sf: switch style");
switch(_88){
case "round":
_95=vectorModel.createElement("rect");
_95.setAttribute("x",1+_94);
_95.setAttribute("y",1+_94);
_95.setAttribute("width",_w);
_95.setAttribute("height",_h);
var _97=(Math.min(_w,_h)*0.1).toFixed();
_95.setAttribute("rx",_97);
_95.setAttribute("ry",_97);
break;
case "square":
case "none":
_95=vectorModel.createElement("rect");
_95.setAttribute("x",1+(_94));
_95.setAttribute("y",1+(_94));
_95.setAttribute("width",_w);
_95.setAttribute("height",_h);
break;
case "oval":
_95=vectorModel.createElement("ellipse");
_95.setAttribute("cx",_w/2+1+(_94));
_95.setAttribute("cy",_h/2+1+(_94));
_95.setAttribute("rx",(_w-(_94/2))/2);
_95.setAttribute("ry",(_h-(_94/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+_94).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 _9a=(_w+_94).toFixed(0)*1;
d="M "+_9a+","+(_h*0.2+1+_94).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+_94).toFixed(0)+",0 l 0,0.6h";
break;
case "stop":
this.jags=4;
this.radiuses=[20,20];
this.startRadius=22.5;
_95=this.paint_star(_94,_w,_h);
break;
case "star":
this.jags=5;
this.radiuses=[20,10];
this.startRadius=54;
_95=this.paint_star(_94,_w,_h);
break;
case "triangle_top":
this.jags=3;
this.radiuses=[20,10];
this.startRadius=270;
_95=this.paint_star(_94,_w,_h);
break;
case "thorny":
this.jags=30;
this.radiuses=[20,18];
this.startRadius=54;
_95=this.paint_star(_94,_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");
_95=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",(_94+1).toFixed(0)).replaceAll("y",(_94+1).toFixed(0));
_95.setAttribute("d",d);
}
var _9b="#ccc";
if(_95){
log("sf: color");
if((_8c==null)||(_8c=="#f0f0f0")){
if($.browser.msie){
_95.appendChild(this.transparentFill);
}else{
_95.setAttribute("fill","transparent");
}
_9b="#666";
}else{
if(_8c=="#bbb"){
_95.setAttribute("fill","url(#silver)");
}else{
if(_8c=="#daa520"){
_95.setAttribute("fill","url(#gold)");
}else{
if(_8c=="#e8cca1"){
if($.browser.msie){
_95.appendChild(this.oakFill);
}else{
_95.setAttribute("fill","#e8cca1");
}
}else{
_95.setAttribute("fill",_8c);
}
}
}
}
if(_89=="thin"){
_95.setAttribute("stroke",_8d);
_95.setAttribute("stroke-width",_93+"px");
}else{
if(_89=="thick"){
_95.setAttribute("stroke",_8d);
_95.setAttribute("stroke-width",_93+"px");
}else{
if(_89=="2px"){
_95.setAttribute("stroke",_8d);
_95.setAttribute("stroke-width","1.5px");
}else{
_95.setAttribute("stroke",_9b);
_95.setAttribute("stroke-width","1px");
}
}
}
this.myG.appendChild(_95);
this.mySvg.style.visibility="visible";
}
if((_8e=="screw")||(_8e=="wall_distance")||(_8e=="one_screw")){
this.update_screws(_88,_93,_w,_h,_8f,_91,_8e);
}
if((_8e=="hanging")&&(_90>=150)){
this.update_hanging(_88,_93,_w,_h,_8f,_90,_91);
}
log("sf: done");
this.rectangle=_95;
return _95;
}});
var doClose;
doClose=function(){
log("doClose");
iPanel.closeIFrame("imagelist_frame");
};
function show_video(_9c,_9d){
iPanel.openIFrame("imagelist_frame","InternalFramePanel","/video/show?name="+_9c,542,340);
};
function show_video2(_9e,_9f){
iPanel.openIFrame("imagelist_frame","InternalFramePanel","/video/show_flv?name="+_9e+".flv",542,340);
};
function show_video_flv(_a0,_a1,_a2){
iPanel.openIFrame("imagelist_frame","InternalFramePanel","/video/show_flv?name="+_a0+".flv&width="+_a1+"&height="+_a2,_a1,_a2);
};
function show_youtube_video(_a3,_a4){
iPanel.openIFrame("imagelist_frame","InternalFramePanel","/video/show?name="+_a3,562,480);
};
function show_large_youtube_video(_a5,_a6){
iPanel.openIFrame("imagelist_frame","InternalFramePanel","/video/show?name="+_a5,742,580);
};
function InternalFramePanel(){
};
InternalFramePanel.prototype.reloadWithUrl=function(){
if(this.altUrl){
window.location=this.altUrl;
}else{
var _a7=window.location;
window.location=_a7;
}
};
InternalFramePanel.prototype.alternateClose=function(url){
if(url){
this.altUrl=url;
}
doClose=this.reloadWithUrl;
};
InternalFramePanel.prototype.openIFrame=function(id,_aa,url,_ac,_ad){
log("openIFrame");
this.createMask();
var div=document.createElement("div");
div.innerHTML="<iframe name=\""+id+"_iframe\"></iframe>";
var _af=div.firstChild;
div.setAttribute("id",id+"_div");
_af.setAttribute("id",id+"_iframe");
_af.setAttribute("scrolling","no");
_af.setAttribute("frameBorder","0");
_af.setAttribute("allowTransparency","true");
_af.className=_aa;
_af.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";
_af.style.position="absolute";
_af.style.top="10px";
_af.style.left="10px";
_af.style.margin="0";
}
if(_ac&&_ad){
div.setAttribute("width",_ac);
div.setAttribute("height",_ad);
_af.style.width=_ac+"px";
_af.style.height=_ad+"px";
_af.style.marginLeft=-(_ac/2)+"px";
}
div.appendChild(_af);
document.body.appendChild(div);
log("openIFrame done");
return _af;
};
InternalFramePanel.prototype.closeIFrame=function(id){
log("closeIFrame");
var div=document.getElementById(id+"_div");
var _b2;
while((_b2=div.firstChild)!=null){
div.removeChild(_b2);
}
document.body.removeChild(div);
this.removeMask();
};
InternalFramePanel.prototype.createMask=function(){
log("createMask");
var id="EditMask";
var _b4=eval(document.getElementById(id));
if(!_b4){
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 _b7=eval(document.getElementById(id));
if(_b7){
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(_ba){
log("add_to_basket");
_ba.server_id=0;
_ba.count=1;
_ba.basket_id=Math.round(Math.random()*99999999);
products_in_basket.push(_ba);
addProductToTable(_ba);
send_product_to_server(_ba);
};
function server_add_to_basket(_bb,_bc,_bd,_be,_bf,_c0,_c1,_c2,_c3,_c4){
log("server_add_to_basket");
try{
var _c5=new Object;
_c5.basket_id=Math.round(Math.random()*99999999);
_c5.server_id=_bb;
_c5.description=_bd;
_c5.sign_type=_be;
_c5.get_sign_type=function(){
return this.sign_type;
};
_c5.width=_bf;
_c5.height=_c0;
_c5.colors_as_text=function(){
return _c1;
};
_c5.price=_c2;
_c5.count=_c3;
_c5.data=_bc;
_c5.to_string=function(){
return this.data;
};
products_in_basket.push(_c5);
addProductToTable(_c5,_c4);
return _c5;
}
catch(e){
}
};
function price_with_sign(_c6){
if($$("money_type").getAttribute("money_first")=="true"){
return $$("money_type").getAttribute("money_name")+_c6;
}else{
return _c6+" "+$$("money_type").getAttribute("money_name");
}
};
function local_price(_c7){
var _c8=$$("money_type").getAttribute("rel_value")*1;
var _c9=(_c7/_c8).toFixed($$("money_type").getAttribute("decimals"));
return price_with_sign(_c9);
};
function local_price_tax(_ca){
var _cb=$$("money_type").getAttribute("rel_value")*1;
var tax=$$("money_type").getAttribute("tax")/100;
var _cd=(_ca/_cb*tax).toFixed($$("money_type").getAttribute("decimals"));
return price_with_sign(_cd);
};
function local_price_with_tax(_ce){
var _cf=$$("money_type").getAttribute("rel_value")*1;
var tax=$$("money_type").getAttribute("tax")/100+1;
var _d1=(_ce/_cf*tax).toFixed($$("money_type").getAttribute("decimals"));
return price_with_sign(_d1);
};
var first_product=true;
function addProductToTable(_d2,_d3){
log("addProductToTable");
_d3=_d3||first_product;
first_product=false;
var tbl=$$("order_basket_table");
var _d5=tbl.rows.length;
if($$("basket_discount")){
_d5-=1;
}
if($$("basket_total_price_row")){
_d5-=1;
}
var row=tbl.insertRow(_d5);
row.onmouseover=function(){
row.style.backgroundColor="#ddd";
};
row.onmouseout=function(){
row.style.backgroundColor="#fff";
};
var _d7=_d2.basket_id;
var _d8=row.insertCell(0);
_d8.appendChild(document.createTextNode(_d5));
var _d9=row.insertCell(1);
_d9.style.textAlign="left";
_d9.basket_id=_d7;
var _da=document.createElement("div");
_da.className="basket_description";
_da.innerHTML=_d2.description;
_d9.appendChild(_da);
var _db=row.insertCell(2);
_db.style.textAlign="center";
_db.appendChild(document.createTextNode(_d2.colors_as_text()));
var _dc=row.insertCell(3);
_dc.id="basket_item_price_"+_d7;
_dc.appendChild(document.createTextNode(local_price(_d2.price)));
if(!_d3){
var _dd=document.createElement("input");
_dd.type="text";
_dd.name="basket_item_count_"+_d7;
_dd.id="basket_item_count_"+_d7;
_dd.size=3;
_dd.width="40";
_dd.value=_d2.count;
_dd.onkeydown=function(_de){
return numericInput(_de,function(){
basket_item_count_changed(_d2);
});
};
_dd.onchange=function(){
update_basket_item_count(_d2);
};
row.insertCell(4).appendChild(_dd);
}else{
if(_d2.count==null){
_d2.count=1;
}
row.insertCell(4).appendChild(document.createTextNode(_d2.count));
}
var _df=row.insertCell(5);
_df.id="basket_item_total_price_"+_d7;
_df.appendChild(document.createTextNode(local_price(0)));
if(!_d3){
var _e0=document.createElement("span");
_e0.onclick=function(){
remove_product(_d2);
};
_e0.id="basket_remove_button";
_e0.innerHTML=$$("basket_remove").innerHTML;
var _e1=row.insertCell(6);
_e1.style.textAlign="center";
_e1.appendChild(_e0);
}else{
if(tbl.rows[0].childNodes.length==13){
row.insertCell(6).appendChild(document.createTextNode(""));
}
}
basket_item_count_changed(_d2);
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 _e2=0;
var _e3=0;
var _e4="";
var _e5=0;
var _e6=0;
for(var i=0;i<products_in_basket.length;i++){
var _e8=products_in_basket[i];
_e2+=_e8.price*_e8.count;
if((_e8.get_sign_type()=="plastic_sign")||(_e8.get_sign_type()=="name_sign")){
_e3+=_e8.price*_e8.count;
}
if(_e8.get_sign_type()=="name_sign"){
_e5+=_e8.count;
}
_e4+="("+products_in_basket[i].description+")";
}
_e2+=_e6;
if(typeof (debugmode)!="undefined"){
$$("items_in_basket").innerHTML=products_in_basket.length;
$$("text_in_basket").innerHTML=_e4;
}
if($$("basket_discount")){
var _e9=0;
if(_e3>700){
_e9=5;
}
if(_e3>1000){
_e9=10;
}
if(_e3>2000){
_e9=15;
}
if(_e3>5000){
_e9=20;
}
if(_e3>11000){
_e9=25;
}
if(_e3>18000){
_e9=30;
}
if(_e3>25000){
_e9=35;
}
if(_e9>=10||(_e5>4)){
var _ea=Math.max(_e5-4,0)*6;
var _eb=Math.floor(_e3*(_e9/100)+_ea);
_e9=Math.round((_eb/_e2)*100);
_e2=_e2-_eb;
$$("basket_discount_percent").innerHTML=_e9+" %";
$$("basket_discount_price").innerHTML=$$("rabatt").innerHTML+": "+local_price(_eb);
if($$("order_discount_field")){
$$("order_discount_field").value=_eb;
}
if(isIE()){
$$("basket_discount").style.display="inline";
}else{
$$("basket_discount").style.display="table-row";
}
}else{
$$("basket_discount").style.display="none";
}
}
$$("basket_total_price").innerHTML=local_price(_e2);
if($$("basket_total_price_2")){
$$("basket_total_price_2").innerHTML=local_price(_e2);
}
$$("basket_total_price_total").innerHTML=local_price_with_tax(_e2);
if($$("basket_total_price_tax")){
$$("basket_total_price_tax").innerHTML=local_price_tax(_e2);
}
try{
update_basket_buttons();
}
catch(e){
}
};
function basket_item_count_changed(_ec){
var id=_ec.basket_id;
try{
_ec.count=$$("basket_item_count_"+id).value*1;
}
catch(e){
}
$$("basket_item_total_price_"+id).innerHTML=local_price(_ec.count*_ec.price);
update_total_price();
};
function update_basket_item_count(_ee){
basket_item_count_changed(_ee);
send_product_to_server(_ee);
};
function find_product_from_basket_id(_ef){
for(var i=0;i<products_in_basket.length;i++){
if(products_in_basket[i].basket_id==_ef){
return products_in_basket[i];
}
}
return null;
};
function send_product_to_server(_f1){
ajax_request("/order/add","product="+encodeURIComponent($.toJSON(_f1)));
};
function ajax_request(_f2,_f3){
log("ajax_request");
last_ajax_id++;
_f2=_f2+"?ajax_id="+last_ajax_id;
if(_f3){
_f2=_f2+"****&****"+_f3;
}
ajax_requests[last_ajax_id]=_f2;
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 _f4=ajax_requests[last_received_ajax_id+1].split("****&****");
$.ajax({url:_f4[0],data:_f4[1],type:"post",complete:function(_f5){
log("ajax complete call");
if(_f5.responseText==(last_received_ajax_id+1)){
last_received_ajax_id++;
delete ajax_requests[_f5.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 _f6=products_in_basket.length==1;
if((ajax_error)||_f6){
$$("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(_f9){
log("remove_product");
var _fa=products_in_basket.indexOf(_f9);
if(_fa!=-1){
var tbl=$$("order_basket_table");
tbl.deleteRow(_fa+1);
products_in_basket.splice(_fa,1);
ajax_request("/order/remove","product="+encodeURIComponent($.toJSON(_f9)));
update_total_price();
update_row_index();
}
};
function empty_basket(){
log("empty_basket");
var tbl=$$("order_basket_table");
var _fd=tbl.tBodies[0].rows.length-1;
for(var i=0;i<_fd;i++){
tbl.tBodies[0].deleteRow(0);
}
products_in_basket=[];
update_total_price();
ajax_request("/order/remove_all");
};
(function(){
var _ff=window.jQuery,_$=window.$;
var _101=window.jQuery=window.$=function(_102,_103){
return new _101.fn.init(_102,_103);
};
var _104=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,_105=/^.[^:#\[\.]*$/,_106;
_101.fn=_101.prototype={init:function(_107,_108){
_107=_107||document;
if(_107.nodeType){
this[0]=_107;
this.length=1;
return this;
}
if(typeof _107=="string"){
var _109=_104.exec(_107);
if(_109&&(_109[1]||!_108)){
if(_109[1]){
_107=_101.clean([_109[1]],_108);
}else{
var elem=document.getElementById(_109[3]);
if(elem){
if(elem.id!=_109[3]){
return _101().find(_107);
}
return _101(elem);
}
_107=[];
}
}else{
return _101(_108).find(_107);
}
}else{
if(_101.isFunction(_107)){
return _101(document)[_101.fn.ready?"ready":"load"](_107);
}
}
return this.setArray(_101.makeArray(_107));
},jquery:"1.2.6",size:function(){
return this.length;
},length:0,get:function(num){
return num==_106?_101.makeArray(this):this[num];
},pushStack:function(_10c){
var ret=_101(_10c);
ret.prevObject=this;
return ret;
},setArray:function(_10e){
this.length=0;
Array.prototype.push.apply(this,_10e);
return this;
},each:function(_10f,args){
return _101.each(this,_10f,args);
},index:function(elem){
var ret=-1;
return _101.inArray(elem&&elem.jquery?elem[0]:elem,this);
},attr:function(name,_114,type){
var _116=name;
if(name.constructor==String){
if(_114===_106){
return this[0]&&_101[type||"attr"](this[0],name);
}else{
_116={};
_116[name]=_114;
}
}
return this.each(function(i){
for(name in _116){
_101.attr(type?this.style:this,name,_101.prop(this,_116[name],type,i,name));
}
});
},css:function(key,_119){
if((key=="width"||key=="height")&&parseFloat(_119)<0){
_119=_106;
}
return this.attr(key,_119,"curCSS");
},text:function(text){
if(typeof text!="object"&&text!=null){
return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));
}
var ret="";
_101.each(text||this,function(){
_101.each(this.childNodes,function(){
if(this.nodeType!=8){
ret+=this.nodeType!=1?this.nodeValue:_101.fn.text([this]);
}
});
});
return ret;
},wrapAll:function(html){
if(this[0]){
_101(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){
var elem=this;
while(elem.firstChild){
elem=elem.firstChild;
}
return elem;
}).append(this);
}
return this;
},wrapInner:function(html){
return this.each(function(){
_101(this).contents().wrapAll(html);
});
},wrap:function(html){
return this.each(function(){
_101(this).wrapAll(html);
});
},append:function(){
return this.domManip(arguments,true,false,function(elem){
if(this.nodeType==1){
this.appendChild(elem);
}
});
},prepend:function(){
return this.domManip(arguments,true,true,function(elem){
if(this.nodeType==1){
this.insertBefore(elem,this.firstChild);
}
});
},before:function(){
return this.domManip(arguments,false,false,function(elem){
this.parentNode.insertBefore(elem,this);
});
},after:function(){
return this.domManip(arguments,false,true,function(elem){
this.parentNode.insertBefore(elem,this.nextSibling);
});
},end:function(){
return this.prevObject||_101([]);
},find:function(_124){
var _125=_101.map(this,function(elem){
return _101.find(_124,elem);
});
return this.pushStack(/[^+>] [^+>]/.test(_124)||_124.indexOf("..")>-1?_101.unique(_125):_125);
},clone:function(_127){
var ret=this.map(function(){
if(_101.browser.msie&&!_101.isXMLDoc(this)){
var _129=this.cloneNode(true),_12a=document.createElement("div");
_12a.appendChild(_129);
return _101.clean([_12a.innerHTML])[0];
}else{
return this.cloneNode(true);
}
});
var _12b=ret.find("*").andSelf().each(function(){
if(this[expando]!=_106){
this[expando]=null;
}
});
if(_127===true){
this.find("*").andSelf().each(function(i){
if(this.nodeType==3){
return;
}
var _12d=_101.data(this,"events");
for(var type in _12d){
for(var _12f in _12d[type]){
_101.event.add(_12b[i],type,_12d[type][_12f],_12d[type][_12f].data);
}
}
});
}
return ret;
},filter:function(_130){
return this.pushStack(_101.isFunction(_130)&&_101.grep(this,function(elem,i){
return _130.call(elem,i);
})||_101.multiFilter(_130,this));
},not:function(_133){
if(_133.constructor==String){
if(_105.test(_133)){
return this.pushStack(_101.multiFilter(_133,this,true));
}else{
_133=_101.multiFilter(_133,this);
}
}
var _134=_133.length&&_133[_133.length-1]!==_106&&!_133.nodeType;
return this.filter(function(){
return _134?_101.inArray(this,_133)<0:this!=_133;
});
},add:function(_135){
return this.pushStack(_101.unique(_101.merge(this.get(),typeof _135=="string"?_101(_135):_101.makeArray(_135))));
},is:function(_136){
return !!_136&&_101.multiFilter(_136,this).length>0;
},hasClass:function(_137){
return this.is("."+_137);
},val:function(_138){
if(_138==_106){
if(this.length){
var elem=this[0];
if(_101.nodeName(elem,"select")){
var _13a=elem.selectedIndex,_13b=[],_13c=elem.options,one=elem.type=="select-one";
if(_13a<0){
return null;
}
for(var i=one?_13a:0,max=one?_13a+1:_13c.length;i<max;i++){
var _140=_13c[i];
if(_140.selected){
_138=_101.browser.msie&&!_140.attributes.value.specified?_140.text:_140.value;
if(one){
return _138;
}
_13b.push(_138);
}
}
return _13b;
}else{
return (this[0].value||"").replace(/\r/g,"");
}
}
return _106;
}
if(_138.constructor==Number){
_138+="";
}
return this.each(function(){
if(this.nodeType!=1){
return;
}
if(_138.constructor==Array&&/radio|checkbox/.test(this.type)){
this.checked=(_101.inArray(this.value,_138)>=0||_101.inArray(this.name,_138)>=0);
}else{
if(_101.nodeName(this,"select")){
var _141=_101.makeArray(_138);
_101("option",this).each(function(){
this.selected=(_101.inArray(this.value,_141)>=0||_101.inArray(this.text,_141)>=0);
});
if(!_141.length){
this.selectedIndex=-1;
}
}else{
this.value=_138;
}
}
});
},html:function(_142){
return _142==_106?(this[0]?this[0].innerHTML:null):this.empty().append(_142);
},replaceWith:function(_143){
return this.after(_143).remove();
},eq:function(i){
return this.slice(i,i+1);
},slice:function(){
return this.pushStack(Array.prototype.slice.apply(this,arguments));
},map:function(_145){
return this.pushStack(_101.map(this,function(elem,i){
return _145.call(elem,i,elem);
}));
},andSelf:function(){
return this.add(this.prevObject);
},data:function(key,_149){
var _14a=key.split(".");
_14a[1]=_14a[1]?"."+_14a[1]:"";
if(_149===_106){
var data=this.triggerHandler("getData"+_14a[1]+"!",[_14a[0]]);
if(data===_106&&this.length){
data=_101.data(this[0],key);
}
return data===_106&&_14a[1]?this.data(_14a[0]):data;
}else{
return this.trigger("setData"+_14a[1]+"!",[_14a[0],_149]).each(function(){
_101.data(this,key,_149);
});
}
},removeData:function(key){
return this.each(function(){
_101.removeData(this,key);
});
},domManip:function(args,_14e,_14f,_150){
var _151=this.length>1,_152;
return this.each(function(){
if(!_152){
_152=_101.clean(args,this.ownerDocument);
if(_14f){
_152.reverse();
}
}
var obj=this;
if(_14e&&_101.nodeName(this,"table")&&_101.nodeName(_152[0],"tr")){
obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));
}
var _154=_101([]);
_101.each(_152,function(){
var elem=_151?_101(this).clone(true)[0]:this;
if(_101.nodeName(elem,"script")){
_154=_154.add(elem);
}else{
if(elem.nodeType==1){
_154=_154.add(_101("script",elem).remove());
}
_150.call(obj,elem);
}
});
_154.each(evalScript);
});
}};
_101.fn.init.prototype=_101.fn;
function evalScript(i,elem){
if(elem.src){
_101.ajax({url:elem.src,async:false,dataType:"script"});
}else{
_101.globalEval(elem.text||elem.textContent||elem.innerHTML||"");
}
if(elem.parentNode){
elem.parentNode.removeChild(elem);
}
};
function now(){
return +new Date;
};
_101.extend=_101.fn.extend=function(){
var _158=arguments[0]||{},i=1,_15a=arguments.length,deep=false,_15c;
if(_158.constructor==Boolean){
deep=_158;
_158=arguments[1]||{};
i=2;
}
if(typeof _158!="object"&&typeof _158!="function"){
_158={};
}
if(_15a==i){
_158=this;
--i;
}
for(;i<_15a;i++){
if((_15c=arguments[i])!=null){
for(var name in _15c){
var src=_158[name],copy=_15c[name];
if(_158===copy){
continue;
}
if(deep&&copy&&typeof copy=="object"&&!copy.nodeType){
_158[name]=_101.extend(deep,src||(copy.length!=null?[]:{}),copy);
}else{
if(copy!==_106){
_158[name]=copy;
}
}
}
}
}
return _158;
};
var _160="jQuery"+now(),uuid=0,_162={},_163=/z-?index|font-?weight|opacity|zoom|line-?height/i,_164=document.defaultView||{};
_101.extend({noConflict:function(deep){
window.$=_$;
if(deep){
window.jQuery=_ff;
}
return _101;
},isFunction:function(fn){
return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");
},isXMLDoc:function(elem){
return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;
},globalEval:function(data){
data=_101.trim(data);
if(data){
var head=document.getElementsByTagName("head")[0]||document.documentElement,_16a=document.createElement("script");
_16a.type="text/javascript";
if(_101.browser.msie){
_16a.text=data;
}else{
_16a.appendChild(document.createTextNode(data));
}
head.insertBefore(_16a,head.firstChild);
head.removeChild(_16a);
}
},nodeName:function(elem,name){
return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();
},cache:{},data:function(elem,name,data){
elem=elem==window?_162:elem;
var id=elem[_160];
if(!id){
id=elem[_160]=++uuid;
}
if(name&&!_101.cache[id]){
_101.cache[id]={};
}
if(data!==_106){
_101.cache[id][name]=data;
}
return name?_101.cache[id][name]:id;
},removeData:function(elem,name){
elem=elem==window?_162:elem;
var id=elem[_160];
if(name){
if(_101.cache[id]){
delete _101.cache[id][name];
name="";
for(name in _101.cache[id]){
break;
}
if(!name){
_101.removeData(elem);
}
}
}else{
try{
delete elem[_160];
}
catch(e){
if(elem.removeAttribute){
elem.removeAttribute(_160);
}
}
delete _101.cache[id];
}
},each:function(_174,_175,args){
var name,i=0,_179=_174.length;
if(args){
if(_179==_106){
for(name in _174){
if(_175.apply(_174[name],args)===false){
break;
}
}
}else{
for(;i<_179;){
if(_175.apply(_174[i++],args)===false){
break;
}
}
}
}else{
if(_179==_106){
for(name in _174){
if(_175.call(_174[name],name,_174[name])===false){
break;
}
}
}else{
for(var _17a=_174[0];i<_179&&_175.call(_17a,i,_17a)!==false;_17a=_174[++i]){
}
}
}
return _174;
},prop:function(elem,_17c,type,i,name){
if(_101.isFunction(_17c)){
_17c=_17c.call(elem,i);
}
return _17c&&_17c.constructor==Number&&type=="curCSS"&&!_163.test(name)?_17c+"px":_17c;
},className:{add:function(elem,_181){
_101.each((_181||"").split(/\s+/),function(i,_183){
if(elem.nodeType==1&&!_101.className.has(elem.className,_183)){
elem.className+=(elem.className?" ":"")+_183;
}
});
},remove:function(elem,_185){
if(elem.nodeType==1){
elem.className=_185!=_106?_101.grep(elem.className.split(/\s+/),function(_186){
return !_101.className.has(_185,_186);
}).join(" "):"";
}
},has:function(elem,_188){
return _101.inArray(_188,(elem.className||elem).toString().split(/\s+/))>-1;
}},swap:function(elem,_18a,_18b){
var old={};
for(var name in _18a){
old[name]=elem.style[name];
elem.style[name]=_18a[name];
}
_18b.call(elem);
for(var name in _18a){
elem.style[name]=old[name];
}
},css:function(elem,name,_190){
if(name=="width"||name=="height"){
var val,_192={position:"absolute",visibility:"hidden",display:"block"},_193=name=="width"?["Left","Right"]:["Top","Bottom"];
function getWH(){
val=name=="width"?elem.offsetWidth:elem.offsetHeight;
var _194=0,_195=0;
_101.each(_193,function(){
_194+=parseFloat(_101.curCSS(elem,"padding"+this,true))||0;
_195+=parseFloat(_101.curCSS(elem,"border"+this+"Width",true))||0;
});
val-=Math.round(_194+_195);
};
if(_101(elem).is(":visible")){
getWH();
}else{
_101.swap(elem,_192,getWH);
}
return Math.max(0,val);
}
return _101.curCSS(elem,name,_190);
},curCSS:function(elem,name,_198){
var ret,_19a=elem.style;
function color(elem){
if(!_101.browser.safari){
return false;
}
var ret=_164.getComputedStyle(elem,null);
return !ret||ret.getPropertyValue("color")=="";
};
if(name=="opacity"&&_101.browser.msie){
ret=_101.attr(_19a,"opacity");
return ret==""?"1":ret;
}
if(_101.browser.opera&&name=="display"){
var save=_19a.outline;
_19a.outline="0 solid black";
_19a.outline=save;
}
if(name.match(/float/i)){
name=styleFloat;
}
if(!_198&&_19a&&_19a[name]){
ret=_19a[name];
}else{
if(_164.getComputedStyle){
if(name.match(/float/i)){
name="float";
}
name=name.replace(/([A-Z])/g,"-$1").toLowerCase();
var _19e=_164.getComputedStyle(elem,null);
if(_19e&&!color(elem)){
ret=_19e.getPropertyValue(name);
}else{
var swap=[],_1a0=[],a=elem,i=0;
for(;a&&color(a);a=a.parentNode){
_1a0.unshift(a);
}
for(;i<_1a0.length;i++){
if(color(_1a0[i])){
swap[i]=_1a0[i].style.display;
_1a0[i].style.display="block";
}
}
ret=name=="display"&&swap[_1a0.length-1]!=null?"none":(_19e&&_19e.getPropertyValue(name))||"";
for(i=0;i<swap.length;i++){
if(swap[i]!=null){
_1a0[i].style.display=swap[i];
}
}
}
if(name=="opacity"&&ret==""){
ret="1";
}
}else{
if(elem.currentStyle){
var _1a3=name.replace(/\-(\w)/g,function(all,_1a5){
return _1a5.toUpperCase();
});
ret=elem.currentStyle[name]||elem.currentStyle[_1a3];
if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){
var left=_19a.left,_1a7=elem.runtimeStyle.left;
elem.runtimeStyle.left=elem.currentStyle.left;
_19a.left=ret||0;
ret=_19a.pixelLeft+"px";
_19a.left=left;
elem.runtimeStyle.left=_1a7;
}
}
}
}
return ret;
},clean:function(_1a8,_1a9){
var ret=[];
_1a9=_1a9||document;
if(typeof _1a9.createElement=="undefined"){
_1a9=_1a9.ownerDocument||_1a9[0]&&_1a9[0].ownerDocument||document;
}
_101.each(_1a8,function(i,elem){
if(!elem){
return;
}
if(elem.constructor==Number){
elem+="";
}
if(typeof elem=="string"){
elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,_1ae,tag){
return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:_1ae+"></"+tag+">";
});
var tags=_101.trim(elem).toLowerCase(),div=_1a9.createElement("div");
var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||_101.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];
div.innerHTML=wrap[1]+elem+wrap[2];
while(wrap[0]--){
div=div.lastChild;
}
if(_101.browser.msie){
var _1b3=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];
for(var j=_1b3.length-1;j>=0;--j){
if(_101.nodeName(_1b3[j],"tbody")&&!_1b3[j].childNodes.length){
_1b3[j].parentNode.removeChild(_1b3[j]);
}
}
if(/^\s/.test(elem)){
div.insertBefore(_1a9.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);
}
}
elem=_101.makeArray(div.childNodes);
}
if(elem.length===0&&(!_101.nodeName(elem,"form")&&!_101.nodeName(elem,"select"))){
return;
}
if(elem[0]==_106||_101.nodeName(elem,"form")||elem.options){
ret.push(elem);
}else{
ret=_101.merge(ret,elem);
}
});
return ret;
},attr:function(elem,name,_1b7){
if(!elem||elem.nodeType==3||elem.nodeType==8){
return _106;
}
var _1b8=!_101.isXMLDoc(elem),set=_1b7!==_106,msie=_101.browser.msie;
name=_1b8&&_101.props[name]||name;
if(elem.tagName){
var _1bb=/href|src|style/.test(name);
if(name=="selected"&&_101.browser.safari){
elem.parentNode.selectedIndex;
}
if(name in elem&&_1b8&&!_1bb){
if(set){
if(name=="type"&&_101.nodeName(elem,"input")&&elem.parentNode){
throw "type property can't be changed";
}
elem[name]=_1b7;
}
if(_101.nodeName(elem,"form")&&elem.getAttributeNode(name)){
return elem.getAttributeNode(name).nodeValue;
}
return elem[name];
}
if(msie&&_1b8&&name=="style"){
return _101.attr(elem.style,"cssText",_1b7);
}
if(set){
elem.setAttribute(name,""+_1b7);
}
var attr=msie&&_1b8&&_1bb?elem.getAttribute(name,2):elem.getAttribute(name);
return attr===null?_106:attr;
}
if(msie&&name=="opacity"){
if(set){
elem.zoom=1;
elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(_1b7)+""=="NaN"?"":"alpha(opacity="+_1b7*100+")");
}
return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":"";
}
name=name.replace(/-([a-z])/ig,function(all,_1be){
return _1be.toUpperCase();
});
if(set){
elem[name]=_1b7;
}
return elem[name];
},trim:function(text){
return (text||"").replace(/^\s+|\s+$/g,"");
},makeArray:function(_1c0){
var ret=[];
if(_1c0!=null){
var i=_1c0.length;
if(i==null||_1c0.split||_1c0.setInterval||_1c0.call){
ret[0]=_1c0;
}else{
while(i){
ret[--i]=_1c0[i];
}
}
}
return ret;
},inArray:function(elem,_1c4){
for(var i=0,_1c6=_1c4.length;i<_1c6;i++){
if(_1c4[i]===elem){
return i;
}
}
return -1;
},merge:function(_1c7,_1c8){
try{
var i=0,elem,pos=_1c7.length;
if(_101.browser.msie){
while(elem=_1c8[i++]){
if(elem.nodeType!=8){
_1c7[pos++]=elem;
}
}
}else{
while(elem=_1c8[i++]){
_1c7[pos++]=elem;
}
}
return _1c7;
}
catch(e){
return _1c7;
}
},unique:function(_1cc){
var ret=[],done={};
try{
for(var i=0,_1d0=_1cc.length;i<_1d0;i++){
var id=_101.data(_1cc[i]);
if(!done[id]){
done[id]=true;
ret.push(_1cc[i]);
}
}
}
catch(e){
ret=_1cc;
}
return ret;
},grep:function(_1d2,_1d3,inv){
var ret=[];
for(var i=0,_1d7=_1d2.length;i<_1d7;i++){
if(!inv!=!_1d3(_1d2[i],i)){
ret.push(_1d2[i]);
}
}
return ret;
},map:function(_1d8,_1d9){
var ret=[];
for(var i=0,_1dc=_1d8.length;i<_1dc;i++){
var _1dd=_1d9(_1d8[i],i);
if(_1dd!=null){
ret[ret.length]=_1dd;
}
}
return ret.concat.apply([],ret);
}});
var _1de=navigator.userAgent.toLowerCase();
_101.browser={version:(_1de.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(_1de),opera:/opera/.test(_1de),msie:/msie/.test(_1de)&&!/opera/.test(_1de),mozilla:/mozilla/.test(_1de)&&!/(compatible|webkit)/.test(_1de)};
var _1df=_101.browser.msie?"styleFloat":"cssFloat";
_101.extend({boxModel:!_101.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":_1df,cssFloat:_1df,styleFloat:_1df,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});
_101.each({parent:function(elem){
return elem.parentNode;
},parents:function(elem){
return _101.dir(elem,"parentNode");
},next:function(elem){
return _101.nth(elem,2,"nextSibling");
},prev:function(elem){
return _101.nth(elem,2,"previousSibling");
},nextAll:function(elem){
return _101.dir(elem,"nextSibling");
},prevAll:function(elem){
return _101.dir(elem,"previousSibling");
},siblings:function(elem){
return _101.sibling(elem.parentNode.firstChild,elem);
},children:function(elem){
return _101.sibling(elem.firstChild);
},contents:function(elem){
return _101.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:_101.makeArray(elem.childNodes);
}},function(name,fn){
_101.fn[name]=function(_1eb){
var ret=_101.map(this,fn);
if(_1eb&&typeof _1eb=="string"){
ret=_101.multiFilter(_1eb,ret);
}
return this.pushStack(_101.unique(ret));
};
});
_101.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,_1ee){
_101.fn[name]=function(){
var args=arguments;
return this.each(function(){
for(var i=0,_1f1=args.length;i<_1f1;i++){
_101(args[i])[_1ee](this);
}
});
};
});
_101.each({removeAttr:function(name){
_101.attr(this,name,"");
if(this.nodeType==1){
this.removeAttribute(name);
}
},addClass:function(_1f3){
_101.className.add(this,_1f3);
},removeClass:function(_1f4){
_101.className.remove(this,_1f4);
},toggleClass:function(_1f5){
_101.className[_101.className.has(this,_1f5)?"remove":"add"](this,_1f5);
},remove:function(_1f6){
if(!_1f6||_101.filter(_1f6,[this]).r.length){
_101("*",this).add(this).each(function(){
_101.event.remove(this);
_101.removeData(this);
});
if(this.parentNode){
this.parentNode.removeChild(this);
}
}
},empty:function(){
_101(">*",this).remove();
while(this.firstChild){
this.removeChild(this.firstChild);
}
}},function(name,fn){
_101.fn[name]=function(){
return this.each(fn,arguments);
};
});
_101.each(["Height","Width"],function(i,name){
var type=name.toLowerCase();
_101.fn[type]=function(size){
return this[0]==window?_101.browser.opera&&document.body["client"+name]||_101.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==_106?(this.length?_101.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");
};
});
function num(elem,prop){
return elem[0]&&parseInt(_101.curCSS(elem[0],prop,true),10)||0;
};
var _1ff=_101.browser.safari&&parseInt(_101.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w?-?*_-]|\\\\.)",_200=new RegExp("^>\\s*("+_1ff+"+)"),_201=new RegExp("^("+_1ff+"+)(#)("+_1ff+"+)"),_202=new RegExp("^([#.]?)("+_1ff+"*)");
_101.extend({expr:{"":function(a,i,m){
return m[2]=="*"||_101.nodeName(a,m[2]);
},"#":function(a,i,m){
return a.getAttribute("id")==m[2];
},":":{lt:function(a,i,m){
return i<m[3]-0;
},gt:function(a,i,m){
return i>m[3]-0;
},nth:function(a,i,m){
return m[3]-0==i;
},eq:function(a,i,m){
return m[3]-0==i;
},first:function(a,i){
return i==0;
},last:function(a,i,m,r){
return i==r.length-1;
},even:function(a,i){
return i%2==0;
},odd:function(a,i){
return i%2;
},"first-child":function(a){
return a.parentNode.getElementsByTagName("*")[0]==a;
},"last-child":function(a){
return _101.nth(a.parentNode.lastChild,1,"previousSibling")==a;
},"only-child":function(a){
return !_101.nth(a.parentNode.lastChild,2,"previousSibling");
},parent:function(a){
return a.firstChild;
},empty:function(a){
return !a.firstChild;
},contains:function(a,i,m){
return (a.textContent||a.innerText||_101(a).text()||"").indexOf(m[3])>=0;
},visible:function(a){
return "hidden"!=a.type&&_101.css(a,"display")!="none"&&_101.css(a,"visibility")!="hidden";
},hidden:function(a){
return "hidden"==a.type||_101.css(a,"display")=="none"||_101.css(a,"visibility")=="hidden";
},enabled:function(a){
return !a.disabled;
},disabled:function(a){
return a.disabled;
},checked:function(a){
return a.checked;
},selected:function(a){
return a.selected||_101.attr(a,"selected");
},text:function(a){
return "text"==a.type;
},radio:function(a){
return "radio"==a.type;
},checkbox:function(a){
return "checkbox"==a.type;
},file:function(a){
return "file"==a.type;
},password:function(a){
return "password"==a.type;
},submit:function(a){
return "submit"==a.type;
},image:function(a){
return "image"==a.type;
},reset:function(a){
return "reset"==a.type;
},button:function(a){
return "button"==a.type||_101.nodeName(a,"button");
},input:function(a){
return /input|select|textarea|button/i.test(a.nodeName);
},has:function(a,i,m){
return _101.find(m[3],a).length;
},header:function(a){
return /h\d/i.test(a.nodeName);
},animated:function(a){
return _101.grep(_101.timers,function(fn){
return a==fn.elem;
}).length;
}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+_1ff+"+)")],multiFilter:function(expr,_23e,not){
var old,cur=[];
while(expr&&expr!=old){
old=expr;
var f=_101.filter(expr,_23e,not);
expr=f.t.replace(/^\s*,\s*/,"");
cur=not?_23e=f.r:_101.merge(cur,f.r);
}
return cur;
},find:function(t,_244){
if(typeof t!="string"){
return [t];
}
if(_244&&_244.nodeType!=1&&_244.nodeType!=9){
return [];
}
_244=_244||document;
var ret=[_244],done=[],last,_248;
while(t&&last!=t){
var r=[];
last=t;
t=_101.trim(t);
var _24a=false,re=_200,m=re.exec(t);
if(m){
_248=m[1].toUpperCase();
for(var i=0;ret[i];i++){
for(var c=ret[i].firstChild;c;c=c.nextSibling){
if(c.nodeType==1&&(_248=="*"||c.nodeName.toUpperCase()==_248)){
r.push(c);
}
}
}
ret=r;
t=t.replace(re,"");
if(t.indexOf(" ")==0){
continue;
}
_24a=true;
}else{
re=/^([>+~])\s*(\w*)/i;
if((m=re.exec(t))!=null){
r=[];
var _24f={};
_248=m[2].toUpperCase();
m=m[1];
for(var j=0,rl=ret.length;j<rl;j++){
var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;
for(;n;n=n.nextSibling){
if(n.nodeType==1){
var id=_101.data(n);
if(m=="~"&&_24f[id]){
break;
}
if(!_248||n.nodeName.toUpperCase()==_248){
if(m=="~"){
_24f[id]=true;
}
r.push(n);
}
if(m=="+"){
break;
}
}
}
}
ret=r;
t=_101.trim(t.replace(re,""));
_24a=true;
}
}
if(t&&!_24a){
if(!t.indexOf(",")){
if(_244==ret[0]){
ret.shift();
}
done=_101.merge(done,ret);
r=ret=[_244];
t=" "+t.substr(1,t.length);
}else{
var re2=_201;
var m=re2.exec(t);
if(m){
m=[0,m[2],m[3],m[1]];
}else{
re2=_202;
m=re2.exec(t);
}
m[2]=m[2].replace(/\\/g,"");
var elem=ret[ret.length-1];
if(m[1]=="#"&&elem&&elem.getElementById&&!_101.isXMLDoc(elem)){
var oid=elem.getElementById(m[2]);
if((_101.browser.msie||_101.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){
oid=_101("[@id=\""+m[2]+"\"]",elem)[0];
}
ret=r=oid&&(!m[3]||_101.nodeName(oid,m[3]))?[oid]:[];
}else{
for(var i=0;ret[i];i++){
var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];
if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){
tag="param";
}
r=_101.merge(r,ret[i].getElementsByTagName(tag));
}
if(m[1]=="."){
r=_101.classFilter(r,m[2]);
}
if(m[1]=="#"){
var tmp=[];
for(var i=0;r[i];i++){
if(r[i].getAttribute("id")==m[2]){
tmp=[r[i]];
break;
}
}
r=tmp;
}
ret=r;
}
t=t.replace(re2,"");
}
}
if(t){
var val=_101.filter(t,r);
ret=r=val.r;
t=_101.trim(val.t);
}
}
if(t){
ret=[];
}
if(ret&&_244==ret[0]){
ret.shift();
}
done=_101.merge(done,ret);
return done;
},classFilter:function(r,m,not){
m=" "+m+" ";
var tmp=[];
for(var i=0;r[i];i++){
var pass=(" "+r[i].className+" ").indexOf(m)>=0;
if(!not&&pass||not&&!pass){
tmp.push(r[i]);
}
}
return tmp;
},filter:function(t,r,not){
var last;
while(t&&t!=last){
last=t;
var p=_101.parse,m;
for(var i=0;p[i];i++){
m=p[i].exec(t);
if(m){
t=t.substring(m[0].length);
m[2]=m[2].replace(/\\/g,"");
break;
}
}
if(!m){
break;
}
if(m[1]==":"&&m[2]=="not"){
r=_105.test(m[3])?_101.filter(m[3],r,true).r:_101(r).not(m[3]);
}else{
if(m[1]=="."){
r=_101.classFilter(r,m[2],not);
}else{
if(m[1]=="["){
var tmp=[],type=m[3];
for(var i=0,rl=r.length;i<rl;i++){
var a=r[i],z=a[_101.props[m[2]]||m[2]];
if(z==null||/href|src|selected/.test(m[2])){
z=_101.attr(a,m[2])||"";
}
if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not){
tmp.push(a);
}
}
r=tmp;
}else{
if(m[1]==":"&&m[2]=="nth-child"){
var _26c={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),_26e=(test[1]+(test[2]||1))-0,last=test[3]-0;
for(var i=0,rl=r.length;i<rl;i++){
var node=r[i],_270=node.parentNode,id=_101.data(_270);
if(!_26c[id]){
var c=1;
for(var n=_270.firstChild;n;n=n.nextSibling){
if(n.nodeType==1){
n.nodeIndex=c++;
}
}
_26c[id]=true;
}
var add=false;
if(_26e==0){
if(node.nodeIndex==last){
add=true;
}
}else{
if((node.nodeIndex-last)%_26e==0&&(node.nodeIndex-last)/_26e>=0){
add=true;
}
}
if(add^not){
tmp.push(node);
}
}
r=tmp;
}else{
var fn=_101.expr[m[1]];
if(typeof fn=="object"){
fn=fn[m[2]];
}
if(typeof fn=="string"){
fn=eval("false||function(a,i){return "+fn+";}");
}
r=_101.grep(r,function(elem,i){
return fn(elem,i,m,r);
},not);
}
}
}
}
}
return {r:r,t:t};
},dir:function(elem,dir){
var _27a=[],cur=elem[dir];
while(cur&&cur!=document){
if(cur.nodeType==1){
_27a.push(cur);
}
cur=cur[dir];
}
return _27a;
},nth:function(cur,_27d,dir,elem){
_27d=_27d||1;
var num=0;
for(;cur;cur=cur[dir]){
if(cur.nodeType==1&&++num==_27d){
break;
}
}
return cur;
},sibling:function(n,elem){
var r=[];
for(;n;n=n.nextSibling){
if(n.nodeType==1&&n!=elem){
r.push(n);
}
}
return r;
}});
_101.event={add:function(elem,_285,_286,data){
if(elem.nodeType==3||elem.nodeType==8){
return;
}
if(_101.browser.msie&&elem.setInterval){
elem=window;
}
if(!_286.guid){
_286.guid=this.guid++;
}
if(data!=_106){
var fn=_286;
_286=this.proxy(fn,function(){
return fn.apply(this,arguments);
});
_286.data=data;
}
var _289=_101.data(elem,"events")||_101.data(elem,"events",{}),_28a=_101.data(elem,"handle")||_101.data(elem,"handle",function(){
if(typeof _101!="undefined"&&!_101.event.triggered){
return _101.event.handle.apply(arguments.callee.elem,arguments);
}
});
_28a.elem=elem;
_101.each(_285.split(/\s+/),function(_28b,type){
var _28d=type.split(".");
type=_28d[0];
_286.type=_28d[1];
var _28e=_289[type];
if(!_28e){
_28e=_289[type]={};
if(!_101.event.special[type]||_101.event.special[type].setup.call(elem)===false){
if(elem.addEventListener){
elem.addEventListener(type,_28a,false);
}else{
if(elem.attachEvent){
elem.attachEvent("on"+type,_28a);
}
}
}
}
_28e[_286.guid]=_286;
_101.event.global[type]=true;
});
elem=null;
},guid:1,global:{},remove:function(elem,_290,_291){
if(elem.nodeType==3||elem.nodeType==8){
return;
}
var _292=_101.data(elem,"events"),ret,_294;
if(_292){
if(_290==_106||(typeof _290=="string"&&_290.charAt(0)==".")){
for(var type in _292){
this.remove(elem,type+(_290||""));
}
}else{
if(_290.type){
_291=_290.handler;
_290=_290.type;
}
_101.each(_290.split(/\s+/),function(_296,type){
var _298=type.split(".");
type=_298[0];
if(_292[type]){
if(_291){
delete _292[type][_291.guid];
}else{
for(_291 in _292[type]){
if(!_298[1]||_292[type][_291].type==_298[1]){
delete _292[type][_291];
}
}
}
for(ret in _292[type]){
break;
}
if(!ret){
if(!_101.event.special[type]||_101.event.special[type].teardown.call(elem)===false){
if(elem.removeEventListener){
elem.removeEventListener(type,_101.data(elem,"handle"),false);
}else{
if(elem.detachEvent){
elem.detachEvent("on"+type,_101.data(elem,"handle"));
}
}
}
ret=null;
delete _292[type];
}
}
});
}
for(ret in _292){
break;
}
if(!ret){
var _299=_101.data(elem,"handle");
if(_299){
_299.elem=null;
}
_101.removeData(elem,"events");
_101.removeData(elem,"handle");
}
}
},trigger:function(type,data,elem,_29d,_29e){
data=_101.makeArray(data);
if(type.indexOf("!")>=0){
type=type.slice(0,-1);
var _29f=true;
}
if(!elem){
if(this.global[type]){
_101("*").add([window,document]).trigger(type,data);
}
}else{
if(elem.nodeType==3||elem.nodeType==8){
return _106;
}
var val,ret,fn=_101.isFunction(elem[type]||null),_2a3=!data[0]||!data[0].preventDefault;
if(_2a3){
data.unshift({type:type,target:elem,preventDefault:function(){
},stopPropagation:function(){
},timeStamp:now()});
data[0][_160]=true;
}
data[0].type=type;
if(_29f){
data[0].exclusive=true;
}
var _2a4=_101.data(elem,"handle");
if(_2a4){
val=_2a4.apply(elem,data);
}
if((!fn||(_101.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){
val=false;
}
if(_2a3){
data.shift();
}
if(_29e&&_101.isFunction(_29e)){
ret=_29e.apply(elem,val==null?data:data.concat(val));
if(ret!==_106){
val=ret;
}
}
if(fn&&_29d!==false&&val!==false&&!(_101.nodeName(elem,"a")&&type=="click")){
this.triggered=true;
try{
elem[type]();
}
catch(e){
}
}
this.triggered=false;
}
return val;
},handle:function(_2a5){
var val,ret,_2a8,all,_2aa;
_2a5=arguments[0]=_101.event.fix(_2a5||window.event);
_2a8=_2a5.type.split(".");
_2a5.type=_2a8[0];
_2a8=_2a8[1];
all=!_2a8&&!_2a5.exclusive;
_2aa=(_101.data(this,"events")||{})[_2a5.type];
for(var j in _2aa){
var _2ac=_2aa[j];
if(all||_2ac.type==_2a8){
_2a5.handler=_2ac;
_2a5.data=_2ac.data;
ret=_2ac.apply(this,arguments);
if(val!==false){
val=ret;
}
if(ret===false){
_2a5.preventDefault();
_2a5.stopPropagation();
}
}
}
return val;
},fix:function(_2ad){
if(_2ad[_160]==true){
return _2ad;
}
var _2ae=_2ad;
_2ad={originalEvent:_2ae};
var _2af="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");
for(var i=_2af.length;i;i--){
_2ad[_2af[i]]=_2ae[_2af[i]];
}
_2ad[_160]=true;
_2ad.preventDefault=function(){
if(_2ae.preventDefault){
_2ae.preventDefault();
}
_2ae.returnValue=false;
};
_2ad.stopPropagation=function(){
if(_2ae.stopPropagation){
_2ae.stopPropagation();
}
_2ae.cancelBubble=true;
};
_2ad.timeStamp=_2ad.timeStamp||now();
if(!_2ad.target){
_2ad.target=_2ad.srcElement||document;
}
if(_2ad.target.nodeType==3){
_2ad.target=_2ad.target.parentNode;
}
if(!_2ad.relatedTarget&&_2ad.fromElement){
_2ad.relatedTarget=_2ad.fromElement==_2ad.target?_2ad.toElement:_2ad.fromElement;
}
if(_2ad.pageX==null&&_2ad.clientX!=null){
var doc=document.documentElement,body=document.body;
_2ad.pageX=_2ad.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);
_2ad.pageY=_2ad.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);
}
if(!_2ad.which&&((_2ad.charCode||_2ad.charCode===0)?_2ad.charCode:_2ad.keyCode)){
_2ad.which=_2ad.charCode||_2ad.keyCode;
}
if(!_2ad.metaKey&&_2ad.ctrlKey){
_2ad.metaKey=_2ad.ctrlKey;
}
if(!_2ad.which&&_2ad.button){
_2ad.which=(_2ad.button&1?1:(_2ad.button&2?3:(_2ad.button&4?2:0)));
}
return _2ad;
},proxy:function(fn,_2b4){
_2b4.guid=fn.guid=fn.guid||_2b4.guid||this.guid++;
return _2b4;
},special:{ready:{setup:function(){
bindReady();
return;
},teardown:function(){
return;
}},mouseenter:{setup:function(){
if(_101.browser.msie){
return false;
}
_101(this).bind("mouseover",_101.event.special.mouseenter.handler);
return true;
},teardown:function(){
if(_101.browser.msie){
return false;
}
_101(this).unbind("mouseover",_101.event.special.mouseenter.handler);
return true;
},handler:function(_2b5){
if(_2b6(_2b5,this)){
return true;
}
_2b5.type="mouseenter";
return _101.event.handle.apply(this,arguments);
}},mouseleave:{setup:function(){
if(_101.browser.msie){
return false;
}
_101(this).bind("mouseout",_101.event.special.mouseleave.handler);
return true;
},teardown:function(){
if(_101.browser.msie){
return false;
}
_101(this).unbind("mouseout",_101.event.special.mouseleave.handler);
return true;
},handler:function(_2b7){
if(_2b6(_2b7,this)){
return true;
}
_2b7.type="mouseleave";
return _101.event.handle.apply(this,arguments);
}}}};
_101.fn.extend({bind:function(type,data,fn){
return type=="unload"?this.one(type,data,fn):this.each(function(){
_101.event.add(this,type,fn||data,fn&&data);
});
},one:function(type,data,fn){
var one=_101.event.proxy(fn||data,function(_2bf){
_101(this).unbind(_2bf,one);
return (fn||data).apply(this,arguments);
});
return this.each(function(){
_101.event.add(this,type,one,fn&&data);
});
},unbind:function(type,fn){
return this.each(function(){
_101.event.remove(this,type,fn);
});
},trigger:function(type,data,fn){
return this.each(function(){
_101.event.trigger(type,data,this,true,fn);
});
},triggerHandler:function(type,data,fn){
return this[0]&&_101.event.trigger(type,data,this[0],false,fn);
},toggle:function(fn){
var args=arguments,i=1;
while(i<args.length){
_101.event.proxy(fn,args[i++]);
}
return this.click(_101.event.proxy(fn,function(_2cb){
this.lastToggle=(this.lastToggle||0)%i;
_2cb.preventDefault();
return args[this.lastToggle++].apply(this,arguments)||false;
}));
},hover:function(_2cc,_2cd){
return this.bind("mouseenter",_2cc).bind("mouseleave",_2cd);
},ready:function(fn){
bindReady();
if(_101.isReady){
fn.call(document,_101);
}else{
_101.readyList.push(function(){
return fn.call(this,_101);
});
}
return this;
}});
_101.extend({isReady:false,readyList:[],ready:function(){
if(!_101.isReady){
_101.isReady=true;
if(_101.readyList){
_101.each(_101.readyList,function(){
this.call(document);
});
_101.readyList=null;
}
_101(document).triggerHandler("ready");
}
}});
var _2cf=false;
function bindReady(){
if(_2cf){
return;
}
_2cf=true;
if(document.addEventListener&&!_101.browser.opera){
document.addEventListener("DOMContentLoaded",_101.ready,false);
}
if(_101.browser.msie&&window==top){
(function(){
if(_101.isReady){
return;
}
try{
document.documentElement.doScroll("left");
}
catch(error){
setTimeout(arguments.callee,0);
return;
}
_101.ready();
})();
}
if(_101.browser.opera){
document.addEventListener("DOMContentLoaded",function(){
if(_101.isReady){
return;
}
for(var i=0;i<document.styleSheets.length;i++){
if(document.styleSheets[i].disabled){
setTimeout(arguments.callee,0);
return;
}
}
_101.ready();
},false);
}
if(_101.browser.safari){
var _2d1;
(function(){
if(_101.isReady){
return;
}
if(document.readyState!="loaded"&&document.readyState!="complete"){
setTimeout(arguments.callee,0);
return;
}
if(_2d1===_106){
_2d1=_101("style, link[rel=stylesheet]").length;
}
if(document.styleSheets.length!=_2d1){
setTimeout(arguments.callee,0);
return;
}
_101.ready();
})();
}
_101.event.add(window,"load",_101.ready);
};
_101.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){
_101.fn[name]=function(fn){
return fn?this.bind(name,fn):this.trigger(name);
};
});
var _2b6=function(_2d5,elem){
var _2d7=_2d5.relatedTarget;
while(_2d7&&_2d7!=elem){
try{
_2d7=_2d7.parentNode;
}
catch(error){
_2d7=elem;
}
}
return _2d7==elem;
};
_101(window).bind("unload",function(){
_101("*").add(document).unbind();
});
_101.fn.extend({_load:_101.fn.load,load:function(url,_2d9,_2da){
if(typeof url!="string"){
return this._load(url);
}
var off=url.indexOf(" ");
if(off>=0){
var _2dc=url.slice(off,url.length);
url=url.slice(0,off);
}
_2da=_2da||function(){
};
var type="GET";
if(_2d9){
if(_101.isFunction(_2d9)){
_2da=_2d9;
_2d9=null;
}else{
_2d9=_101.param(_2d9);
type="POST";
}
}
var self=this;
_101.ajax({url:url,type:type,dataType:"html",data:_2d9,complete:function(res,_2e0){
if(_2e0=="success"||_2e0=="notmodified"){
self.html(_2dc?_101("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(_2dc):res.responseText);
}
self.each(_2da,[res.responseText,_2e0,res]);
}});
return this;
},serialize:function(){
return _101.param(this.serializeArray());
},serializeArray:function(){
return this.map(function(){
return _101.nodeName(this,"form")?_101.makeArray(this.elements):this;
}).filter(function(){
return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));
}).map(function(i,elem){
var val=_101(this).val();
return val==null?null:val.constructor==Array?_101.map(val,function(val,i){
return {name:elem.name,value:val};
}):{name:elem.name,value:val};
}).get();
}});
_101.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){
_101.fn[o]=function(f){
return this.bind(o,f);
};
});
var jsc=now();
_101.extend({get:function(url,data,_2ec,type){
if(_101.isFunction(data)){
_2ec=data;
data=null;
}
return _101.ajax({type:"GET",url:url,data:data,success:_2ec,dataType:type});
},getScript:function(url,_2ef){
return _101.get(url,null,_2ef,"script");
},getJSON:function(url,data,_2f2){
return _101.get(url,data,_2f2,"json");
},post:function(url,data,_2f5,type){
if(_101.isFunction(data)){
_2f5=data;
data={};
}
return _101.ajax({type:"POST",url:url,data:data,success:_2f5,dataType:type});
},ajaxSetup:function(_2f7){
_101.extend(_101.ajaxSettings,_2f7);
},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){
s=_101.extend(true,s,_101.extend(true,{},_101.ajaxSettings,s));
var _2f9,jsre=/=\?(&|$)/g,_2fb,data,type=s.type.toUpperCase();
if(s.data&&s.processData&&typeof s.data!="string"){
s.data=_101.param(s.data);
}
if(s.dataType=="jsonp"){
if(type=="GET"){
if(!s.url.match(jsre)){
s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";
}
}else{
if(!s.data||!s.data.match(jsre)){
s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";
}
}
s.dataType="json";
}
if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){
_2f9="jsonp"+jsc++;
if(s.data){
s.data=(s.data+"").replace(jsre,"="+_2f9+"$1");
}
s.url=s.url.replace(jsre,"="+_2f9+"$1");
s.dataType="script";
window[_2f9]=function(tmp){
data=tmp;
success();
complete();
window[_2f9]=_106;
try{
delete window[_2f9];
}
catch(e){
}
if(head){
head.removeChild(_300);
}
};
}
if(s.dataType=="script"&&s.cache==null){
s.cache=false;
}
if(s.cache===false&&type=="GET"){
var ts=now();
var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");
s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");
}
if(s.data&&type=="GET"){
s.url+=(s.url.match(/\?/)?"&":"?")+s.data;
s.data=null;
}
if(s.global&&!_101.active++){
_101.event.trigger("ajaxStart");
}
var _303=/^(?:\w+:)?\/\/([^\/?#]+)/;
if(s.dataType=="script"&&type=="GET"&&_303.test(s.url)&&_303.exec(s.url)[1]!=location.host){
var head=document.getElementsByTagName("head")[0];
var _300=document.createElement("script");
_300.src=s.url;
if(s.scriptCharset){
_300.charset=s.scriptCharset;
}
if(!_2f9){
var done=false;
_300.onload=_300.onreadystatechange=function(){
if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){
done=true;
success();
complete();
head.removeChild(_300);
}
};
}
head.appendChild(_300);
return _106;
}
var _305=false;
var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
if(s.username){
xhr.open(type,s.url,s.async,s.username,s.password);
}else{
xhr.open(type,s.url,s.async);
}
try{
if(s.data){
xhr.setRequestHeader("Content-Type",s.contentType);
}
if(s.ifModified){
xhr.setRequestHeader("If-Modified-Since",_101.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");
}
xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");
xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);
}
catch(e){
}
if(s.beforeSend&&s.beforeSend(xhr,s)===false){
s.global&&_101.active--;
xhr.abort();
return false;
}
if(s.global){
_101.event.trigger("ajaxSend",[xhr,s]);
}
var _307=function(_308){
if(!_305&&xhr&&(xhr.readyState==4||_308=="timeout")){
_305=true;
if(ival){
clearInterval(ival);
ival=null;
}
_2fb=_308=="timeout"&&"timeout"||!_101.httpSuccess(xhr)&&"error"||s.ifModified&&_101.httpNotModified(xhr,s.url)&&"notmodified"||"success";
if(_2fb=="success"){
try{
data=_101.httpData(xhr,s.dataType,s.dataFilter);
}
catch(e){
_2fb="parsererror";
}
}
if(_2fb=="success"){
var _30a;
try{
_30a=xhr.getResponseHeader("Last-Modified");
}
catch(e){
}
if(s.ifModified&&_30a){
_101.lastModified[s.url]=_30a;
}
if(!_2f9){
success();
}
}else{
_101.handleError(s,xhr,_2fb);
}
complete();
if(s.async){
xhr=null;
}
}
};
if(s.async){
var ival=setInterval(_307,13);
if(s.timeout>0){
setTimeout(function(){
if(xhr){
xhr.abort();
if(!_305){
_307("timeout");
}
}
},s.timeout);
}
}
try{
xhr.send(s.data);
}
catch(e){
_101.handleError(s,xhr,null,e);
}
if(!s.async){
_307();
}
function success(){
if(s.success){
s.success(data,_2fb);
}
if(s.global){
_101.event.trigger("ajaxSuccess",[xhr,s]);
}
};
function complete(){
if(s.complete){
s.complete(xhr,_2fb);
}
if(s.global){
_101.event.trigger("ajaxComplete",[xhr,s]);
}
if(s.global&&!--_101.active){
_101.event.trigger("ajaxStop");
}
};
return xhr;
},handleError:function(s,xhr,_30d,e){
if(s.error){
s.error(xhr,_30d,e);
}
if(s.global){
_101.event.trigger("ajaxError",[xhr,s,e]);
}
},active:0,httpSuccess:function(xhr){
try{
return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||_101.browser.safari&&xhr.status==_106;
}
catch(e){
}
return false;
},httpNotModified:function(xhr,url){
try{
var _312=xhr.getResponseHeader("Last-Modified");
return xhr.status==304||_312==_101.lastModified[url]||_101.browser.safari&&xhr.status==_106;
}
catch(e){
}
return false;
},httpData:function(xhr,type,_315){
var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;
if(xml&&data.documentElement.tagName=="parsererror"){
throw "parsererror";
}
if(_315){
data=_315(data,type);
}
if(type=="script"){
_101.globalEval(data);
}
if(type=="json"){
data=eval("("+data+")");
}
return data;
},param:function(a){
var s=[];
if(a.constructor==Array||a.jquery){
_101.each(a,function(){
s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));
});
}else{
for(var j in a){
if(a[j]&&a[j].constructor==Array){
_101.each(a[j],function(){
s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));
});
}else{
s.push(encodeURIComponent(j)+"="+encodeURIComponent(_101.isFunction(a[j])?a[j]():a[j]));
}
}
}
return s.join("&").replace(/%20/g,"+");
}});
_101.fn.extend({show:function(_31c,_31d){
return _31c?this.animate({height:"show",width:"show",opacity:"show"},_31c,_31d):this.filter(":hidden").each(function(){
this.style.display=this.oldblock||"";
if(_101.css(this,"display")=="none"){
var elem=_101("<"+this.tagName+" />").appendTo("body");
this.style.display=elem.css("display");
if(this.style.display=="none"){
this.style.display="block";
}
elem.remove();
}
}).end();
},hide:function(_31f,_320){
return _31f?this.animate({height:"hide",width:"hide",opacity:"hide"},_31f,_320):this.filter(":visible").each(function(){
this.oldblock=this.oldblock||_101.css(this,"display");
this.style.display="none";
}).end();
},_toggle:_101.fn.toggle,toggle:function(fn,fn2){
return _101.isFunction(fn)&&_101.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){
_101(this)[_101(this).is(":hidden")?"show":"hide"]();
});
},slideDown:function(_323,_324){
return this.animate({height:"show"},_323,_324);
},slideUp:function(_325,_326){
return this.animate({height:"hide"},_325,_326);
},slideToggle:function(_327,_328){
return this.animate({height:"toggle"},_327,_328);
},fadeIn:function(_329,_32a){
return this.animate({opacity:"show"},_329,_32a);
},fadeOut:function(_32b,_32c){
return this.animate({opacity:"hide"},_32b,_32c);
},fadeTo:function(_32d,to,_32f){
return this.animate({opacity:to},_32d,_32f);
},animate:function(prop,_331,_332,_333){
var _334=_101.speed(_331,_332,_333);
return this[_334.queue===false?"each":"queue"](function(){
if(this.nodeType!=1){
return false;
}
var opt=_101.extend({},_334),p,_337=_101(this).is(":hidden"),self=this;
for(p in prop){
if(prop[p]=="hide"&&_337||prop[p]=="show"&&!_337){
return opt.complete.call(this);
}
if(p=="height"||p=="width"){
opt.display=_101.css(this,"display");
opt.overflow=this.style.overflow;
}
}
if(opt.overflow!=null){
this.style.overflow="hidden";
}
opt.curAnim=_101.extend({},prop);
_101.each(prop,function(name,val){
var e=new _101.fx(self,opt,name);
if(/toggle|show|hide/.test(val)){
e[val=="toggle"?_337?"show":"hide":val](prop);
}else{
var _33c=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),_33d=e.cur(true)||0;
if(_33c){
var end=parseFloat(_33c[2]),unit=_33c[3]||"px";
if(unit!="px"){
self.style[name]=(end||1)+unit;
_33d=((end||1)/e.cur(true))*_33d;
self.style[name]=_33d+unit;
}
if(_33c[1]){
end=((_33c[1]=="-="?-1:1)*end)+_33d;
}
e.custom(_33d,end,unit);
}else{
e.custom(_33d,val,"");
}
}
});
return true;
});
},queue:function(type,fn){
if(_101.isFunction(type)||(type&&type.constructor==Array)){
fn=type;
type="fx";
}
if(!type||(typeof type=="string"&&!fn)){
return queue(this[0],type);
}
return this.each(function(){
if(fn.constructor==Array){
_342(this,type,fn);
}else{
_342(this,type).push(fn);
if(_342(this,type).length==1){
fn.call(this);
}
}
});
},stop:function(_343,_344){
var _345=_101.timers;
if(_343){
this.queue([]);
}
this.each(function(){
for(var i=_345.length-1;i>=0;i--){
if(_345[i].elem==this){
if(_344){
_345[i](true);
}
_345.splice(i,1);
}
}
});
if(!_344){
this.dequeue();
}
return this;
}});
var _342=function(elem,type,_349){
if(elem){
type=type||"fx";
var q=_101.data(elem,type+"queue");
if(!q||_349){
q=_101.data(elem,type+"queue",_101.makeArray(_349));
}
}
return q;
};
_101.fn.dequeue=function(type){
type=type||"fx";
return this.each(function(){
var q=_342(this,type);
q.shift();
if(q.length){
q[0].call(this);
}
});
};
_101.extend({speed:function(_34d,_34e,fn){
var opt=_34d&&_34d.constructor==Object?_34d:{complete:fn||!fn&&_34e||_101.isFunction(_34d)&&_34d,duration:_34d,easing:fn&&_34e||_34e&&_34e.constructor!=Function&&_34e};
opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:_101.fx.speeds[opt.duration])||_101.fx.speeds.def;
opt.old=opt.complete;
opt.complete=function(){
if(opt.queue!==false){
_101(this).dequeue();
}
if(_101.isFunction(opt.old)){
opt.old.call(this);
}
};
return opt;
},easing:{linear:function(p,n,_353,diff){
return _353+diff*p;
},swing:function(p,n,_357,diff){
return ((-Math.cos(p*Math.PI)/2)+0.5)*diff+_357;
}},timers:[],timerId:null,fx:function(elem,_35a,prop){
this.options=_35a;
this.elem=elem;
this.prop=prop;
if(!_35a.orig){
_35a.orig={};
}
}});
_101.fx.prototype={update:function(){
if(this.options.step){
this.options.step.call(this.elem,this.now,this);
}
(_101.fx.step[this.prop]||_101.fx.step._default)(this);
if(this.prop=="height"||this.prop=="width"){
this.elem.style.display="block";
}
},cur:function(_35c){
if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){
return this.elem[this.prop];
}
var r=parseFloat(_101.css(this.elem,this.prop,_35c));
return r&&r>-10000?r:parseFloat(_101.curCSS(this.elem,this.prop))||0;
},custom:function(from,to,unit){
this.startTime=now();
this.start=from;
this.end=to;
this.unit=unit||this.unit||"px";
this.now=this.start;
this.pos=this.state=0;
this.update();
var self=this;
function t(_362){
return self.step(_362);
};
t.elem=this.elem;
_101.timers.push(t);
if(_101.timerId==null){
_101.timerId=setInterval(function(){
var _363=_101.timers;
for(var i=0;i<_363.length;i++){
if(!_363[i]()){
_363.splice(i--,1);
}
}
if(!_363.length){
clearInterval(_101.timerId);
_101.timerId=null;
}
},13);
}
},show:function(){
this.options.orig[this.prop]=_101.attr(this.elem.style,this.prop);
this.options.show=true;
this.custom(0,this.cur());
if(this.prop=="width"||this.prop=="height"){
this.elem.style[this.prop]="1px";
}
_101(this.elem).show();
},hide:function(){
this.options.orig[this.prop]=_101.attr(this.elem.style,this.prop);
this.options.hide=true;
this.custom(this.cur(),0);
},step:function(_365){
var t=now();
if(_365||t>this.options.duration+this.startTime){
this.now=this.end;
this.pos=this.state=1;
this.update();
this.options.curAnim[this.prop]=true;
var done=true;
for(var i in this.options.curAnim){
if(this.options.curAnim[i]!==true){
done=false;
}
}
if(done){
if(this.options.display!=null){
this.elem.style.overflow=this.options.overflow;
this.elem.style.display=this.options.display;
if(_101.css(this.elem,"display")=="none"){
this.elem.style.display="block";
}
}
if(this.options.hide){
this.elem.style.display="none";
}
if(this.options.hide||this.options.show){
for(var p in this.options.curAnim){
_101.attr(this.elem.style,p,this.options.orig[p]);
}
}
}
if(done){
this.options.complete.call(this.elem);
}
return false;
}else{
var n=t-this.startTime;
this.state=n/this.options.duration;
this.pos=_101.easing[this.options.easing||(_101.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);
this.now=this.start+((this.end-this.start)*this.pos);
this.update();
}
return true;
}};
_101.extend(_101.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){
fx.elem.scrollLeft=fx.now;
},scrollTop:function(fx){
fx.elem.scrollTop=fx.now;
},opacity:function(fx){
_101.attr(fx.elem.style,"opacity",fx.now);
},_default:function(fx){
fx.elem.style[fx.prop]=fx.now+fx.unit;
}}});
_101.fn.offset=function(){
var left=0,top=0,elem=this[0],_372;
if(elem){
with(_101.browser){
var _373=elem.parentNode,_374=elem,_375=elem.offsetParent,doc=elem.ownerDocument,_377=safari&&parseInt(version)<522&&!/adobeair/i.test(_1de),css=_101.curCSS,_379=css(elem,"position")=="fixed";
if(elem.getBoundingClientRect){
var box=elem.getBoundingClientRect();
add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));
add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);
}else{
add(elem.offsetLeft,elem.offsetTop);
while(_375){
add(_375.offsetLeft,_375.offsetTop);
if(mozilla&&!/^t(able|d|h)$/i.test(_375.tagName)||safari&&!_377){
border(_375);
}
if(!_379&&css(_375,"position")=="fixed"){
_379=true;
}
_374=/^body$/i.test(_375.tagName)?_374:_375;
_375=_375.offsetParent;
}
while(_373&&_373.tagName&&!/^body|html$/i.test(_373.tagName)){
if(!/^inline|table.*$/i.test(css(_373,"display"))){
add(-_373.scrollLeft,-_373.scrollTop);
}
if(mozilla&&css(_373,"overflow")!="visible"){
border(_373);
}
_373=_373.parentNode;
}
if((_377&&(_379||css(_374,"position")=="absolute"))||(mozilla&&css(_374,"position")!="absolute")){
add(-doc.body.offsetLeft,-doc.body.offsetTop);
}
if(_379){
add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));
}
}
_372={top:top,left:left};
}
}
function border(elem){
add(_101.curCSS(elem,"borderLeftWidth",true),_101.curCSS(elem,"borderTopWidth",true));
};
function add(l,t){
left+=parseInt(l,10)||0;
top+=parseInt(t,10)||0;
};
return _372;
};
_101.fn.extend({position:function(){
var left=0,top=0,_380;
if(this[0]){
var _381=this.offsetParent(),_382=this.offset(),_383=/^body|html$/i.test(_381[0].tagName)?{top:0,left:0}:_381.offset();
_382.top-=num(this,"marginTop");
_382.left-=num(this,"marginLeft");
_383.top+=num(_381,"borderTopWidth");
_383.left+=num(_381,"borderLeftWidth");
_380={top:_382.top-_383.top,left:_382.left-_383.left};
}
return _380;
},offsetParent:function(){
var _384=this[0].offsetParent;
while(_384&&(!/^body|html$/i.test(_384.tagName)&&_101.css(_384,"position")=="static")){
_384=_384.offsetParent;
}
return _101(_384);
}});
_101.each(["Left","Top"],function(i,name){
var _387="scroll"+name;
_101.fn[_387]=function(val){
if(!this[0]){
return;
}
return val!=_106?this.each(function(){
this==window||this==document?window.scrollTo(!i?val:_101(window).scrollLeft(),i?val:_101(window).scrollTop()):this[_387]=val;
}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||_101.boxModel&&document.documentElement[_387]||document.body[_387]:this[0][_387];
};
});
_101.each(["Height","Width"],function(i,name){
var tl=i?"Left":"Top",br=i?"Right":"Bottom";
_101.fn["inner"+name]=function(){
return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);
};
_101.fn["outer"+name]=function(_38d){
return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(_38d?num(this,"margin"+tl)+num(this,"margin"+br):0);
};
});
})();
(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,_3ab){
return me.createElement(_3ab);
};
}
},createElement:function(_3ac){
if(this.svg_capable){
var _3ad=document.createElementNS("http://www.w3.org/2000/svg",_3ac);
if(_3ac=="rect"){
_3ad.applyGradient=function(_3ae){
if(_3ae.type=="LinearGradient"){
var _3af=_3ad.parentNode;
if(!document.getElementById(_3ae.id)){
var _3b0=document.createElementNS("http://www.w3.org/2000/svg","linearGradient");
_3b0.id=_3ae.id;
var _3b1=(_3ae.angle+90)%360;
if(_3b1<0){
_3b1=_3b1%360+360;
}
var _3b2="X";
var _3b3=0;
var _3b4=0;
var _3b5=100;
var _3b6=100;
if((_3b1-45)%180/180>0&&(_3b1-45)%180/180<0.5){
_3b2="Y";
}
if(_3b2=="Y"){
if(_3b1>225){
_3b5=((_3b1-225))/90*100;
_3b6=0;
_3b3=100-_3b5;
_3b4=100;
}else{
_3b3=((_3b1-45))/90*100;
_3b4=0;
_3b5=100-_3b3;
_3b6=100;
}
}else{
if(_3b1<45||_3b1>=315){
_3b6=((_3b1+225)%90)/90*100;
_3b5=0;
_3b4=100-_3b6;
_3b3=100;
}else{
_3b4=((_3b1+45)%90)/90*100;
_3b3=0;
_3b6=100-_3b4;
_3b5=100;
}
}
_3b0.setAttribute("x1",_3b3+"%");
_3b0.setAttribute("y1",_3b4+"%");
_3b0.setAttribute("x2",_3b5+"%");
_3b0.setAttribute("y2",_3b6+"%");
var _3b7=document.createElementNS("http://www.w3.org/2000/svg","stop");
_3b7.setAttribute("offset","0%");
_3b7.setAttribute("stop-color",_3ae.endColor);
_3b0.appendChild(_3b7);
var _3b8=document.createElementNS("http://www.w3.org/2000/svg","stop");
_3b8.setAttribute("offset","100%");
_3b8.setAttribute("stop-color",_3ae.startColor);
_3b0.appendChild(_3b8);
if(!_3af.defs){
_3af.appendChild(document.createElementNS("http://www.w3.org/2000/svg","defs"));
}
_3af.getElementsByTagName("defs")[0].appendChild(_3b0);
this.setAttribute("fill","url(#"+_3ae.id+")");
}
}
};
}
return _3ad;
}else{
if(this.vml_capable){
if(_3ac=="svg"){
return createVMLSurface();
}else{
if(_3ac=="g"){
return createVMLGroup();
}else{
if(_3ac=="circle"){
return createVMLCircle();
}else{
if(_3ac=="ellipse"){
return createVMLEllipse();
}else{
if(_3ac=="rect"){
return createVMLRectangle();
}else{
if(_3ac=="line"){
return createVMLLine();
}else{
if(_3ac=="path"){
return createVMLPath();
}else{
if(_3ac=="linearGradient"){
return createVMLLinearGradient();
}else{
if(_3ac=="stop"){
return createVMLStop();
}else{
if(_3ac=="defs"){
return createVMLDefs();
}else{
if(_3ac=="polyline"){
return createVMLPolyLine();
}
}
}
}
}
}
}
}
}
}
}
}else{
}
}
}};
var createVMLSurface=function(){
var _3b9=document.createElement("div");
_3b9.style.position="absolute";
_3b9.style.left="0px";
_3b9.style.top="0px";
_3b9.setAttribute=function(key,_3bb){
if(key=="width"){
this.style.width=_3bb;
}else{
if(key=="height"){
this.style.height=_3bb;
}else{
if(key=="x"){
this.style.left=_3bb;
}else{
if(key=="y"){
this.style.top=_3bb;
}
}
}
}
};
return _3b9;
};
var createVMLGroup=function(){
var _3bc=document.createElement("div");
_3bc.style.position="absolute";
_3bc.style.left="0px";
_3bc.style.top="0px";
_3bc.defs={};
_3bc.setAttribute=function(key,_3be){
if(key=="width"){
this.style.width=_3be;
}else{
if(key=="height"){
this.style.height=_3be;
}else{
if(key=="x"){
this.style.left=_3be;
}else{
if(key=="y"){
this.style.top=_3be;
}else{
if(key=="transform"){
var reg=/scale\s*\(\s*(\d+\.\d+)\s*(\d+\.\d+)\s*\)/i;
var ar=reg.exec(_3be);
var _3c1=1;
var _3c2=1;
if(ar){
_3c1=ar[1];
_3c2=ar[2];
}
for(var i=0;i<this.childNodes.length;i++){
var _3c4=this.childNodes[i];
var _3c5=parseInt(_3c4.style.width);
var _3c6=parseInt(_3c4.style.height);
var left=parseInt(_3c4.style.left);
var top=parseInt(_3c4.style.top);
_3c4.style.width=_3c5*_3c1+"px";
_3c4.style.height=_3c6*_3c2+"px";
_3c4.style.left=left*_3c1+"px";
_3c4.style.top=top*_3c2+"px";
}
}
}
}
}
}
};
return _3bc;
};
var createVMLCircle=function(){
var _3c9=document.createElement("v:oval");
_3c9.leftPos=0;
_3c9.topPos=0;
_3c9.rVal=0;
_3c9.setAttribute=function(key,_3cb){
if(key=="cx"){
if(this.rVal==0){
this.leftPos=parseInt(_3cb);
}else{
this.leftPos=parseInt(_3cb)-parseInt(this.rVal)+"px";
this.style.left=this.leftPos;
}
}else{
if(key=="cy"){
if(this.rVal==0){
this.topPos=parseInt(_3cb);
}else{
this.topPos=parseInt(_3cb)-parseInt(this.rVal)+"px";
this.style.top=this.topPos;
}
}else{
if(key=="stroke"){
this.strokecolor=_3cb;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_3cb)/1.2+"pt";
}else{
if(key=="fill"){
this.fillcolor=_3cb;
}else{
if(key=="r"){
this.rVal=parseInt(_3cb);
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;
}
}
}
}
}
}
}
};
_3c9.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 _3c9;
};
var createVMLEllipse=function(){
var _3d0=document.createElement("v:oval");
_3d0.leftPos=0;
_3d0.topPos=0;
_3d0.rxVal=0;
_3d0.ryVal=0;
_3d0.applyLinGradient=function(_3d1){
var _3d2=_3d1.stops[0];
var _3d3=_3d1.stops[_3d1.stops.length-1];
this.fillcolor=_3d2.stopColor;
var fill=document.createElement("v:fill");
fill.type="gradient";
fill.color2=_3d3.stopColor;
if(_3d1.y1==0){
var rads=Math.atan((_3d1.x2-_3d1.x1)/_3d1.y2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}else{
if(_3d1.y1>0){
var rads=Math.atan((_3d1.y2-_3d1.y1)/_3d1.x2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}
}
this.appendChild(fill);
};
_3d0.setAttribute=function(key,_3d8){
if(key=="cx"){
if(this.rxVal==0){
this.leftPos=parseInt(_3d8);
}else{
this.leftPos=parseInt(_3d8)-parseInt(this.rxVal)+"px";
this.style.left=this.leftPos;
}
}else{
if(key=="cy"){
if(this.ryVal==0){
this.topPos=parseInt(_3d8);
}else{
this.topPos=parseInt(_3d8)-parseInt(this.ryVal)+"px";
this.style.top=this.topPos;
}
}else{
if(key=="stroke"){
this.strokecolor=_3d8;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_3d8)/1.2+"pt";
}else{
if(key=="fill"){
if(_3d8.substring(0,3)=="url"){
var _3d9=_3d8.substring(5,_3d8.length-1);
this.applyLinGradient(linearGradients[_3d9]);
}else{
this.fillcolor=_3d8;
}
return;
}else{
if(key=="fill"){
this.fillcolor=_3d8;
}else{
if(key=="rx"){
this.rxVal=parseInt(_3d8);
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(_3d8);
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;
}
}
}
}
}
}
}
}
}
};
_3d0.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 _3de=value.substring(5,value.length-1);
this.applyLinGradient(linearGradients[_3de]);
}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 _3d0;
};
var LinearGradient=function(id,_3e0,_3e1,_3e2){
this.init(id,_3e0,_3e1,_3e2);
};
LinearGradient.prototype={init:function(id,_3e4,_3e5,_3e6){
this.id=id;
this.type="LinearGradient";
this.startColor=_3e4;
this.endColor=_3e5;
this.angle=_3e6;
}};
var createVMLRectangle=function(){
var _3e7=document.createElement("v:roundrect");
_3e7.rxy=0;
_3e7.applyGradient=function(_3e8){
if(_3e8.type=="LinearGradient"){
this.fillcolor=_3e8.startColor;
var fill=document.createElement("v:fill");
fill.type="gradient";
fill.color2=_3e8.endColor;
fill.angle=_3e8.angle;
this.appendChild(fill);
}
};
_3e7.applyLinGradient=function(_3ea){
var _3eb=_3ea.stops[0];
var _3ec=_3ea.stops[_3ea.stops.length-1];
this.fillcolor=_3eb.stopColor;
var fill=document.createElement("v:fill");
fill.type="gradient";
fill.color2=_3ec.stopColor;
if(_3ea.y1==0){
var rads=Math.atan((_3ea.x2-_3ea.x1)/_3ea.y2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}else{
if(_3ea.y1>0){
var rads=Math.atan((_3ea.y2-_3ea.y1)/_3ea.x2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}
}
this.appendChild(fill);
};
_3e7.setAttribute=function(key,_3f1){
if(key=="x"){
this.style.left=parseInt(_3f1)+"px";
return;
}else{
if(key=="y"){
this.style.top=parseInt(_3f1)+"px";
return;
}else{
if(key=="stroke"){
this.strokecolor=_3f1;
return;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_3f1)/1.2+"pt";
return;
}else{
if(key=="fill"){
if(_3f1.substring(0,3)=="url"){
var _3f2=_3f1.substring(5,_3f1.length-1);
this.applyLinGradient(linearGradients[_3f2]);
}else{
this.fillcolor=_3f1;
}
return;
}else{
if(key=="width"||key=="height"||key=="rx"||key=="ry"){
if(key=="width"){
this.style.width=parseInt(_3f1)+"px";
}else{
if(key=="height"){
this.style.height=parseInt(_3f1)+"px";
}else{
if(key=="rx"||key=="ry"){
if(parseInt(_3f1)){
this.rxy=parseInt(_3f1);
}
}
}
}
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 _3f5=this.rxy/dim;
this.arcsize=_3f5;
}else{
this.arcsize=0;
}
}
catch(e){
}
return;
}
}
}
}
}
}
};
_3e7.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 _3e7;
};
var createVMLLine=function(){
var _3f9=document.createElement("v:line");
_3f9.setAttribute=function(key,_3fb){
if(key=="x1"){
this.x1=_3fb;
this.y1=this.y1?this.y1:0;
this.from=this.x1+" "+this.y1;
return;
}else{
if(key=="y1"){
this.y1=_3fb;
this.x1=this.x1?this.x1:0;
this.from=this.x1+" "+this.y1;
return;
}else{
if(key=="x2"){
this.x2=_3fb;
this.y2=this.y2?this.y2:0;
this.to=this.x2+" "+this.y2;
return;
}else{
if(key=="y2"){
this.y2=_3fb;
this.x2=this.x2?this.x2:0;
this.to=this.x2+" "+this.y2;
return;
}else{
if(key=="stroke"){
this.strokecolor=_3fb;
return;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_3fb)/1.2+"pt";
return;
}else{
if(key=="fill"){
this.fillcolor=_3fb;
return;
}
}
}
}
}
}
}
};
_3f9.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 _3f9;
};
var createVMLPolyLine=function(){
var _3fd=document.createElement("v:polyline");
_3fd.applyLinGradient=function(_3fe){
var _3ff=_3fe.stops[0];
var _400=_3fe.stops[_3fe.stops.length-1];
this.fillcolor=_3ff.stopColor;
var fill=document.createElement("v:fill");
fill.type="gradient";
fill.color2=_400.stopColor;
if(_3fe.y1==0){
var rads=Math.atan((_3fe.x2-_3fe.x1)/_3fe.y2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}else{
if(_3fe.y1>0){
var rads=Math.atan((_3fe.y2-_3fe.y1)/_3fe.x2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}
}
this.appendChild(fill);
};
_3fd.setAttribute=function(key,_405){
if(key=="points"){
this.points=_405;
}else{
if(key=="stroke"){
this.strokecolor=_405;
return;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_405)/1.2+"pt";
return;
}else{
if(key=="fill"){
if(_405.substring(0,3)=="url"){
var _406=_405.substring(5,_405.length-1);
this.applyLinGradient(linearGradients[_406]);
}else{
this.fillcolor=_405;
}
return;
}
}
}
}
};
return _3fd;
};
var createVMLPath=function(){
var _407=document.createElement("v:shape");
_407.style.width="21600";
_407.style.height="21600";
_407.coordsize="21600, 21600";
_407.style.position="absolute";
_407.applyLinGradient=function(_408){
var _409=_408.stops[0];
var _40a=_408.stops[_408.stops.length-1];
this.fillcolor=_409.stopColor;
var fill=document.createElement("v:fill");
fill.type="gradient";
fill.color2=_40a.stopColor;
if(_408.y1==0){
var rads=Math.atan((_408.x2-_408.x1)/_408.y2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}else{
if(_408.y1>0){
var rads=Math.atan((_408.y2-_408.y1)/_408.x2);
var degs=rads*(180/Math.PI);
fill.angle=(degs+180)%360;
}
}
this.appendChild(fill);
};
_407.setAttribute=function(key,_40f){
if(key=="d"){
var _410=0;
var _411=0;
_40f=_40f.replace(/(\d*)((\.*\d*)(e ?-?\d*))/g,"$1");
var _412=_40f.match(/([MLHVCSQTAZ].*?)(?=[MLHVCSQTAZ]|$)/gi);
var _413="";
for(var i=0;i<_412.length;i++){
var _415=_412[i].substring(0,1);
var _416=_412[i].substring(1,_412[i].length);
switch(_415){
case "M":
var _417=_416.split(",");
_410=parseInt(_417[0]);
_411=parseInt(_417[1]);
break;
case "A":
var _415="ae";
var args=_416.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]);
_416=args[4]+" "+args[5]+" "+args[2]*2+" "+args[3]*2+" 0 360";
break;
case "l":
var _417=_416.split(",");
_417[0]=parseInt(_417[0])+parseInt(_410);
_417[1]=parseInt(_417[1])+parseInt(_411);
_410=parseInt(_417[0]);
_411=parseInt(_417[1]);
_416=_417[0]+","+_417[1]+" ";
break;
case "L":
var _417=_416.split(",");
_410=parseInt(_417[0]);
_411=parseInt(_417[1]);
break;
default:
}
_413+=_415+_416;
}
this.path=_413;
return;
}else{
if(key=="stroke"){
this.strokecolor=_40f;
return;
}else{
if(key=="stroke-width"){
this.strokeweight=parseFloat(_40f)/1.2+"pt";
return;
}else{
if(key=="fill"){
if(_40f.substring(0,3)=="url"){
var _419=_40f.substring(5,_40f.length-1);
this.applyLinGradient(linearGradients[_419]);
}else{
this.fillcolor=_40f;
}
return;
}
}
}
}
};
_407.getAttribute=function(key){
alert("not implemented");
};
return _407;
};
var createVMLLinearGradient=function(){
return new LinGradient();
};
var createVMLStop=function(){
var _41b=new Object();
_41b.setAttribute=function(key,_41d){
if(key=="offset"){
this.offset=_41d;
}else{
if(key=="stop-color"){
this.stopColor=_41d;
}
}
};
return _41b;
};
var createVMLDefs=function(){
var _41e=new Object();
_41e=document.createElement("defs");
_41e.appendChild=function(_41f){
};
return _41e;
};
var LinGradient=function(){
this.init();
};
LinGradient.prototype={init:function(){
this.stops=new Array();
},setAttribute:function(key,_421){
if(key=="id"){
this.id=_421;
linearGradients[this.id]=this;
}else{
if(key=="x1"){
this.x1=_421.substring(0,_421.length-1);
}else{
if(key=="y1"){
this.y1=_421.substring(0,_421.length-1);
}else{
if(key=="x2"){
this.x2=_421.substring(0,_421.length-1);
}else{
if(key=="y2"){
this.y2=_421.substring(0,_421.length-1);
}
}
}
}
}
},appendChild:function(stop){
this.stops.push(stop);
}};
function showHoleMenu(_423){
if((sign==null)||(sign.images==null)){
return;
}
log("showHoleMenu()");
var _424=$$("sign_image_editor").style;
if((_424.visibility=="hidden")&&(sign.images.length==0)){
pick_image();
return;
}
hideTextMenu();
var ofs=getOffset($$("sign_background_area"));
_424.left=ofs.x+ofs.w+1-$$("sign_image_editor").offsetWidth+"px";
_424.top=ofs.y-5+"px";
_424.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 _427=ofs.x-8;
for(var x=0;x<3;x++){
var _429=ofs.y-8;
for(var y=0;y<3;y++){
var zoom=$$("zoom_"+x+"x"+y);
if(zoom){
if(_423){
zoom.style.left=_427+"px";
zoom.style.top=_429+"px";
}
zoom.style.visibility="visible";
}
_429+=ofs.h/2;
}
_427+=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(_42f,_430){
log("si: change_sign_image");
doClose();
var img=$$("img_0");
img.name=_42f;
img.black_and_white=_430;
img.image.image_name=_42f;
img.image.black_and_white=_430;
if(sign.images.length==0){
lastDragObject=img;
var _432=getOffset($$("sign"));
var _433=Math.min(_432.w,_432.h);
img.style.left=(_432.x+(_432.w-_433*0.4)/2).toFixed(0)+"px";
img.style.top=(_432.y+(_432.h-_433*0.4)/2).toFixed(0)+"px";
img.image.resize(_433*0.4,_433*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(_434,_435,_436,_437,_438,_439,_43a,_43b){
log("esi: init");
var _43c=$$(_434);
while(_43c.childNodes.length>=1){
_43c.removeChild(_43c.firstChild);
}
this.border_style=_439;
this.border=new SignForm(_434);
this.image_name=_435+"";
this.black_and_white=_436;
_43c.name=_435;
_43c.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=_43c;
this.text_color=null;
this.resize(_43a,_43b);
this.set_style(_437,_438,this.border_style);
_43c.appendChild(this.image);
},update_thumbnail:function(){
if($$("image_thumbnail")){
var _43d=this.image_name;
if(_43d==""){
_43d="-1";
}
$$("image_thumbnail").src="/image/get/"+_43d+"?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(_43e,_43f,_440){
log("esi: set_style");
if((_43f!=this.background_color)||(_43e!=this.text_color)){
this.background_color=_43f;
this.text_color=_43e;
this.change_image();
sign.update_image(0,_43e);
}
if(this.border_style!=_440){
this.border_style=_440;
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="/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(_444,_445){
log("esi: resize");
var _446=1;
if(this.border){
if(this.border_style&&(this.border_style!="none")){
var _447=this.border_style.split(",");
var h=_445;
_446=0.82;
if(_447[0]=="triangle_top"){
h*=0.866;
_446=0.48;
}
this.border.set_style(_447[0],_447[1],_444,h,null,this.text_color);
}else{
this.border.hide();
}
}
var w=(_444*_446).toFixed(0);
var h=(_445*_446).toFixed(0);
if(w>5){
this.pare.style.width=_444+"px";
this.image.style.paddingLeft=(_444*(1-_446)*0.5).toFixed(0)+"px";
this.image.style.width=w+"px";
}
if(h>5){
this.pare.style.height=_445+"px";
this.image.style.paddingTop=(_445*(1-_446)*0.5).toFixed(0)+"px";
this.image.style.height=h+"px";
}
}});
var fonts=[];
fonts["borisblackbloxx"]="BORISBL0";
fonts["daniel"]="DANIEL0";
fonts["diogenes"]="DIOGENE0";
fonts["existence light"]="EXISTEN0";
fonts["exmouth"]="EXMOUTH0";
fonts["jjstencil solid"]="JJSTENC0";
fonts["amerika sans"]="AMERIKA0";
fonts["arial rounded mt bold"]="ARIALRO0";
fonts["apple garamond"]="APPLEGA0";
fonts["caesar"]="CAESAR0";
fonts["day roman"]="DAYROMA0";
fonts["dymaxionscript"]="DYMAXIO0";
fonts["eurofurence"]="EUROFUR0";
fonts["geosanslight"]="GEOSANS0";
fonts["impossible - 0"]="IMPOSSI0";
fonts["kronika"]="KRONIKA0";
fonts["old london"]="OLDLOND0";
fonts["old script"]="OLDSCRI0";
fonts["pad thai"]="PADTHAI0";
fonts["paper cuts"]="PAPERCU0";
fonts["porcelain"]="PORCELA0";
fonts["rocky aoe"]="ROCKYAO0";
fonts["romanserif"]="ROMANSE0";
fonts["san remo"]="SANREMO0";
fonts["sf slapstick comic"]="SFSLAPS0";
fonts["sf slapstick comic shaded"]="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["will&grace"]="WILLGRA0";
fonts["bankgothic lt bt"]="BANKGOT0";
fonts["commercialscript bt"]="COMMERC0";
fonts["dutch801 rm bt"]="DUTCHRM0";
fonts["fiolex girls"]="FIOLEXG0";
fonts["gill sans ultra bold"]="GILLSAN0";
fonts["gothice"]="GOTHICE0";
fonts["swis721 bdoul bt"]="SWISBDO0";
fonts["vineta bt"]="VINETAB0";
var saved_mouse_up_count;
function createCSSRule(rule,_44b){
var _44c="\n"+rule+"{\n";
for(var _44d in _44b){
_44c+="\t"+_44d+": "+_44b[_44d]+";\n";
}
_44c+="}\n";
var _44e=$$("delayed_fonts");
if($.browser.msie){
_44e.styleSheet.cssText+=_44c;
}else{
_44e.appendText(_44c);
}
};
function download_font(_44f){
var _450=(typeof (_44f)!="undefined")?_44f:$$("font_family").value.toLowerCase();
if(fonts[_450]&&(fonts[_450].length>0)){
var _451={};
_451["font-family"]=_450;
_451["font-style"]="normal";
_451["font-weight"]="normal";
_451["src"]="url(/embedded/"+fonts[_450]+".eot)";
createCSSRule("@font-face",_451);
fonts[_450]="";
}
};
function update_font_allowed_styles(_452){
if(!$$("engraved_sign")){
var _453=["arial","comic sans ms","courier new","georgia","tahoma","times new roman","trebuchet ms"];
var _454=["arial","courier new","georgia","times new roman","trebuchet ms"];
_452=_452.toLowerCase();
if(_453.indexOf(_452)==-1){
$(".cmd_bold").each(function(){
$(this).removeClass("selected");
$(this).addClass("disabled");
});
}else{
$(".cmd_bold").each(function(){
$(this).removeClass("disabled");
});
}
if(_454.indexOf(_452)==-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(_456){
$$("font_family").value=_456.toLowerCase();
update_font_allowed_styles(_456);
if($$("font_name_field")){
$$("font_name_field").innerHTML=_456.substring(0,17);
}
if($$("font_examples")){
$$("font_examples").style.visibility="hidden";
download_font();
}
};
function get_selected_font(_457){
};
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 _45a=0;
while(fi){
fi.src="/images/fonts/"+fi.getAttribute("filename")+".png";
_45a++;
fi=$$("font_image_"+_45a);
}
}
};
function showTextMenu(){
if(!$$("sign_text_position")){
return;
}
if(sign==null){
return;
}
log("showTextMenu()");
var _45b=$$("sign_text_position").style;
var ofs=getOffset($$("sign_background_area"));
_45b.left=ofs.x+ofs.w+1-$$("sign_text_position").offsetWidth+"px";
_45b.top=ofs.y-5+"px";
_45b.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";
};
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(_461){
log("sedit: init");
this.nrOfEditRows=0;
this.removeChildren("editor_text_row");
this.removeChildren("editor_size_row");
this.removeChildren("editor_style_row");
var _462=null;
for(var i=0;i<Math.max(4,_461.row_count);i++){
var _464=_461.row_text(i);
var size=_464.between("fontSize = '","mm");
if(size==""){
size=_464.between("font-size: ","mm");
}
if(!sign.single_text_color()){
_462=_461.row_color(i)||_462||_461.text_color();
}
this.addRow(stripHTML(_464),size,_464.indexOf("<strong>")>0,_464.indexOf("<em>")>0,_464.indexOf("border-bottom")>0,_464.between("text-align: ",";"),_462);
}
setCheckedValue("row_cnt",_461.row_count);
var font=_461.font_family();
if(font){
if(font.indexOf(",")>0){
font=font.split(",")[0];
}
if(!is_font_ok(font)){
font="Arial";
}
if(!setSelectedValue("font_family",font)){
select_font(font);
}
download_font();
font_updated();
}
setSelectedValue("sign_border",_461.sign_border());
setSelectedValue("sign_style",_461.sign_style());
setSelectedValue("sign_colors",_461.colors());
setSelectedValue("sign_text_colors",_461.text_color());
setSelectedValue("sign_background_colors",_461.background_color());
if(_461.images.length>0){
setSelectedValue("image_border",_461.images[0].border);
if($$("image_color")){
$$("image_color").value=_461.images[0].color;
}
}
},getContent:function(_467){
var _468=getCheckedValue("row_cnt")*1;
var _469="";
var i;
if(_468!=this.used_row_count){
this.used_row_count=_468;
for(i=1;i<=_468;i++){
$$("text"+i).style.background="#fff";
}
for(i=_468+1;i<=this.nrOfEditRows;i++){
$$("text"+i).style.background="#e0e0e0";
}
}
for(i=1;i<=_468;i++){
var txt=$$("text"+i).value;
var _46c=$$("size"+i).value||"12";
_46c=_46c.replace(",",".");
if(!(((_46c*1)>0)&&((_46c*1)<1000))){
_46c=12;
}
var _46d=Math.min(_46c,Math.round(sign.max_height()/1.8));
var _46e=(_46d*1.38*_467).toFixed(0)*1;
if((_46e<sign.min_font_size())&&(txt.replaceAll(" ","").replaceAll("&nbsp;","")!="")){
_46e=sign.min_font_size();
}
var _46f=[];
text_align="center";
var _470=false;
var _471=0;
var _472="";
$("#editor_row"+i+" .cmd").each(function(){
var _473=$(this);
if(_473.hasClass("cmd_color")){
_472=";color: "+this.childNodes[0].style.backgroundColor;
}else{
if(_473.hasClass("selected")){
if(_473.hasClass("cmd_justify")){
text_align=this.id.substring(4);
}else{
if(_473.hasClass("cmd_u")){
_471=(_46e/18).toFixed(1)*1;
}else{
if(_473.hasClass("cmd_em")){
_46f.push("em");
_470=true;
}else{
_46f.push(this.id.substring(4));
}
}
}
}
}
});
if(txt==""){
_471=0;
}
var _474="";
if(sign.is_vector_type()||(_46e<5)||((_46e<15)&&(_468>=3))){
_474=";letter-spacing: 0px";
}
var _475="";
if((_470)&&(text_align!="left")&&(text_align!="right")){
_475=";_margin-left: "+_46e+"px";
}
_469+="<div "+"fontSize = '"+_46c+"mm' "+"style='text-align: "+text_align+_475+_474+_472+"; font-size: "+_46e+"mm; font-family: "+$$("font_family").value+";'>";
if(_471>0){
_469+="<p><span style='border-bottom: solid "+sign.text_color()+" "+_471+"mm;'>";
}else{
_469+="<p>";
}
_46f.reverse();
for(var j=0;j<_46f.length;j++){
_469+="<"+_46f[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="";
}
_469+=txt;
_46f.reverse();
for(var j=0;j<_46f.length;j++){
_469+="</"+_46f[j].split(" ")[0]+">";
}
if(_471>0){
_469+="</span>";
}
_469+="</p></div>";
}
return _469;
},PrepareRow:function(_row,_478,_479,_47a,_47b,_47c){
log("sedit: preparerow");
var _47d=this;
if(_47b=="center"){
_47b="";
}
$("#editor_row"+_row+" .cmd").each(function(){
var _47e=$(this);
if($.browser.msie){
$("span",_47e).mouseover(function(){
this.className="hvr";
}).mouseout(function(){
this.className="";
});
}
if(_47e.hasClass("cmd_color")){
this.childNodes[0].style.backgroundColor=_47c;
}
if((_478)&&(this.id=="cmd-strong")){
_47e.addClass("selected");
}
if((_479)&&(this.id=="cmd-em")){
_47e.addClass("selected");
}
if((_47a)&&(this.id=="cmd-u")){
_47e.addClass("selected");
}
if(this.id==("cmd-"+_47b)){
_47e.addClass("selected");
}
_47e.click(function(){
if(_47e.hasClass("cmd_color")){
_47d.showTextColorMenu(_row);
return;
}
if(_47e.hasClass("disabled")){
return;
}
if(_47e.hasClass("cmd_justify")&&!_47e.hasClass("selected")){
var _47f=this.parentNode.id;
$("#"+_47f+" .cmd_justify").each(function(){
$(this).removeClass("selected");
});
}
_47e.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(_486){
this.selected_color_item.style.background=_486;
},setMinRowCount:function(_cnt){
log("sedit: setMinRowCount");
if(getCheckedValue("row_cnt")<_cnt){
setCheckedValue("row_cnt",_cnt);
}
},addRow:function(_txt,_489,_48a,_48b,_48c,_48d,_48e){
log("sedit: addRow");
if(typeof (_txt)=="undefined"){
_txt="";
}
if(typeof (_489)=="undefined"){
_489="";
}
if(typeof (_48e)=="undefined"){
_48e=sign.row_color(sign.row_count-1);
}
if(_txt=="&nbsp;"){
_txt="";
}
var _48f=document.createElement("div");
_48f.className="editor_row";
this.nrOfEditRows+=1;
var cnt=this.nrOfEditRows;
_48f.innerHTML=cnt+"&nbsp;"+"<INPUT TYPE=RADIO "+"NAME=\"row_cnt\""+"VALUE=\""+cnt+"\""+((cnt==1)?"checked ":"")+">&nbsp;"+"<input id=\"text"+cnt+"\" style=\"width: 180px; background: #e0e0e0;\" type=\"text\" onkeydown=\"simpleedit.setMinRowCount("+cnt+");\" value=\""+_txt.replaceAll("\"","&quot;")+"\"/>"+"&nbsp;"+"<a class=\"mycmd\" id=\"charmap_link_"+cnt+"\" title=\"Specialtecken\" onclick=\"simpleedit.showCharMap("+cnt+");\"><span>&hearts;</span></a>";
$$("editor_text_row").appendChild(_48f);
var _48f=document.createElement("div");
_48f.className="editor_row";
_48f.innerHTML="<input id=\"size"+cnt+"\" style=\"width: 35px;\" type=\"text\" value=\""+_489+"\" /><span class=\"mm\">mm</span>";
$$("editor_size_row").appendChild(_48f);
var _48f=document.createElement("div");
_48f.id="editor_row"+cnt;
_48f.className="editor_row";
var _491="<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")){
_491+="<a class=\"cmd cmd_u\" id=\"cmd-u\" title=\"Understruken\"><span style=\"background-position:-36px 0px\"></span></a>";
}
_491+="<div class=\"sep\"></div><a class=\"cmd cmd_justify\" id=\"cmd-left\" title=\"Vänster 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öger justerat\"><span style=\"background-position:-108px 0px\"></span></a>";
if(_48e){
_491+="<div class=\"sep\"></div><a class=\"cmd cmd_color\" id=\"text_color_"+cnt+"\" title=\"Färg\"><div></div></a>";
}
_491+="<br>";
_48f.innerHTML=_491;
$$("editor_style_row").appendChild(_48f);
$$("text_rows").style.height=cnt*25+45+"px";
this.PrepareRow(cnt,_48a,_48b,_48c,_48d,_48e);
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 _492=20,_493=20,_494=20,i;
var html="<table border=\"0\" cellspacing=\"1\" cellpadding=\"0\" width=\""+(_493*_492)+"\"><tr height=\""+_494+"\">";
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)%_492==0){
html+="</tr><tr height=\""+_494+"\">";
}
}
}
if(cols%_492>0){
var padd=_492-(cols%_492);
for(var i=0;i<padd-1;i++){
html+="<td width=\""+_493+"\" height=\""+_494+"\" class=\"charmap\">&nbsp;</td>";
}
}
html+="</tr></table>";
return html;
};
function insertChar(chr){
simpleedit.hideCharMap();
$$("text"+$$("charmap").row).value+="&#"+chr+";";
};
function previewChar(_49a,_49b,_49c){
var elmA=document.getElementById("codeA");
var elmV=document.getElementById("codeV");
var elmN=document.getElementById("codeN");
if(_49a=="#160;"){
elmV.innerHTML="__";
}else{
elmV.innerHTML="&"+_49a;
}
elmA.innerHTML="&amp;"+_49b;
elmN.innerHTML=_49c;
};
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 _4a1=sign.price;
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();
if($$("override_price")){
_4a1=sign.price;
}
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=sign.width+"x"+sign.height+"mm.";
if(sign.get_sign_type()=="product"){
desc="";
}
$$("sign"+i+"_description").innerHTML=desc+"<br>"+local_price(_4a1);
}
}
$$("img_0").id="";
sign_data_index++;
setTimeout("show_single_sign();",50);
}
};
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());
sign.hang_type(getCheckedValue("sign_format_hang_types"));
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=(ofs.x+10)+"px";
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 _4a4=$(this);
_4a4.mouseover(function(){
_4a4.addClass("sign_object_hover");
}).mouseout(function(){
this.className="sign_object";
});
});
$(".button").each(function(){
var _4a5=$(this);
if($.browser.msie){
_4a5.mouseover(function(){
_4a5.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);
}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.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.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 _4a6=$$("image_border")?$$("image_border").value:"none";
var _4a7=$$("image_color")?$$("image_color").value:sign.text_color();
$$("img_0").image.set_style(_4a7,sign.background_color(),_4a6);
}
return simpleedit.getContent(font_size_changer);
}else{
return sign.text();
}
}
};
var sign_images=new Array();
function keyHandler(e){
var _4a9=0;
try{
_4a9=e.keyCode?e.keyCode:e.charCode;
}
catch(e){
if(window.event){
_4a9=window.event.keyCode;
}
}
if(_4a9==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 "";
}
return String.fromCharCode(key);
};
function numbersonly(e){
var key=get_key(e);
return (key=="")||(("0123456789").indexOf(key)>-1);
};
function getTextSize(text,_4af){
var test=$$("hidden_get_text_width");
test.style.height="10px";
test.style.height="auto";
test.innerHTML=text;
test.style.paddingLeft=_4af+"mm";
test.style.paddingRight=_4af+"mm";
var _4b1=new Object();
_4b1.x=test.clientWidth+1;
_4b1.y=test.clientHeight+1;
return _4b1;
};
function getCheckedDescription(_4b2){
var _4b3=document.forms["sign_form"].elements[_4b2];
if(!_4b3){
return null;
}
var _4b4=_4b3.length;
if(_4b4==undefined){
if(_4b3.checked){
return _4b3.getAttribute("description");
}else{
return null;
}
}
for(var i=0;i<_4b4;i++){
if(_4b3[i].checked){
return _4b3[i].getAttribute("description");
}
}
return "";
};
function getCheckedValue(_4b6){
var _4b7=document.forms["sign_form"].elements[_4b6];
if(!_4b7){
return null;
}
var _4b8=_4b7.length;
if(_4b8==undefined){
if(_4b7.checked){
return _4b7.value;
}else{
return null;
}
}
for(var i=0;i<_4b8;i++){
if(_4b7[i].checked){
return _4b7[i].value;
}
}
return "";
};
function setCheckedValue(_4ba,_4bb){
log("setCheckedValue");
if(_4bb==null){
return;
}
var _4bc=document.forms["sign_form"].elements[_4ba];
if(!_4bc){
return false;
}
var _4bd=_4bc.length;
if(_4bd==undefined){
_4bc.checked=(_4bc.value==_4bb.toString());
return false;
}
var _4be=false;
for(var i=0;i<_4bd;i++){
_4bc[i].checked=false;
if((_4bb)&&(_4bc[i].value==_4bb.toString())){
_4bc[i].checked=true;
_4be=true;
}
}
return true;
};
function setSelectedValue(_4c0,_4c1){
var _4c2=$$(_4c0);
if(!_4c2){
return false;
}
if(!_4c1){
return false;
}
if(!_4c2.options){
return false;
}
for(var i=0;i<_4c2.options.length;i++){
var _4c4=_4c2.options[i].value+"";
_4c1=_4c1.toLowerCase();
if(_4c4.toLowerCase().match(_4c1)){
_4c2.value=_4c2.options[i].value;
return true;
}
}
return false;
};
function set_sign_image(_4c5){
var _4c6=$$(_4c5+"_background_image");
if(_4c6){
var pos=getOffset($$("sign_hanging_container"));
_4c6.style.top=pos.y+pos.h+"px";
}
};
function position_sign_images(_4c8){
$$(_4c8+"_text").style.left=sign.text_position().x*font_divider+"mm";
$$(_4c8+"_text").style.top=sign.text_position().y*font_divider+"mm";
if(!sign.images){
return;
}
log("position_sign_images");
var _4c9=$$(_4c8);
log("getOfs");
var _4ca=getOffset(_4c9);
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 _4ce,_4cf,x,y;
for(var i=0;i<1;i++){
var _4d2=$$("img_"+i);
var _4d3;
if(i<sign.images.length){
_4d2.image_index=i;
_4d2.name=sign.images[i].name;
_4d2.black_and_white=sign.images[i].bw;
_4ce=millimetersToPixels(sign.images[i].w);
_4cf=millimetersToPixels(sign.images[i].h);
x=millimetersToPixels(sign.images[i].x)+_4ca.x;
y=millimetersToPixels(sign.images[i].y)+_4ca.y;
_4d3=sign.images[i].border;
color=sign.images[i].color||sign.text_color();
}else{
if(ofs==null){
return;
}
_4d2.image_index=-1;
_4d2.name="";
_4d2.black_and_white=true;
var _4ce=50;
var _4cf=50;
var x=ofs.x+5;
var y=ofs.y+5;
_4d3="none";
color="#000";
}
var _4d4=new ExtSignImage("img_"+i,_4d2.name,_4d2.black_and_white,color,sign.background_color(),_4d3,_4ce,_4cf);
if(!view_mode){
makeDraggable(_4d2);
}
_4d2.image=_4d4;
_4d2.style.zIndex=1000;
_4d2.style.left=x+"px";
_4d2.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 _4d5=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 _4d6=getOffset($$("sign"));
var main=lastDragObject;
if(!main){
return;
}
if((main.image_index>=0)){
var _4d8=sign.images.length;
sign.delete_image(main.image_index);
if(_4d8==sign.images.length){
alert("error");
}
}
var _4d9=getPosition(main);
main.image_index=sign.add_image(main.name,main.black_and_white,main.image.border_style,pxToMM(_4d9.x-_4d6.x,3),pxToMM(_4d9.y-_4d6.y,3),pxToMM(_4d9.w,3),pxToMM(_4d9.h,3),$$("image_color")?$$("image_color").value:sign.text_color());
if($$("image_pos_x")){
$$("image_pos_x").value=pxToMM(_4d9.x-_4d6.x);
$$("image_pos_y").value=pxToMM(_4d9.y-_4d6.y);
$$("image_pos_x_neg").value=pxToMM((_4d6.x+_4d6.w)-(_4d9.x+_4d9.w));
$$("image_pos_y_neg").value=pxToMM((_4d6.y+_4d6.h)-(_4d9.y+_4d9.h));
$$("image_width").value=pxToMM(_4d9.w);
$$("image_height").value=pxToMM(_4d9.h);
}
};
var relative_mm_value=115;
function millimetersToPixels(_4da){
return Math.round(_4da*($$("hidden_sign").clientWidth*font_divider)/relative_mm_value);
};
function pxToMM(_px,_dec){
if(!_dec){
_dec=0;
}
var _4dd=(_px*relative_mm_value/($$("hidden_sign").clientWidth*font_divider)).toFixed(_dec)*1;
return _4dd;
};
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 signHeight()+"mm";
};
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 signWidth()+"mm";
};
function signHeightChanged(){
$$("sign_height").style.marginTop="0px";
$$("sign_height").style.height=$$("sign").clientHeight+"px";
var _4de=Math.round($$("sign").clientHeight/2).toFixed(0)-12;
if(_4de<0){
_4de=0;
}
$$("sign_height_text").style.paddingTop=_4de+"px";
$$("sign_width").innerHTML=signWidthStr();
calculatePrice();
};
function change_text_size(_4df){
var _4e0=_4df.indexOf("mm;");
if(_4e0>=0){
var _4e1=_4df.indexOf(" ",_4e0-5)+1;
var _4e2=(_4df.substring(_4e1,_4e0));
_4e2=(_4e2*1)*font_divider;
_4df=_4df.substring(0,_4e1)+_4e2+"mm ;"+_4df.substring(_4e0+3);
return change_text_size(_4df);
}
return _4df;
};
function round_mm_width(_4e3){
if(sign.get_sign_type()!="aluminium_sign"){
return _4e3;
}
if(_4e3==0){
return _4e3;
}
if(_4e3<=200){
return 200;
}
if(_4e3<=300){
return 300;
}
if(_4e3<=400){
return 400;
}
if(_4e3<=500){
return 500;
}
if(_4e3<=600){
return 600;
}
if(_4e3<=700){
return 700;
}
if(_4e3<=800){
return 800;
}
if(_4e3<=1000){
return 1000;
}
if(_4e3<=1250){
return 1250;
}
return 1500;
};
function round_width(_4e4){
return millimetersToPixels(round_mm_width(pxToMM(_4e4)));
};
function round_mm_height(_4e5){
if(sign.get_sign_type()!="aluminium_sign"){
return _4e5;
}
if(_4e5==0){
return _4e5;
}
if(_4e5<=100){
return 100;
}
if(_4e5<=150){
return 150;
}
if(_4e5<=200){
return 200;
}
if(_4e5<=300){
return 300;
}
if(_4e5<=400){
return 400;
}
if(_4e5<=500){
return 500;
}
return 600;
};
function round_height(_4e6){
return millimetersToPixels(round_mm_height(pxToMM(_4e6)));
};
function getMaxFontSize(_4e7){
var _4e8=0;
var _4e9=3;
while((_4e8=_4e7.indexOf("font-size: ",_4e8))!=-1){
var _4ea=_4e7.substring(_4e8+11,_4e7.indexOf("mm",_4e8+11));
if(_4ea>_4e9){
_4e9=_4ea;
}
_4e8++;
}
return _4e9;
};
function only_numbers(_4eb){
var text=stripHTML(_4eb).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(_4ef){
var text=stripHTML(_4ef).replaceAll("&nbsp;","");
return text==text.toUpperCase();
};
function padded_sign_text(_4f1,_4f2){
result="";
for(var i=0;i<_4f1.length;i++){
result+=change_text_size(_4f1[i].replace("<p></p>","<p>&nbsp; </p>"));
}
var _4f4=getTextSize(result,0);
var _4f5=pxToMM(_4f4.x);
var _4f6=pxToMM(_4f4.y);
var _4f7=signForm.padding(_4f5,_4f6,sign.sign_border(),(sign.get_sign_type()=="name_sign")||(sign.get_sign_type()=="stamp")?0:1);
var pt=(_4f7.top*font_divider)+"mm ";
var pr=(_4f7.right*font_divider)+"mm ";
var pb=(_4f7.bottom*font_divider)+"mm ";
var pl=(_4f7.left*font_divider)+"mm";
var _4fc="";
if(!view_mode){
var _4fc="onmousedown='initDragDrop(this,event);' id='sign_text_hover' class='sign_object' onmouseover='$(this).addClass(\"sign_object_hover\");' onmouseout='this.className = \"sign_object\";'";
}else{
var _4fc="class='sign_object'";
}
result="<div style='padding: "+pt+pr+pb+pl+";'><div "+_4fc+">"+result+"</div></div>";
return result;
};
function create_sign_text(_4fd){
var _4fe=3;
for(var i=0;i<_4fd.length;i++){
_4fe=Math.max(_4fe,getMaxFontSize(_4fd[i]));
}
if(_4fe<=4){
_4fe=0;
}
var _500=sign.get_sign_type()=="text";
if(_500){
_4fe=0;
}
var m_w="mm "+((_4fe*0.1+6)*font_divider/2).toFixed(1)+"mm ";
var _502=0;
var _503=0;
if((_4fd.length>2)||!only_uppercase(_4fd.join())){
_502=((_4fe*0.04)*font_divider/2).toFixed(1);
_503=((_4fe*0.08)*font_divider/2).toFixed(1);
if(!only_uppercase(_4fd.join())){
_502=((_4fe*0.08+2)*font_divider/2).toFixed(1);
_503=((_4fe*0.27+2)*font_divider/2).toFixed(1);
}
}
var _504="<div style=\"margin:"+_502+m_w+_503+m_w+";\">";
var txt=_4fd;
txt=padded_sign_text(txt,0);
return _504+txt+"</div>";
};
function remove_empty_lines(_506){
if(_506.ends_with("<p>&nbsp; </p></div></div></div></div>")){
_506=_506.replace("<p>&nbsp; </p></div></div></div></div>","</div></div></div></div>");
}
return _506;
};
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 _508=millimetersToPixels(signHeight());
if($$("sign_background_area").clientHeight<_508+100){
$$("sign_background_area").style.height=_508+100+"px";
if(!view_mode){
posScale();
}
}
};
function text_changed(_509,_50a){
log("text_changed");
if(typeof (_509)=="undefined"){
_509=sign.text();
}
if(typeof (_50a)=="undefined"){
_50a="sign";
}
_509=_509.replaceAll("<strong></strong>","");
_509=_509.replaceAll("<em></em>","");
_509=_509.replaceAll("<strong></strong>","");
var _50b=_509.split("</p></div>");
for(var i=0;i<_50b.length;i++){
if((!_50b[i])||(_50b[i].length==0)||(_50b[i]=="&nbsp;")){
_50b[i]="";
}else{
_50b[i]+="</p></div>";
}
}
if(text_changed_disabled){
return true;
}
$$(_50a).style.color=sign.text_color();
font_divider=1;
var _50d=0;
if(sign.hang_type()=="screw"){
_50d=1;
}
if(sign.hang_type()=="wall_distance"){
_50d=20;
}
if(sign.hang_type()=="one_screw"){
_50d=1;
}
var _50e=$$(_50a+"_background_area").clientWidth;
if(!view_mode){
_50e-=110;
}
var _50f=385;
var _510=2;
if(sign.fixed_width>0){
while(millimetersToPixels(sign.fixed_width)>_50e){
font_divider=(1/_510);
_510++;
}
}
if(sign.fixed_height>0){
while(millimetersToPixels(sign.fixed_height)>_50f){
font_divider=(1/_510);
_510++;
}
}
do{
var _511=create_sign_text(_50b);
var _512=getTextSize(_511,_50d*font_divider);
var _513=round_width(_512.x);
var _514=round_width(_512.y);
font_divider=(1/_510);
_510++;
}while(((_513>_50e)||(_514>_50f))&&(font_divider>0.05));
font_divider=(1/(_510-2));
_512.x=round_width(_512.x);
_512.y=round_height(_512.y);
saved_text_width=_512.x;
saved_text_height=_512.y;
var _515=$$(_50a).style.width;
if(signWidth()!=signTextWidth()){
$$(_50a).style.width=millimetersToPixels(signWidth())+"px";
}else{
$$(_50a).style.width=_512.x+"px";
}
if(signHeight()!=signTextHeight()){
$$(_50a).style.height=millimetersToPixels(signHeight())+"px";
}else{
$$(_50a).style.height=_512.y+"px";
}
sign.height=signHeight();
sign.width=signWidth();
signForm.set_style(sign.sign_style(),sign.sign_border(),$$(_50a).clientWidth,$$(_50a).clientHeight,sign.background_color(),sign.text_color(),sign.hang_type(),font_divider,sign.width,sign.height);
$$(_50a+"_text").style.width=$$(_50a).style.width;
_511=remove_empty_lines(_511);
_511="<div style='margin: 0px; padding: 0px; display: table; #position: relative; overflow: hidden;"+"width: "+$$(_50a).style.width+"; height: "+$$(_50a).style.height+";'>"+"<div style='#position: absolute; #top: 50%;left: 0px; display: table-cell; vertical-align: middle; width: "+$$(_50a).style.width+";'>"+"<div style='#position: relative; #top: -50%; text-align: center; padding-bottom: 0px; white-space: nowrap;'>"+_511+"</div></div></div>";
if(font_divider!=old_font_divider){
position_sign_images(_50a);
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=_511;
signHeightChanged();
}else{
$$(_50a+"_text").innerHTML=_511;
}
log("text_changed_done");
return true;
};
function calculatePrice(){
log("calculatePrice");
if(sign.fixed_price==0){
var _516=2;
var _517=signHeight();
if(sign.hang_type()=="hanging"){
_517+=10;
_516+=2;
}
var _518=sign.get_sign_type()=="plastic_sign";
var _519=sign.get_sign_type()=="aluminium_sign";
var _51a=sign.get_sign_type()=="name_sign";
var _51b=sign.get_sign_type()=="sticker";
var _51c=sign.get_sign_type()=="text";
var _51d=sign.get_sign_type()=="product";
var _51e=sign.get_sign_type()=="acryl_sign";
var _51f=sign.get_sign_type()=="stamp";
var _520=4;
var _521=0.4;
var _522=0.0043;
var _523=sign.max_width();
var _524=sign.max_height();
var _525=0.001;
var _526=2;
_516+=(sign.number_of_colors()-1)*90;
if(_518){
_523=400;
_524=300;
if(sign.is_wood_sign()){
_522*=1.3;
}
}
if(_51e){
_516+=200;
_521=0.75;
_523=600;
_524=550;
_522=0.005;
}
if(_519){
_516+=150;
_526=60;
_525=0.0002;
_520=60;
_521=0.58;
_522=0.0022;
_523=1500;
_524=600;
}
if(_519||_51e){
if(((signWidth()+signHeight())>=900)||(signWidth()>=600)){
_516+=200;
}
}
if(_51b){
_521=0.5;
_522=0.004;
_525=0.0005;
}
if(_51c){
_516+=80;
_521=0.6;
_522=0.0016;
_523=1650;
_524=500;
_520=60;
}
if(_51d){
_516=123;
_522=0;
_516+=(sign.number_of_colors()-1)*30;
}
if(_51f){
_516=80;
_522=0.08;
_520=25;
}
var area=(Math.min(_517,_524)+5)*(Math.min(signWidth(),_523)+5);
var _528=1-(_521-_521*(1-(area/(_523*_524*1.1))));
area=(_517+5)*(signWidth()+5);
if((sign.sign_border()=="thin")||(sign.sign_border()=="thick")){
_522+=_525;
_516+=_526;
}
if(_519){
if((sign.background_color()=="#fff")){
_522-=0.0003;
}
}else{
if((sign.background_color()=="#daa520")||(sign.background_color()=="#bbb")){
_522+=0.0007;
}
}
if(_51a){
_516+=27.66;
}
if(sign.hang_type()=="magnet"){
_516+=10;
}
if(sign.hang_type()=="military"){
_516+=12;
}
if(sign.hang_type()=="screw"){
_516+=1.2;
}
if(sign.hang_type()=="bockad"){
_522+=0.0003;
_516+=30;
}
if(sign.hang_type()=="wall_distance"){
if(signHeight()<70){
_516+=90;
}else{
_516+=180;
}
}
if(sign.hang_type()=="pole"){
_522+=0.0003;
_516+=70;
}
if(sign.hang_type()=="poles"){
_522+=0.0003;
_516+=70;
}
if(sign.hang_type()=="tape"){
_522+=0.0005;
_516+=2;
}
if(sign.images){
for(var i=0;i<sign.images.length;i++){
_516+=_520+sign.images[i].h*0.08;
}
}
var _52a=stripHTML(sign.text().replaceAll("&nbsp;","")).length;
if((!_51a)&&(!_51d)){
if(_51e){
_516+=_52a*2.7;
}else{
_516+=_52a*0.27;
}
}
_516+=area*_522*_528*1.05;
_516*=1.1;
}else{
var _516=sign.fixed_price;
}
if(_516>100){
sign.price=_516.toFixed(0)*1;
}else{
sign.price=_516.toFixed(2)*1;
}
if(!view_mode){
$$("sign_price_field").innerHTML=local_price(sign.price);
$$("sign_price_vat_field").innerHTML=local_price_with_tax(sign.price);
}
};
function update_font_size_description(){
if(font_size_changer<0.99){
var _52b=1;
$(".mm").each(function(){
var _52c=$$("size"+_52b).value;
if(_52c==""){
_52c=12;
}
var _52d=Math.round((_52c*1)*font_size_changer);
this.innerHTML=_52d+"mm";
this.style.backgroundColor="#ffff50";
_52b++;
});
}else{
$(".mm").each(function(){
this.innerHTML="mm";
this.style.backgroundColor="#ffffff";
});
}
};
var disable_increase=0;
var disable_decrease=0;
function size_ok_done(_52e){
if(_52e){
log("sizeOK done");
}else{
log("sizeOK done, false");
}
return _52e;
};
function sizeOK(_52f,_530){
log("sizeOK");
text_changed(_52f,_530);
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 _531=font_size_changer;
font_size_changer/=0.9;
if(font_size_changer>0.999){
font_size_changer=1;
}
disable_decrease++;
var _532=signTextWidth();
var _533=sizeOK(getContent(),_530);
disable_decrease--;
if(_533){
update_font_size_description();
return size_ok_done(true);
}
font_size_changer=_531;
text_changed(_52f);
}
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 _534=sizeOK(getContent(),_530);
disable_increase--;
update_font_size_description();
return size_ok_done(_534);
}
}
return size_ok_done(false);
};
function set_fixed_values(_535,_536,_537){
sign.fixed_width=_536;
sign.fixed_height=_537;
sign.fixed_price=_535;
};
function sign_height_changed(){
log("sign_height_changed");
var _538=getCheckedValue("sign_format_height_types")||"fixed";
if(_538=="fixed"){
$$("sign_format_height").disabled=false;
sign.fixed_height=(getCheckedValue("sign_format_height_radio")||$$("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+" "+signTextHeight()+" mm");
}
}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=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=round_mm_width(Math.min(sign.fixed_width,sign.max_width()))+"x"+round_mm_width(Math.min(sign.fixed_height,sign.max_height()));
}else{
$$("sign_format_width").value=round_mm_width(Math.min(sign.fixed_width,sign.max_width()));
}
}
};
function sign_width_changed(){
log("sign_width_changed");
var _539=getCheckedValue("sign_format_width_types")||"fixed";
if(_539=="fixed"){
$$("sign_format_width").disabled=false;
var _53a=(getCheckedValue("sign_format_width_radio")||$$("sign_format_width").value);
if((_53a+"").indexOf("x")==-1){
sign.fixed_width=_53a*1;
}else{
var _53b=_53a.split("x");
sign.fixed_width=_53b[0]*1;
sign.fixed_height=_53b[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 _53c="";
if($$("sign_format_hang_types_select")){
_53c=$$("sign_format_hang_types_select").value;
}else{
_53c=getCheckedValue("sign_format_hang_types");
}
sign.hang_type(_53c);
if(_53c=="military"){
$$("sign_format_width").value="80";
$$("sign_format_height").value="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(!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(_53c!="hanging"){
$$("sign_hanging_container").style.visibility="hidden";
}
sign_width_changed();
};
function prepareHiddenSign(){
var _53d=20;
var _53e=_53d*0.5/2;
var _53f=_53d/2;
var _540="";
_540+="<div style=\"margin: 0 "+_53f+"mm 0 "+_53f+"mm; padding: "+_53e+"mm 0 "+_53e+"mm 0; font-size: "+_53d+"mm\">";
_540+="Grym Text<br>";
_540+="</div>";
$$("hidden_sign").innerHTML=_540;
};
function alert_user(_541){
if(_541==""){
$$("user_alerts").style.display="none";
}else{
$$("user_alerts").style.display="block";
$$("user_alerts").innerHTML=_541;
}
};
function numericInput(_542,_543){
if((_542)&&(!numbersonly(_542))){
return false;
}
setTimeout(_543,50);
return true;
};
function stripHTML(_txt){
log("stripHTML");
var _545=_txt.replace(/&(lt|gt);/g,function(_546,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();
}
if($$("user_alerts").style.display=="block"){
alert($$("sign_error_present").innerHTML+"\n\n"+$$("user_alerts").innerHTML);
return false;
}
var _549=(sign.get_sign_type()=="text")||(sign.get_sign_type()=="stamp");
if((!sign.hang_type()||(sign.hang_type()==""))&&(!_549)){
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 _54b="";
if(!_549){
if(sign.get_sign_type()=="product"){
_54b=" : "+$$("sign_format_hang_types_select").value;
}else{
_54b=" : "+getCheckedDescription("sign_format_hang_types");
}
}
var _54c="";
if(sign.get_sign_type()=="aluminium_sign"){
_54c=" : Vinyl";
_54c+=" : "+sign.width+"x"+sign.height+"mm";
}
addDescription("("+sign.sign_type_name()+_54c+_54b+")");
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 _54f=this;
var _550=_54f.indexOf(_s1);
if(_550==-1){
return "";
}
_550+=_s1.length;
var _551=_54f.substring(_550,_54f.indexOf(_s2,_550));
return _551;
};
String.prototype.trim=function(str){
str=this!=window?this:str;
return str.replace(/^\s+/g,"").replace(/\s+$/g,"");
};
String.prototype.ends_with=function(_553){
var _554=this;
var d=_554.length-_553.length;
return d>=0&&_554.lastIndexOf(_553)===d;
};
String.prototype.replaceAll=function(_556,_557){
var _558=this;
var _559=_558.indexOf(_556);
while(_559!=-1){
_558=_558.replace(_556,_557);
_559=_558.indexOf(_556);
}
return (_558);
};
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(_55a,ev){
ev=ev||window.event;
var _55c=getPosition(_55a);
var _55d=mouseCoords2(ev);
return {x:_55d.x-_55c.x,y:_55d.y-_55c.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 _562=pos.x-left+pos.w;
break;
case "1":
var _562=pos.w;
break;
case "2":
var _562=left-pos.x;
break;
}
switch(dragObject.getAttribute("y")){
case "0":
var _563=pos.y-top+pos.h;
break;
case "1":
var _563=pos.h;
break;
case "2":
var _563=top-pos.y;
break;
}
if(dragObject.getAttribute("x")=="0"){
lastDragObject.style.left=(pos.x-(_562-pos.w))+"px";
}
if(dragObject.getAttribute("y")=="0"){
lastDragObject.style.top=(pos.y-(_563-pos.h))+"px";
}
lastDragObject.image.resize(_562,_563);
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 _568=e.clientWidth;
var _569=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:_568,h:_569};
};
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(_56b,ev){
log("item.onmousedown");
dragObject=_56b;
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 _571=mouseCoords2(ev||window.event);
log("mouseDown = "+_571.x+":"+_571.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")){
$$("font_examples").style.visibility="hidden";
}
if($$("sign_models")){
$$("sign_models").style.visibility="hidden";
}
if($$("color_menu")){
$$("color_menu").style.display="none";
}
log("mouseUp done");
};

