source: extensions/gally/gally-cuise/js/crossbrowser.js @ 6926

Last change on this file since 6926 was 6926, checked in by cljosse, 14 years ago

[Gally's theme 'cuise'] save

File size: 96.6 KB
Line 
1; (function (jQuery) {
2 
3 
4 var Prefix='Vml';
5 var Obj_init= "";
6
7var style_match =[];
8style_match=('transform,text-shadow,box-shadow,border-radius,star,opacity'.split(","));
9
10var style_prefix =[];
11//  Firefox (Gecko) -moz-
12//  Opera
13//  Safari (WebKit) -webkit-
14style_prefix =('webkit,khtml,o,moz,icab ,'.split(","));
15
16var browsers = {linux:'-khtml-', webkit:'-webkit-',safari:'-webkit-',opera:'',mozilla:"-moz-",iph:'-icab-',msie:'',opacity:"" }; 
17var Init_fig;
18var tmp = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0;
19if(tmp) var isIE = document.namespaces ? 1 : 0;   
20//================================================================================
21var marge_body ;
22var IDS="";
23var Attr;
24var Object;
25var   Attr_val;
26var Unique_id=0;
27var uniqueId=0;
28var Nom_classe ;
29//================================================================================
30var Window={ width:jQuery(window).width(),height:jQuery(window).height()
31};
32var Fill_Color  ;
33var Fill_Src   ;
34var Fill_Type ;
35var box_shadow  ;
36var text_shadow ;
37    //==================================
38var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
39        ralpha = /alpha\([^)]*\)/,
40        ropacity = /opacity=([^)]*)/,
41        rfloat = /float/i,
42        rdashAlpha = /-([a-z])/ig,
43        rupper = /([A-Z])/g,
44        rnumpx = /^-?\d+(?:px)?$/i,
45        rnum = /^-?\d/,
46    fcamelCase = function (all, letter) {
47            return letter.toUpperCase();
48        };
49
50 var classes ;
51// Add namespaces and stylesheet at startup.
52function AddNameSpace(doc, prefix, urn) {
53        if(document.namespaces[prefix]==null) {
54                var e=["shape",
55                "shapetype",
56                "group",
57                "background",
58                "path",
59                "formulas",
60                "handles",
61                "fill",
62                "stroke",
63                "shadow",
64                "textbox",
65                "textpath",
66                "imagedata",
67                "line",
68                "polyline",
69                "curve",
70                "roundrect",
71                 "oval",
72                "rect",
73                "arc",
74                "image","textShadow","boxShadow","opacity"],Css = document.createStyleSheet(); 
75
76                for(var i=0; i<e.length; i++) {
77            Css.addRule(prefix +"\\:"+e[i],"behavior: url(#default#VML);");
78        } 
79       
80        document.namespaces.add(prefix, urn, '#default#VML');
81
82
83
84        } 
85 
86}
87
88     function addNamespace(doc, prefix, urn) {
89         if (!doc.namespaces[prefix]) {
90             doc.namespaces.add(prefix, urn, '#default#VML');
91         }
92     }
93
94     function addNamespacesAndStylesheet(doc,classid) {
95         AddNameSpace(doc, Prefix + "_" + classid , 'urn:schemas-microsoft-com:vml');
96       //  AddNameSpace(doc, "v"   , 'urn:schemas-microsoft-com:vml');
97     
98     }
99
100 
101   
102
103
104    var mode = document.documentMode || 0;
105    var noBottomFold = jQuery.browser.msie && ((jQuery.browser.version < 8 && !mode) || mode < 8);
106    var init = false;
107    var angle = 0;
108
109var strokeWeight ={
110                    Bottom:0,
111                    Left:0,
112                    Top:0,
113                    Right:0
114                   }
115    ;
116var strokeColor ={
117                    Bottom:'black',
118                    Left:'black',
119                    Top:'black',
120                    Right:'black'
121                   };
122var strokeStyle ={
123                    Bottom:'solid',
124                    Left:'solid',
125                    Top:'solid',
126                    Right:'solid'
127                   };
128//===================================================
129          var stroked = false;
130     var Curwidth = 0;
131     var Curheight = 0;
132 
133     var rect_init;
134     var css_init;
135     var fill_init;
136     //==============================================================
137
138     // precompute "00" to "FF"
139    var decToHex = [];
140    var  alpha = 1;
141    var  init_x = 0;
142    var  init_y = 0;
143    var  init_x0 =0;
144    var  init_y0 = 0;
145    //====================================
146    var Dimension = {};
147    var origine = {x:0,y:0,Left:0,Top:0,Width:100,Height:100,w:100,h:100};
148   
149//============================================================
150var Options={
151
152};
153
154
155//=========================================
156function Set_textbox(prefix,Options){
157//<textbox string="VML text" layout-flow="vertical"/>
158Str=[];
159if (Options.textbox) {
160            Str.push('<'+prefix+':textbox ');
161            for (i in Options.textbox)
162            { 
163            Str.push( i + '=' +  Options.textbox[i] ); 
164           
165            }
166             Str.push('style="font:normal normal normal 36pt Arial"');
167            Str.push('/>');
168   }
169  return  Str.join(' ');
170
171}
172function Set_Shadow( prefix,Options ){
173Str=[];
174if (Options.shadow) {
175            Str.push('<'+prefix+':shadow ');
176            for (i in Options.shadow)
177            { Str.push( i + '=' +  Options.shadow[i] );  }
178            Str.push('/>');
179   }
180  return  Str.join(' ');
181
182}
183//============================================================
184function Set_Value_to_str(Valeurs,op,sep)
185{
186    n=""
187    for (i in Valeurs) 
188    {
189     Val=Valeurs[i ];
190     if (/;/.test( Val))
191     {
192      sous_val=Valeurs[i ].split(";") ;
193      for (j in sous_val) 
194      {
195            val1=sous_val[j].split(":");
196            n += val1[0] + op + val1[1]+ sep;
197            }
198
199        }else{
200            n += i + op + Val + sep;
201        }
202
203    }
204    return n;
205}
206//=============================================================
207
208function Set_Shape(prefix,Options){
209ShapeStr=[];
210if (Options.shape) {
211
212     ShapeStr.push('<'+ prefix +':'+ Options.element + ' ');
213     for (i in Options.shape)
214       { 
215       Val=Options.shape[i];
216       if (Val)
217       ShapeStr.push( i+'="' +  Val + '"' ); 
218       else
219       n=i ;
220
221       }
222     ShapeStr.push('>');
223 }
224 ret=ShapeStr.join(' ');
225 return ret;
226}
227//-----------------------------------------------------
228function Set_end_Shape(prefix,Options){
229if (Options.shape) {
230 
231return '</'+prefix+':'+ Options.element  +' > ';
232}else return '</'+prefix+' > ';
233
234
235}
236//============================================================
237function Set_Stroke(prefix,Options){
238StrokeStr=[];
239if (Options.stroke) {
240            StrokeStr.push('<'+prefix+':stroke ');
241            for (i in Options.stroke)
242            { StrokeStr.push( i + '=' +  Options.stroke[i] );  }
243            StrokeStr.push('/>');
244   }
245  return  StrokeStr.join(' ');
246
247}
248//=======================================================================================
249
250function Set_Group(prefix,Options)
251{
252
253GroupStr=[];
254if (Options.group) {
255            GroupStr.push('<'+prefix+':group');
256                for (i in Options.group)
257            {
258             GroupStr.push( i + '=' +  Options.group[i] ); 
259            }
260            GroupStr.push('>');
261   }
262           return  GroupStr.join(' ');
263
264}
265
266//-----------------------------------------------------
267function Set_end_Group(prefix,Options){
268if (Options.group) {
269return '</'+prefix+':'+ 'group'  +' > ';
270}else return '</'+prefix+' > ';
271
272
273}
274
275
276//=======================================================================================
277function Set_Fill(prefix,Options){
278
279FillStr=[];
280if (Options.fill) {
281            FillStr.push('<'+prefix+':fill');
282            for (i in Options.fill)
283            {
284   
285            FillStr.push( i+'=' +  Options.fill[i] ); 
286            }
287
288     
289            FillStr.push('/>');
290         
291           
292  }
293return FillStr.join(' ');
294}
295
296
297
298//============================================================
299function Get_angle(obj)
300{
301if (typeof obj =='string') obj=jQuery("#"+ obj).get(0) ; 
302 
303if (!obj) return ;
304  var  m1 ="transform,-o-transform,-moz-transform,-webkit-transform"; 
305    m1 =  m1.split(",") ;
306     s =  obj.currentStyle;
307    if (!s)  s = obj.style;
308  if (!s) return ;
309
310    for (i in m1)
311 if (s[m1[i]]!=undefined) 
312 { 
313 
314  var rotation=s[m1[i]] ;
315 break; }
316
317 var Angle=0;
318
319         if (typeof rotation != "undefined") {
320             
321             var angle1 = rotation.split("rotate(");
322             angle1 = angle1[1].split("deg)");
323             Angle = angle1[0];
324         }
325         return Angle ;
326}
327//===========================================================
328function removeExtraSpace(str)
329{
330 if (!str) return "" ;
331    str = str.replace(/[\s]{2,}/g," "); // Enlève les espaces doubles, triples, etc.
332    str = str.replace(/^[\s]/, ""); // Enlève les espaces au début
333    str = str.replace(/[\s]$/,""); // Enlève les espaces à la fin
334    return str;   
335}
336
337
338function trim(str, chars) {
339        return ltrim(rtrim(str, chars), chars);
340}
341 
342function ltrim(str, chars) {
343        chars = chars || "\\s";
344        return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
345}
346 
347function rtrim(str, chars) {
348        chars = chars || "\\s";
349        return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
350}
351//====================================================================
352function Get_Tableau(Val_src) {
353Val_src=removeExtraSpace(Val_src)
354
355  var tableau = Val_src.split(" "); 
356      tableau = Val_src + " " + Val_src + " " +tableau[0] +" " + tableau[0]  ; 
357       
358      tableau = tableau.split(" "); 
359
360return {Top:tableau[0] ,Right: tableau[1],Bottom: tableau[2],Left:tableau[3] };
361}
362//============================================================
363function Get_radius(obj)
364{
365/*
366   1 La valeur spécifiée est appliquée aux quatre coins.
367   2 La première valeur est appliquée aux coins supérieur gauche et inférieur droit, et la seconde, aux coins supérieur droit et inférieur gauche 
368   3 La première valeur est appliquée au coin supérieur gauche, la deuxième aux coins supérieur droit et inférieur gauche, et la troisième, au coin inférieur droit 
369   4 Les angles supérieur gauche, supérieur droit, inférieur droit et inférieur gauche sont respectivement définis 
370*/
371
372  var  m1 ="border-radius,-o-border-radius,-moz-border-radius,-webkit-border-radius,star"; 
373    m1 +=",borderRadius,OBorderRadius,MozBorderRadius,WebkitBorderRadius,star"; 
374
375    $e=jQuery(obj);
376    m1 =  m1.split(",") ;
377    s=obj.currentStyle;
378   // s = obj.style.cssText.split(";");
379
380    Attribut = false;
381 type="";
382 for (i in m1)
383 if (s[m1[i]]!=undefined) 
384 { 
385  Attribut = true;
386  radius=s[m1[i]] ;
387  type=m1[i];
388 break; }
389  if (typeof radius == "undefined") { radius = "0" }
390      var reg=new RegExp("\ \ ","g");
391      nr = radius;
392     while(radius.match("\/")){
393         radius=radius.replace("\/"," ");
394     }
395
396          while(radius.match("\ \ ")){
397             radius=radius.replace(reg," ");
398          }
399 
400 if (type.match("star") ) {
401  var radius = (radius + " " + 1)
402  var tableau = radius.split(" "); 
403           return { r:tableau[0] ,
404                   type:type
405                  }
406       }
407           
408 
409      v1=Get_Tableau(radius);
410
411
412     
413      top_left = parseInt(s['border-top-left-radius']||v1.Top) ;
414      top_right =  parseInt(s['border-top-right-radius']||v1.Right);
415      bottom_right =  parseInt(s['border-bottom-right-radius']||v1.Bottom);
416      bottom_left =  parseInt(s['border-bottom-left-radius']||v1.Left); 
417
418
419       
420      type=(nr.match("\/")) ? "oval" : (parseInt(v1.Left)==0) ? "rect" : "shape" ;
421             
422        return { r:v1.Left,
423             top_left:top_left ,
424             top_right:top_right ,
425             bottom_right:bottom_right ,
426             bottom_left:bottom_left,
427             type:type};
428
429}
430//=======================================================================================
431/*
432Single (default)
433ThinThin
434ThinThick
435ThickThin
436ThickBetweenThin
437*/
438function Get_style(borderStyle_src){
439 
440   v1=Get_Tableau(borderStyle_src) ;
441
442for ( i1 in v1)
443{
444borderStyle=v1[i1] ;
445
446
447         switch(borderStyle)
448         {
449         case 'solid':
450         strokeStyle[i1]="Single";
451            break;
452        case 'double':
453        strokeStyle[i1]="thinThin";
454            break;
455        case 'none':
456         strokeStyle[i1]="Single";
457        stroked =false
458            break;
459         default:
460          strokeStyle[i1]="Single";
461
462             break;
463         }
464   
465}   
466      return  strokeStyle;
467}
468
469//=============================================================
470function Get_Color(Color_src){
471 
472 v1= Get_Tableau(Color_src) ;
473  for ( i1 in v1)
474{
475   strokeColor[i1] = ( translateColor(v1[i1])=="transparent") ? "none" : translateColor(v1[i1]) ;
476
477  }
478
479return  strokeColor;
480}
481
482//=============================================================
483function Get_stokeWeight(Weight_src){
484 
485   v1=Get_Tableau(Weight_src) ;
486   stroked=false ;
487for ( i1 in v1)
488{
489Weight=v1[i1] ;
490p1=Weight.match("%")
491
492         switch(Weight)
493         {
494         case  p1:
495          strokeWeight[i1]=10;
496          break;
497        case 'thin':
498          strokeWeight[i1]=0.5;
499          break;
500                case 'medium':
501          strokeWeight[i1]=0.75;
502                  break;
503                case 'thick':
504          strokeWeight[i1]=2;
505                  break;
506                case 'inherit':
507                if(Obj.parentElement)
508          strokeWeight[i1]=Get_stokeWeight(Obj.parentElement.currentStyle.borderWidth);
509                  else
510                  strokeWeight[i1]=0 ;
511                 
512                  break; 
513                 
514         default:
515                 
516         strokeWeight[i1]= Weight ;
517             break;
518         }
519 strokeWeight[i1]=parseInt(strokeWeight[i1]) ;
520         if (isNaN( strokeWeight[i1] )) {
521             strokeWeight[i1] = 0;
522         } 
523
524         stroked =  ( strokeWeight[i1] > 0) ?  ( strokeWeight[i1] > 0) :stroked;
525}
526                 return   strokeWeight   ;
527                 
528        }
529//=======================================================================================
530//Filter: Alpha(Opacity=100, FinishOpacity=0, Style=2, StartX=20, StartY=40, FinishX=0, FinishY=0);
531//filter:progid:DXImageTransform.Microsoft.Alpha(opacity=20)"
532function Set_opacity(obj) {
533 filtres=obj.style.filter;
534 
535 if (parseInt( alpha  )  + "" !== "NaN" ) {
536   if (  (alpha > 1) ) alpha /= 100 ;
537
538 }
539
540sProperties = "opacity = "+  alpha*100 + ", FinishOpacity=100, Style=2, StartX=20, StartY=40, FinishX=0, FinishY=0"; 
541sProperties = "opacity = "+  alpha*100 ;
542
543if (!filtres.match("progid:DXImageTransform.Microsoft.Alpha")) 
544   filtres += "  progid:DXImageTransform.Microsoft.Alpha("+sProperties+") ";
545 
546   obj.style.filter = filtres ;
547
548}
549 
550     //======================================================================================
551function Rotate(_Obj,angle,offset_Vertical,offset_Horizontal)
552         { 
553         if (!_Obj) return ;
554         name=_Obj.id ;
555         var deg2radians = Math.PI * 2 / 360;
556         var rad = angle * deg2radians;
557         var costheta = Math.cos(rad);
558         var sintheta = Math.sin(rad);
559
560         Horizontal=0 ;
561        Vertical=0 ;
562     
563 filtres=_Obj.style.filter;
564//Dx ="+ Horizontal +",Dy ="+ Vertical +",
565
566sProperties = "M11 ="+ costheta+",M12 ="+ -sintheta+",M21 ="+ sintheta +",M22 ="+ costheta +", sizingMethod =" + "'auto expand'" + ""; //'clip to original' ; //
567if (!filtres.match("progid:DXImageTransform.Microsoft.Matrix")) 
568   filtres += "  progid:DXImageTransform.Microsoft.Matrix("+sProperties+") ";
569
570 _Obj.style.filter=filtres ;
571 return _Obj;
572
573}
574//============================================================================
575function Transform(obj) {
576        if (!obj) return ;
577        obj=jQuery(obj).get(0);
578        if (!obj) return ;
579                s = obj.style;
580        angle= angle || Get_angle(obj);
581        if (!init) {
582             init=true ;
583                        //=================================================================
584            ntop = 0;
585            nleft = 0; 
586        Parent=obj.id.replace("_Ombre","");
587        Obj_parent=jQuery("#"+Parent).get(0);
588         
589            if (typeof (Obj_parent)!="undefined") {
590
591                   Left=Dimension[Obj_init.id].Left;
592                   Top=Dimension[Obj_init.id].Top;
593                   if (/Texte/.test(obj.id) ){
594 
595
596                   Top =   (( obj.clientHeight - obj.offsetHeight) / 2);
597                        Left=   ((obj.clientWidth - obj.offsetWidth) / 2); 
598
599                   }
600
601                        }
602
603
604            jQuery(obj).width( Dimension[Obj_init.id].w  );   
605            jQuery(obj).height( Dimension[Obj_init.id].h ); 
606
607
608            init_x=  Left  +   (strokeWeight.Left/2)    ;
609            init_y=  Top +   (strokeWeight.Top/2)   ;
610
611            }
612        //===========================================
613 //obj.style.position="absolute";
614        jQuery(obj).rotate(angle);
615   
616
617        ntop = (( obj.clientHeight - obj.offsetHeight) / 2);
618        nleft = ((obj.clientWidth - obj.offsetWidth) / 2); 
619     if (/Texte/.test(obj.id) ){
620 
621
622                  ntop =0;
623                      nleft = 0;
624
625                   }
626
627        jQuery(obj).css("left",  init_x +  nleft+  "px");
628        jQuery(obj).css("top", init_y +  ntop+  "px");
629
630
631 }
632
633//===========================================
634function onPropertyChange(e) {
635   var el = e.srcElement;
636       ID=  el.id;
637       Prop=e.propertyName.split(".") ;
638       Property=Prop[1];
639
640       Valeur=el.currentStyle[Property] ;
641      return ;
642
643       if ( !ID.match("Vml") )
644       {
645     
646       el=jQuery("#Vml_" + ID ).get(0);
647       if (!el) 
648            return ;
649      if(!Property) return ;
650      if (Property=="filter")
651      h1= jQuery("#Vml_" + ID ).css(Property);
652      else
653      el=jQuery("#Vml_" + ID ).get(0);
654     
655       
656       }else{
657            return ;
658       }
659
660                switch (e.propertyName) {
661
662            case "style.position":
663             init=false ;
664                 transform(el);
665                 break;
666
667            case "style.filter":
668             init=false ;
669        alpha=Valeur;
670            if (! el.style.filter.match(Valeur))
671                           Set_opacity(el);
672
673
674                 break;
675            case "style.opacity" :
676             init=false ;
677           new_alpha=jQuery("#"+el.id).css("opacity") ;
678            if ( el.style.opacity != jQuery("#"+el.id).css("opacity"))
679                           Set_opacity(el);
680
681
682                 break;
683
684            case  "style.borderWidth" :
685                  init=false ;
686               
687                     el.strokeWeight = Valeur;
688
689                  if (el.style.borderLeftWidth != strokeWeight.Left +"px"  ) 
690                  {
691                       strokeWeight = Get_stokeWeight(el.style.borderWidth) ;
692
693                   transform(el);
694                   jQuery("#"+el.id).css("borderWidth",el.style.borderWidth );
695
696                   }
697                 break;         
698                 
699            case "style.borderStyle":
700            transform(el);
701         
702                 break;         
703
704            case "style.borderColor":
705 
706                     el.strokeColor =  translateColor(Valeur);
707                     transform(el);
708                 break;             
709                                                         
710             case "style.transform":
711                init=false ;
712                 transform(el);
713
714                 break;
715             case "style.textShadow":
716
717                 var text_shadow = el.style.textShadow;
718                 var sizeShadow = text_shadow.split(" ");
719                 aff_filter(el, sizeShadow);
720                 break;
721             case "style.color":
722                 new_color = translateColor(el.style.color);
723                 el.style.color = new_color;
724                  transform(el);
725                 break;
726             case 'style.width':
727
728                 //el.style.width = el.attributes.width.nodeValue + 'px';
729                 // In IE8 this does not trigger onresize.
730              //   el.firstChild.style.width = el.clientWidth + 'px';
731              if (el.vml)     el.vml.style.width = el.clientWidth  + 'px';
732                 break;
733             case 'style.height':
734
735                 //el.style.height = el.attributes.height.nodeValue + 'px';
736              //   el.firstChild.style.height = el.clientHeight + 'px';
737                if (el.vml)   el.vml.style.height = el.clientHeight   + 'px';
738                 break;
739         }
740}
741
742//===============================================================================
743function Set_Path(r,_Width,_Height)
744{
745   Path="";
746   radius=parseInt(r.r) ;
747   CoordOrigin="0 0";
748    switch (r.type)
749    {
750        case "oval":
751             typeelement="oval";
752             var CoordSize="";
753
754
755
756        break ;
757
758        case "shape":
759             typeelement="shape";
760             CoordSize= _Width+","+_Height;
761
762            TL =parseInt(r.top_left )    ; 
763            TR =parseInt (r.top_right  )  ; 
764            BR = parseInt (r.bottom_right )   ; 
765            BL = parseInt (r.bottom_left )   ; 
766
767            var shape_Origine ={ x: _Width - TR, y:0} ;
768
769            var TR_  ={ x: _Width , y : 0 + TR} ;
770            var L1 ={ x: _Width , y:_Height-BR} ;
771            var BR_ ={ x: _Width - BR, y:_Height} ;
772            var L2 ={ x:BL, y:_Height} ;
773            var BL_ ={ x:0 , y:_Height-BL} ;
774            var L3 ={ x:0 , y:TL} ;
775            var TL_ ={ x:TL, y:0} ;
776            var L4 ={ x: _Width - TR, y:0} ;
777
778             Path=" m "+ shape_Origine.x +","+  shape_Origine.y + 
779            " qx " + TR_.x + "," + TR_.y +
780            " l  " + L1.x + "," + L1.y +
781            " qy " + BR_.x + "," + BR_.y +
782            " l " + L2.x + "," + L2.y +
783            " qx "+ BL_.x + "," + BL_.y +
784            " l " + L3.x + "," + L3.y +
785            " qy "+ TL_.x + "," + TL_.y +
786            " l " + L4.x + "," + L4.y +
787            " x e";   
788 
789        break;
790        case "star":
791            typeelement="shape";
792             CoordSize=_Width/radius + "," + _Height/radius ; //zoom
793             shape_Origine ={ x:8 , y:65} ;
794            CoordOrigin="10 20";
795            Path="m "+shape_Origine.x+","+shape_Origine.y+" l 72,"+shape_Origine.y+",92,11,112,"+shape_Origine.y+",174,"+shape_Origine.y+",122,100,142,155,92,121,42,155,60,100 x e";
796         break;
797
798        default: 
799            typeelement="rect";
800            CoordSize= _Width+","+_Height;
801            shape_Origine ={ x:0 , y:0} ;
802
803             L1 ={ x:0      , y:_Height } ;
804             L2 ={ x:_Width , y:_Height} ;
805             L3 ={ x:_Width  , y:0 } ;
806             Path=" m "+ shape_Origine.x +","+  shape_Origine.y + 
807            " l  " + L1.x + "," + L1.y + ","+
808             L2.x + "," + L2.y + ","+
809             L3.x + "," + L3.y +           
810            " x e";   
811           break;
812
813    }
814    return { Path:Path,typeelement:typeelement,CoordSize:CoordSize, CoordOrigin: CoordOrigin}
815}
816 
817
818//=================================================================
819function oncontentready(Obj) {
820       
821var reg=new RegExp('wrap', "gi");
822  if (reg.test(Obj.className)) { return ;} 
823  reg=new RegExp(Prefix, "gi");
824  if (reg.test(Obj.className)) { return ;} 
825  //======== test si classe existe =============================
826  classID= Obj.uniqueID;
827  Nom_classe =  Prefix + "_" + classID ;
828  reg=new RegExp(Nom_classe, "gi");
829  if (!reg.test(Obj.className)) { 
830        if(document.namespaces.length==0) 
831        addNamespacesAndStylesheet(document,classID);
832
833         if ( !document.namespaces[Nom_classe]) {
834          //document.namespaces.add("v"+classID, "urn:schemas-microsoft-com:vml");
835            addNamespacesAndStylesheet(document,classID);
836          }
837          Obj.className = Obj.className.concat(" " + Nom_classe);
838         // Find which element provides position:relative for the target element (default to BODY)
839
840
841  }else{
842  return ;
843  }
844
845//=============================================================================
846Obj_init= Obj;
847//jQuery(Obj).wrap("<div class='wrap' id='wrap_" + Obj.id + "' style='position:"+Obj.currentStyle.position+";margin:auto'></div>");
848Init_fig= Obj.id ;
849//cssText=Obj.style.cssText.split(";");
850
851//Obj.style.position="static";
852s = Obj.currentStyle;
853if (!s) return ;
854    strokeWeight = Get_stokeWeight(s.borderWidth);
855    strokeStyle  = Get_style(s.borderStyle);
856    strokeColor  = Get_Color(s.borderColor);
857
858
859    angle        = Get_angle(Obj);
860    r            = Get_radius(Obj);
861    radius=parseInt(r.r);
862    top_left = parseInt(r.top_left) ;
863    top_right = parseInt(r.top_right);
864    bottom_right = parseInt(r.bottom_right);
865    bottom_left =  parseInt(r.bottom_left);   
866    alpha = s.opacity || 1;
867
868  Dimension[Obj.id] =  jQuery(Obj).findPos(); //
869
870init = false;
871
872/*=============================================================================*/ 
873Fill_Src = "";
874
875    Fill_Color = translateColor(s.backgroundColor);
876    Fill_Color = (Fill_Color=="transparent") ? "none" : Fill_Color ;
877    if (Obj.tagName=="IMG")
878    {
879           Fill_Src = Obj.src.replace(/^url\("(.+)"\)$/, '$1');;
880           Fill_Type="frame" ;
881    }else{
882            Fill_Src =s.backgroundImage.replace(/^url\("(.+)"\)$/, '$1');
883
884            if (Fill_Src)  Fill_Type= (s['type']) || "tile";
885            else   Fill_Type = (s['type']) || "solid";
886    }
887//==============================================
888    box_shadow = s['boxShadow'] || false ;
889    text_shadow =s['textShadow'] || false ;
890    S = Obj.innerHTML;
891    texte=S ;
892 
893 reg=new RegExp('<img', "gi");
894
895if (Fill_Src=="none") 
896 if (reg.test(texte)) {
897 
898        var children = Obj.children ; 
899        var images = new Array(); 
900    var i = 0;
901        var child;
902    var j = 0;
903
904        for (i=0;i<children.length;i++) {
905                child = children[i];
906        reg=new RegExp('img', "gi");
907                if ( reg.test(child.tagName))
908                        {
909                Fill_W  =  child.width  ;
910                Fill_H  =  child.height;
911                id_img=Obj.id+"_img";
912 
913                Fill_Src=child.src;
914 
915                Obj.style.backgroundImage='url(' +Fill_Src+')';
916                Obj.style.backgroundRepeat= 'repeat';
917                Obj.style.backgroundPosition= child.currentStyle.left;
918
919                Obj.removeChild(child);
920
921
922                jQuery(Obj).width(Fill_W );
923                jQuery(Obj).height(Fill_H );
924                s = Obj.currentStyle;
925                break;
926         } 
927
928    } 
929}
930       if (Obj.tagName=="IMG")
931       {
932
933       
934       }else{
935         Fill_Src =s.backgroundImage.replace(/^url\("(.+)"\)$/, '$1');
936            if (Fill_Src)  Fill_Type= (s['type']) || "tile";
937                    else   Fill_Type = (s['type']) || "solid";
938       }
939        S = Obj.innerHTML;
940        texte=S ;
941          var argShadow = jQuery( Obj).getVariables(box_shadow);
942            argShadow.gradientType= -1;
943            argShadow.boxShadow= (argShadow.offset_h !=0) || (argShadow.offset_v !=0) ;
944            argShadow.texteShadow=false;
945            argShadow.texteRotation=false;
946            argShadow.boxRotation= (argShadow.deg !=angle) ;
947            argShadow.deg=angle;
948          //  argShadow.offset_h +=200;
949
950   
951          if (/import/.test(Obj.outerHTML)) return ;
952
953
954       vmls = jQuery(Obj).aff_path(Obj,s,r) ;
955      // Obj.innerHTML ="";
956 
957            if (Obj.tagName=="IMG")
958       {
959       var image=Obj ;
960 object = image.parentNode; 
961
962      var vml = document.createElement(['<div style="overflow:hidden;display:' + 'block' +
963 ';width:' + Fill_W + 'px;height:' + Fill_H + 'px;padding:0;">'].join(''));
964
965        //vml.innerHTML = start + soft + head + fill + shadow + foot + right + bottom + top + left + lt + end;
966        vml.innerHTML = vmls.Shape ;
967     //   if (vmls.Shape)    Obj.innerHTML +=vmls.Shape;
968
969
970                //vml.className = newClasses;
971        vml.id="Clone";
972                vml.style.cssText = image.style.cssText;
973                vml.style.height = image.height+'px';
974                vml.style.width = image.width+'px';
975                vml.height = image.height;
976                vml.width = image.width;
977                vml.src = image.src; 
978        vml.alt = image.alt;
979     
980
981             daynight="n";
982
983          var html = vmls.Shape ;
984          html +=  '<div  class="' + daynight + '"';
985        var img_src = "http://l.yimg.com/a/i/us/nws/weather/gr/" + 10 + daynight + ".png";
986
987        html += '>';
988        html += '<img src=' + img_src + ' />';
989        html += '<span class="weatherTemp' + daynight + '" >Temp: ' + 30 + ' ' + "c" + '</span>';
990
991        html += '</div>';
992       ;
993        $(object).append(html);
994
995//  object.append(vml);
996
997  //   object.removeChild(image);
998
999
1000 return ;
1001 } 
1002      if (!vmls) return ;
1003     //  Obj.innerHTML="";
1004     
1005    if (vmls.Ombre)  Obj.innerHTML   +=  vmls.Ombre  ;
1006
1007    if (vmls.Shape)  {    Obj.innerHTML  +=vmls.Shape ; }
1008
1009   //  if (vmls.Texte)   Obj.innerHTML +=  vmls.Texte ;
1010   
1011       t1=jQuery("#"+Obj.id+"_Ombre").get(0);
1012
1013   //  jQuery( Obj).affFiltres( argShadow);
1014  return ;
1015
1016       
1017  Obj.innerHTML +=vmls.Shape;
1018   
1019 //NewObj=   Create_Obj(Obj);
1020            return; 
1021             
1022 if ( NewObj) 
1023 jQuery(  NewObj).affFiltres( argShadow);
1024              return; 
1025         
1026 
1027              jQuery(Obj).aff_path(Obj,s,r) ;
1028       
1029return ;     
1030
1031
1032/*
1033
1034
1035
1036//==============================================
1037Obj_Src = jQuery(Obj).get(0);
1038Obj_Src.innerHTML = vmls.Shape ;
1039Obj_Src= jQuery('#'+ Init_fig).get(0);
1040Init[Init_fig] = jQuery(Obj_Src).position();
1041*/
1042
1043
1044  $(Obj_Src).clone().insertBefore(".smallBox").attr("id",Obj.id+"_ombre"); 
1045 var Ombre= jQuery("#"+Obj.id+"_ombre");
1046 Ombre.css("left",Dimension[Obj.id].Left+200);
1047 Ombre.css("top",Dimension[Obj.id].Top);
1048 Ombre.get(0).innerHTML = vmls.ombre ; 
1049
1050//==========================================================
1051if (text_shadow || box_shadow) {
1052 
1053
1054   return ;
1055  // var Ombre= jQuery(Obj).clone(false).insertBefore(Obj).addClass("Ombre").attr("id",Obj.id+"_ombre").get(0);
1056jQuery(Obj_Src).insertBefore(Obj_Src).addClass("Ombre").attr("id",Obj.id+"_ombre").get(0);
1057    Ombre=jQuery('#'+ Init_fig+"_ombre").get(0);
1058   
1059 
1060   ;
1061      Ombre.innerHTML  = vmls.ombre;
1062
1063  Init[Ombre.id] = jQuery(Ombre).position();
1064
1065
1066 if (text_shadow && Obj ) { 
1067             nameId="" +  Obj.id  + "_Texte_Ombre"; 
1068            obj_src=jQuery("#" +  nameId).get(0);
1069            if (obj_src)
1070                  aff_filter(obj_src, text_shadow, "text-shadow"); 
1071   
1072   }
1073 
1074 
1075  if (box_shadow && Obj) {   
1076      Ombre=jQuery("#" +  Obj.id  + "_ombre").get(0);
1077      if ( Ombre)
1078      {
1079         
1080
1081
1082            argShadow = jQuery(Obj).getVariables(box_shadow);
1083            argShadow.alpha= alpha || 0.9;
1084            argShadow.gradientType= 1;
1085            argShadow.startColorStr= '#0000ff';
1086            argShadow.endColorStr= '#ffe4e1';
1087            argShadow.deg = 0  ;
1088
1089       jQuery(Obj).affFiltres( argShadow); //  aff_filter(obj_src,box_shadow, "box-shadow"); 
1090         }
1091 
1092  }
1093
1094} 
1095init=false ;
1096
1097texte_ombre=jQuery("#"+Init_fig+"_Texte" ).get(0);
1098 
1099
1100if (mode==8)
1101{ 
1102 // transform(texte_ombre);
1103 }else{
1104 angle_1=angle;
1105 angle=0;
1106// transform(texte_ombre);
1107  angle=angle_1;
1108 }
1109init=false ;
1110 Vml=jQuery("#Vml_"+Init_fig ).get(0);
1111// transform(Vml);
1112
1113//================================================================================
1114/*
1115 Obj=jQuery("#"+Init_fig).get(0);
1116 Set_opacity(Obj);
1117  Ombre=jQuery("#"+Init_fig+"_Ombre" ).get(0);
1118  texte_ombre=jQuery("#"+Init_fig+"_Texte" ).get(0);
1119  if (mode==8)
1120  {
1121 
1122   transform(  texte_ombre);
1123   }
1124  transform(Ombre);
1125 transform(Vml);
1126
1127 
1128   transform(Obj_init);
1129   
1130
1131   jQuery(Obj_init).css("borderWidth",2);
1132   
1133     */
1134//==========================================================================
1135         isIE6 = /msie|MSIE 6/.test(navigator.userAgent);
1136         // IE6 doesn't support transparent borders, use padding to offset original element
1137         if (isIE6 && (strokeWeight.Top > 0)) {
1138             Obj.style.borderStyle = 'none';
1139             Obj.style.paddingTop = parseInt(Obj.currentStyle.paddingTop || 0) + strokeWeight.Top;
1140             Obj.style.paddingBottom = parseInt(Obj.currentStyle.paddingBottom || 0) + strokeWeight.Bottom;
1141         }
1142//======================================================================================
1143 if (typeof (window.rounded_elements) == 'undefined') {
1144      window.rounded_elements = new Array();
1145      if (typeof (window.onresize) == 'function') { window.previous_onresize = window.onresize; }
1146        window.onresize = window_resize;
1147
1148 }
1149 
1150        if (typeof Vml!="undefined" ) {
1151           window.rounded_elements.push(Vml);
1152           Vml.attachEvent('onpropertychange', onPropertyChange);
1153        }
1154        if (Obj) {
1155                window.rounded_elements.push(Obj);
1156                Obj.attachEvent('onpropertychange', onPropertyChange);
1157                }
1158}
1159//==================================================================
1160function onResize(obj) {
1161//transform(obj);
1162     return ;
1163}
1164//==================================================================
1165function Resize(obj) {
1166       
1167//transform(obj);
1168//jQuery(obj).width("100%");
1169                Window.width = jQuery(window).width();
1170                Window.height =  jQuery(window).height();
1171
1172          winit=jQuery(obj).width(); //  valeur interieur (auto,"",%)
1173          hinit=jQuery(obj).height(); //  valeur interieur
1174          if (winit==0) jQuery(obj).width(Window.width);
1175          if (hinit==0) jQuery(obj).width(Window.height);
1176     return ;
1177}
1178//==================================================================================
1179function window_resize() {
1180   if (typeof (window.rounded_elements) == 'undefined') { return (false); }
1181   // return ;
1182   //  rotate(0, true)
1183   Curwidth = 0;
1184   for (var i in window.rounded_elements) {
1185             Resize(window.rounded_elements[i]);
1186      }
1187   if (typeof (window.previous_onresize) == 'function') { window.previous_onresize(); }
1188    return ;
1189}
1190         
1191//=======================================================================================
1192function aff_filter(Obj, size_Shadow,type_element) {
1193     if (!Obj) return ;
1194   
1195        argShadow=jQuery(Obj).getVariables(size_Shadow);
1196        Blur =   argShadow.flou ;
1197        ShadowColor =argShadow.couleur;
1198        Horizontal = argShadow.offset_h  ;
1199        Vertical =  argShadow.offset_v  ;
1200
1201       if ( Vertical==0) Vertical=1;
1202        direction =  180 - Math.atan(Horizontal  / Vertical ) * 180 / Math.PI ;
1203        Strength = parseInt(Blur);
1204         
1205        Obj_src=jQuery(Obj).get(0);
1206
1207 init=false ;
1208     
1209
1210if (type_element=="text-shadow")  {
1211
1212if (mode==8){ 
1213Obj_src.style.position="absolute";
1214transform(Obj_src);   
1215
1216
1217}
1218
1219Obj_src.style.color=  ShadowColor  ;
1220}else {
1221  transform(Obj_src);   
1222}
1223    name= Obj.tagName+ " " + Obj.id;
1224    filtres=Obj_src.style.filter;
1225
1226//======================================================================================
1227  sProperties =   "color="+ ShadowColor +", Direction="+direction+",Strength="+Strength/2 +" "  ;
1228 if (!filtres.match("progid:DXImageTransform.Microsoft.Glow")) 
1229  filtres +=" progid:DXImageTransform.Microsoft.Glow("+sProperties+")" ; /**/
1230 //======================================================================================
1231
1232  sProperties ="pixelradius="+Strength/2+" ,MakeShadow:"+'false'+",ShadowOpacity:"+'0.5' +"";
1233 if (!filtres.match("progid:DXImageTransform.Microsoft.Blur")) 
1234      filtres += "  progid:DXImageTransform.Microsoft.Blur("+sProperties+") ";
1235
1236 
1237 
1238//============================================================
1239 Obj_src.style.filter=filtres ;
1240
1241 return Obj_src;
1242}
1243//====================================================================================
1244function Extract_Value(String,Start_Match,End_Match){
1245       
1246   var reg=new RegExp(Start_Match  , "gi");
1247 var  string = String.toLowerCase() ;
1248
1249    if( reg.test(string)){
1250        string=string.split(Start_Match);
1251        string=string[1].split(End_Match)[0];
1252        return Start_Match + string + End_Match ;
1253    }
1254     return String;
1255}
1256//====================================================================================
1257function Sup_Bloc(String,Start_Match,End_Mach)
1258{
1259var n1=String;
1260 var string=n1.toLowerCase();
1261 var startmatch=Start_Match.toLowerCase();
1262 var endmatch=End_Mach.toLowerCase();
1263
1264 while (p1 = string.indexOf(startmatch,0) >= 0 )
1265                 {
1266                   p1=string.indexOf(startmatch,0);
1267                   p2=string.indexOf(endmatch,p1);
1268                   p3=string.substring(p1,p2+endmatch.length);
1269                   string=string.replace(p3,"");
1270
1271                   p3=n1.substring(p1,p2+endmatch.length);
1272                   n1=n1.replace(p3,"");
1273
1274                }
1275                n1=n1.replace("; ",";");
1276                 n1=n1.replace("/t","");
1277                n1=removeExtraSpace(n1) ;
1278
1279return n1;
1280
1281}
1282
1283
1284//====================================================================================
1285function Remplace_Value(String,Match,remplace){
1286       
1287
1288if (typeof String!="string") csstext = String.style.cssText ;
1289 else csstext = String ;
1290
1291//  HEIGHT: 50px; COLOR: red; text-shadow: blue 20px 20px 18px
1292temp="";
1293
1294// removeExtraSpace
1295csstext=removeExtraSpace( csstext);
1296csstext = csstext.toLowerCase();
1297reg=new RegExp(Match , "gi");
1298string=csstext.split(Match);
1299if (string.length>1 ) {
1300    if (remplace) {
1301        temp=string[1]+";" ;
1302        string=temp.split(";");
1303        string=Match+string[0];
1304        temp=csstext.replace(string,remplace+" " );
1305        }else{
1306        temp=string.join(" ");
1307
1308        }
1309   
1310}else{
1311  if (remplace)  temp = remplace + "; " + csstext;
1312  else temp=  csstext;
1313}
1314
1315 temp=removeExtraSpace(temp.replace(";;",";"));
1316
1317return temp;
1318}
1319//====================================================================================
1320function Get_Value(String,Start_Match, Sep_Match,End_Mach){
1321       
1322
1323if (typeof String!="string") csstext = String.style.cssText 
1324else csstext = String 
1325//  HEIGHT: 50px; COLOR: red; text-shadow: blue 20px 20px 18px
1326
1327var reg=new RegExp('"'  , "g");
1328csstext=csstext.replace(reg,'') ;
1329string=csstext.split(Start_Match + Sep_Match);
1330
1331reg=new RegExp(  End_Mach , "gi");
1332
1333ends=End_Mach.split('');
1334string=string[1] ;
1335valeur = "";
1336for (t0 in ends)
1337{
1338reg = new RegExp(ends[t0] , "gi");
1339    if (reg.test(string) ) {
1340     valeur = string.split(ends[t0])[0];
1341    break;
1342    }
1343}
1344
1345 
1346
1347return  removeExtraSpace( valeur +" "); ;
1348}
1349//====================================================================================
1350function getClassValue(Obj,string){
1351       
1352        var temp = ""; var pos = string.length;
1353      id=jQuery(Obj).attr("id") ; 
1354
1355    if (!jQuery("#"+id).hasClass) return ;
1356       var reg = new RegExp(id+"({)", "g");
1357        temp=classes[id];
1358        temp=classes["."+id];
1359        temp=classes["#"+id];
1360       
1361        for (var j=0;j<classes.length;j++) {
1362        p1=classes[j].indexOf(id );
1363        if (classes[j].match(reg) ) {
1364                   if (classes[j].indexOf(string)!= 0) {
1365     
1366                        temp = classes[j].split("{");
1367            temp[1]=temp[1].replace("}","");
1368         
1369                        break; 
1370            }
1371                   } 
1372                }
1373   
1374        return temp;
1375}
1376
1377function getClassAttribute(classes,string){
1378       
1379        var temp = 0; var pos = string.length;
1380        for (var j=0;j<classes.length;j++) {
1381                if (classes[j].indexOf(string) == 0) {
1382                        temp = 1; break;
1383                }
1384        }
1385        return temp;
1386}
1387//========================================
1388function Add_Obj(Obj)
1389{
1390
1391vmls = jQuery(Obj).aff_path(Obj,s,r) ;   
1392
1393
1394        var vml;  var div; var pos; var i; var classes = '';
1395        var display = ""; var flt = null; var width = null; var height = null;
1396        var start, head, soft, shadow, fill, foot, end;
1397        var left, top, bottom, right, lt, br, linear, inset;
1398         
1399    i=0;
1400   // Nom_classe =  Prefix + "_" + classID ;
1401                image = Obj;
1402                 object = Obj.parentNode; 
1403
1404         width =  Dimension[Obj.id].Width;
1405         height = Dimension[Obj.id].Height;
1406         Left=Dimension[Obj.id].Left;
1407         Top=Dimension[Obj.id].Top;
1408  //--------------------------------------------------------------------------
1409display = (Obj.currentStyle.display.toLowerCase()=='block')?'block':'inline-block';
1410vml = document.createElement('<div id="'+ Obj.id +'" '+
1411' style="overflow:hidden' + 
1412'; position:absolute'+
1413'; zoom:1'+
1414'; zIndex:1'+
1415'; left:'+Left+'px'+
1416'; top:'+Top+'px'+
1417 '; display:' + display +
1418 '; width:' + width + 'px' +
1419 '; height:' + height + 'px'+
1420 '; border:1px solid blue'+
1421 '; padding:0;">' 
1422 );
1423 
1424
1425if (/import/.test(Obj.outerHTML)) {
1426
1427
1428}else
1429        try{   
1430    //vml.className = newClasses;
1431        /*      vml.style.cssText = Obj.style.cssText;
1432                vml.style.height = height+'px';
1433                vml.style.width = width+'px';
1434*/
1435       
1436   
1437
1438
1439        }catch(_){
1440       
1441        }
1442
1443
1444Obj.innerHTML=vmls.Shape ; 
1445 
1446
1447var id=Obj.id;
1448// object.replaceChild( vml,Obj);
1449 
1450
1451   newObj=jQuery("#"+vml.id ).attr("id",id).get(0);
1452 
1453 return newObj ;
1454}
1455//***************************************************************************************
1456if (0){
1457        var theimages = getImages('img');// class name
1458        var image; var object; var vml;  var div; var pos; var i;  classes = '';
1459        var iradius = null; var ishadow = null; var ishade = null; var inverse = null; 
1460        var newClasses = ''; var maxdim = null; var offset = null; var radius = null; 
1461        var display = ""; var flt = null; var width = null; var height = null;
1462        var start, head, soft, shadow, fill, foot, end;
1463        var left, top, bottom, right, lt, br, linear, inset;
1464         
1465    i=0;
1466
1467                image = theimages[i];
1468                object = image.parentNode; 
1469
1470        width = image.width; height = image.height;
1471  //--------------------------------------------------------------------------
1472display = (image.currentStyle.display.toLowerCase()=='block')?'block':'inline-block';
1473vml = document.createElement([
1474'<var style="overflow:hidden;display:' + display +
1475 ';width:' + width + 'px;height:' + height + 'px;padding:0;">'].join(''));
1476flt = image.currentStyle.styleFloat.toLowerCase();
1477
1478display = (flt=='left'||flt=='right')?'inline':display;
1479start = '<v:group style="zoom:1;'+
1480        ' display:' + display + ';'+
1481        ' margin:-1px 0 0 -1px;'+
1482        ' padding:0;'+
1483        ' position:absolute;'+
1484        ' width:' + width + 'px;'+
1485        ' height:' + height + 'px;'+
1486        ' left:' + 300 + 'px;'+
1487        ' top:' + 300 + 'px; '+
1488        ' "'+
1489        ' coordsize="' + width + ',' + height + '">';
1490
1491
1492                fill = '<v:fill src="' + image.src + '" type="frame" />';
1493                foot = (iradius>0?'</v:roundrect>':'</v:rect>');
1494        end = '</v:group>';
1495
1496                soft = ''; shadow = ''; lt = ''; left = ''; top = ''; bottom = ''; right = '';
1497
1498iradius=28;
1499ishadow=33 ;
1500ishade=75;
1501inverse=0;
1502
1503radius="30%";
1504offset=14;
1505maxdim = Math.min(_Width,_Height)/2;
1506
1507if(iradius<=0) {
1508       
1509        if (ishadow>0) {
1510                if(inverse<=0) {
1511                        ishadow = ishadow/50; offset = 8; inset = 4;
1512                        soft = '<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0 ;width:' + width + 'px;height:' + height + 'px;"><v:fill color="#ffffff" opacity="0.0" /></v:rect><v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#000000" style="filter:Alpha(opacity=' + (ishadow*64) + '), progid:dxImageTransform.Microsoft.Blur(PixelRadius=' + inset + ', MakeShadow=false); zoom:1;margin:-1px 0 0 -1px;padding: 0;display:block;position:absolute;top:' + inset + 'px;left:' + inset + 'px;width:' + (width-(3*inset)) + 'px;height:' + (height-(3*inset)) + 'px;"><v:fill color="#000000" opacity="1" /></v:rect>';
1513                                        head = '<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0 ;width:' + (width-offset) + 'px;height:' + (height-offset) + 'px;">';
1514                                }else if(inverse>0) {
1515                                        ishadow = ishadow/50; iradius = 12; linear = "linear";
1516                                        head = '<v:rect filled="t" stroked="t" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:' + width + 'px;height:' + height + 'px;">';
1517                                        shadow = '<v:stroke weight="0.5" opacity="'+(ishadow/2)+'" color="#000000" />';
1518                                        top = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="' + width + ',' + iradius + '" path="m 0,0 l '+width+',0,'+width+','+iradius+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:' + width + 'px; height:' + iradius + 'px;"><v:fill method="' + linear + '" type="gradient" angle="0" color="#000000" opacity="0" color2="#000000" o:opacity2="' + ishadow + '" /></v:shape>'; 
1519                                        left = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="' + iradius + ',' + height + '" path="m 0,0 l 0,'+height+','+iradius+','+height+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:' + iradius + 'px; height:' + height + 'px;"><v:fill method="' + linear + '" type="gradient" angle="90" color="#000000" opacity="0" color2="#000000" o:opacity2="' + ishadow + '" /></v:shape>';
1520                                }
1521                        }else {
1522                                head = '<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="margin:-1px 0 0 -1px;padding:0;display:' + display + ';width:' + width + 'px;height:' + height + 'px;">';
1523                        }
1524                        if(ishade>0) {
1525                                ishade = ishade/50; iradius = 12;
1526                                top = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="' + (width-offset) + ',' + iradius + '" path="m 0,0 l '+(width-offset)+',0,'+(width-offset)+','+iradius+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:' + (width-offset) + 'px; height:' + iradius + 'px;"><v:fill method="linear" type="gradient" angle="0" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="' + ishade + '" /></v:shape>'; 
1527
1528                                left = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="' + iradius + ',' + (height-offset) + '" path="m 0,0 l 0,'+(height-offset)+','+iradius+','+(height-offset)+','+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:' + iradius + 'px; height:' + (height-offset) + 'px;"><v:fill method="linear" type="gradient" angle="90" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="' + ishade + '" /></v:shape>';
1529
1530                                bottom = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="' + (width-offset) + ',' + iradius + '" path="m 0,'+iradius+' l '+(width-offset)+','+iradius+','+(width-offset-iradius)+',0,'+iradius+',0 x e" style="position:absolute; margin: 0; top:' + (height-offset-iradius) + 'px; left: 0px; width:' + (width-offset) + 'px; height:' + iradius + 'px;"><v:fill method="linear" type="gradient" angle="180" color="#000000" opacity="0" color2="#000000" o:opacity2="' + ishade + '" /></v:shape>';
1531
1532                                right = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="' + iradius + ',' + (height-offset) + '" path="m '+iradius+',0 l '+iradius+','+(height-offset)+',0,'+(height-offset-iradius)+',0,'+iradius+' x e" style="position:absolute; margin: 0; top: 0px; left:' + (width-offset-iradius) + 'px; width:' + iradius + 'px; height:' + (height-offset) + 'px;"><v:fill method="linear" type="gradient" angle="270" color="#000000" opacity="0" color2="#000000" o:opacity2="' + ishade + '" /></v:shape>';
1533
1534                        }
1535               
1536                } else {
1537                        if(ishadow>0) {
1538                                linear = "linear sigma"; pos = 2;
1539                                if(inverse<=0) {
1540                                        ishadow = ishadow/50; inset = Math.round(offset*0.5);
1541                                        soft = '<v:rect strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0 ;width:' + width + 'px;height:' + height + 'px;"><v:fill color="#ffffff" opacity="0.0" /></v:rect><v:roundrect arcsize="' + (radius+inset) + '" strokeweight="0" filled="t" stroked="f" fillcolor="#000000" style="filter:Alpha(opacity=' + (ishadow*64) + '), progid:dxImageTransform.Microsoft.Blur(PixelRadius=' + inset + ', MakeShadow=false); zoom:1;margin:-1px 0 0 -1px;padding: 0;display:block;position:absolute;top:' + inset + 'px;left:' + inset + 'px;width:' + (width-(3*inset)) + 'px;height:' + (height-(3*inset)) + 'px;"><v:fill color="#000000" opacity="1" /></v:roundrect>';
1542                                        head = '<v:roundrect arcsize="' + radius + '" strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:' + (width-offset) + 'px;height:' + (height-offset) + 'px;">';
1543                                }else if(inverse>0) {
1544                                        ishadow = ishadow/50;
1545                                        head = '<v:roundrect arcsize="' + radius + '" filled="t" stroked="t" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:' + width + 'px;height:' + height + 'px;">';
1546                                        shadow = '<v:stroke weight="0.5" opacity="'+(ishadow/2)+'" color="#000000" />';
1547                                        top = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="' + width + ',' + iradius + '" path="m '+iradius+','+iradius+' l '+width+','+iradius+' qy '+(width-iradius)+',0 l '+iradius+',0 x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: -1px; width:' + (width+1) + 'px; height:' + iradius + 'px;"><v:fill method="' + linear + '" type="gradient" angle="0" color="#000000" opacity="0" color2="#000000" o:opacity2="' + ishadow + '" /></v:shape>'; 
1548                                        left = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="' + iradius + ',' + height + '" path="m 0,'+iradius+' l 0,'+(height-iradius)+' qy '+iradius+','+height+' l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: -1px; left: 0px; width:' + iradius + 'px; height:' + (height+1) + 'px;"><v:fill method="' + linear + '" type="gradient" angle="90" color="#000000" opacity="0" color2="#000000" o:opacity2="' + ishadow + '" /></v:shape>';
1549                                        lt = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#000000" coordorigin="0,0" coordsize="' + iradius + ',' + iradius + '" path="m '+iradius+','+iradius+' l 0,'+iradius+' qy '+iradius+',0 l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:' + iradius + 'px; height:' + iradius + 'px;"><v:fill method="' + linear + '" focus="1" focusposition="1,1" focussize="0.5,0.5" type="gradientradial" color="#000000" opacity="0" color2="#000000" o:opacity2="' + ishadow + '" /></v:shape>';
1550                                }
1551                        }else {
1552                                pos = 1; offset = 0;
1553                                head = '<v:roundrect arcsize="' + radius + '" strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" style="position:absolute; margin:-1px 0 0 -1px;padding:0; width:' + width + 'px;height:' + height + 'px;">';
1554                        }
1555                        if(ishade>0) {
1556                                ishade = ishade/50; linear = "linear";
1557                                top = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="' + (width-offset) + ',' + iradius + '" path="m '+iradius+','+iradius+' l '+(width-offset)+','+iradius+' qy '+(width-offset-iradius)+',0 l '+iradius+',0 x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: -1px; width:' + (width-offset+pos) + 'px; height:' + iradius + 'px;"><v:fill method="' + linear + '" type="gradient" angle="0" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="' + ishade + '" /></v:shape>'; 
1558                                left = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="' + iradius + ',' + (height-offset) + '" path="m 0,'+iradius+' l 0,'+(height-iradius-offset)+' qy '+iradius+','+(height-offset)+' l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: -1px; left: 0px; width:' + iradius + 'px; height:' + (height-offset+pos) + 'px;"><v:fill method="' + linear + '" type="gradient" angle="90" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="' + ishade + '" /></v:shape>';
1559                                lt = '<v:shape strokeweight="0" filled="t" stroked="f" fillcolor="#ffffff" coordorigin="0,0" coordsize="' + iradius + ',' + iradius + '" path="m '+iradius+','+iradius+' l 0,'+iradius+' qy '+iradius+',0 l '+iradius+','+iradius+' x e" style="position:absolute; margin: -1px 0 0 -1px; top: 0px; left: 0px; width:' + iradius + 'px; height:' + iradius + 'px;"><v:fill method="' + linear + '" focus="1" focusposition="1,1" focussize="0.5,0.5" type="gradientradial" color="#ffffff" opacity="0" color2="#ffffff" o:opacity2="' + ishade + '" /></v:shape>';
1560                        }
1561                }
1562               
1563                vml.innerHTML = start + soft + head + fill + shadow + foot + right + bottom + top + left + lt + end;
1564                //vml.className = newClasses;
1565                vml.style.cssText = image.style.cssText;
1566                vml.style.height = image.height+'px';
1567                vml.style.width = image.width+'px';
1568                vml.height = image.height;
1569                vml.width = image.width;
1570                vml.src = image.src; 
1571        vml.alt = image.alt;
1572
1573
1574    //    object.replaceChild(vml,image);
1575
1576//  object.appendChild(vml);
1577 
1578 // object.removeChild(image);
1579
1580
1581}
1582
1583//====================================================================================
1584function getImages(className){
1585        var children = document.getElementsByTagName('img'); 
1586        var elements = new Array(); var i = 0;
1587        var child; var classNames; var j = 0;
1588        for (i=0;i<children.length;i++) {
1589                child = children[i];
1590                classNames = child.className.split(' ');
1591                for (  j = 0; j < classNames.length; j++) {
1592                        if (classNames[j] == className) {
1593                                elements.push(child);
1594                                break;
1595                        }
1596                }
1597        }
1598        return elements;
1599}
1600//================================ Excanvas ==========================================
1601     function hasSilverlight() {
1602         try {
1603             new ActiveXObject('AgControl.AgControl');
1604             return true;
1605         } catch (_) {
1606             return false;
1607         }
1608     }
1609     //--------------------------------------------------------------------------
1610     function getRgbHslContent(styleString) {
1611         var start = styleString.indexOf('(', 3);
1612         var end = styleString.indexOf(')', start + 1);
1613         var parts = styleString.substring(start + 1, end).split(',');
1614         // add alpha if needed
1615         if (parts.length == 4 && styleString.substr(3, 1) == 'a') {
1616             alpha = +parts[3];
1617         } else {
1618             parts[3] = 1;
1619         }
1620         return parts;
1621     }
1622     //--------------------------------------------------------------------------
1623     function percent(s) {
1624         return parseFloat(s) / 100;
1625     }
1626     //--------------------------------------------------------------------------
1627     function clamp(v, min, max) {
1628         return Math.min(max, Math.max(min, v));
1629     }
1630     //--------------------------------------------------------------------------
1631     function hslToRgb(parts) {
1632         var r, g, b, h, s, l;
1633         h = parseFloat(parts[0]) / 360 % 360;
1634         if (h < 0)
1635             h++;
1636         s = clamp(percent(parts[1]), 0, 1);
1637         l = clamp(percent(parts[2]), 0, 1);
1638         if (s == 0) {
1639             r = g = b = l; // achromatic
1640         } else {
1641             var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
1642             var p = 2 * l - q;
1643             r = hueToRgb(p, q, h + 1 / 3);
1644             g = hueToRgb(p, q, h);
1645             b = hueToRgb(p, q, h - 1 / 3);
1646         }
1647
1648         return decToHex[Math.floor(r * 255)] +
1649         decToHex[Math.floor(g * 255)] +
1650         decToHex[Math.floor(b * 255)];
1651     }
1652     //--------------------------------------------------------------------------
1653     function hueToRgb(m1, m2, h) {
1654         if (h < 0)
1655             h++;
1656         if (h > 1)
1657             h--;
1658
1659         if (6 * h < 1)
1660             return m1 + (m2 - m1) * 6 * h;
1661         else if (2 * h < 1)
1662             return m2;
1663         else if (3 * h < 2)
1664             return m1 + (m2 - m1) * (2 / 3 - h) * 6;
1665         else
1666             return m1;
1667     }
1668     //--------------------------------------------------------------------------
1669   
1670     function translateColor(styleString) {
1671         var str;
1672         var n = 0;
1673        var exp = new RegExp(/^#/);
1674
1675         style_String = jQuery.trim(String(styleString));
1676         if (exp.test(style_String)) { 
1677                  return style_String;
1678             } else if (/^rgb/.test(style_String)) {
1679             parts = getRgbHslContent(style_String);
1680             str = '', n;
1681             for (var i = 0; i < 3; i++) {
1682                 if (parts[i].indexOf('%') != -1) {
1683                     n = Math.floor(percent(parts[i]) * 255);
1684                 } else {
1685                     n = +parts[i];
1686                 }
1687                 str += decToHex[clamp(n, 0, 255)];
1688             }
1689
1690             alpha = parts[3];
1691         } else if (/^hsl/.test(style_String)) {
1692            parts = getRgbHslContent(style_String);
1693             str = hslToRgb(parts);
1694             alpha = parts[3];
1695         } else if (style_String in colorData) {
1696         
1697
1698             return colorData[styleString];
1699
1700          } else if ( !isNaN(style_String)) {
1701
1702           return translateColor("#"+style_String);
1703         } else {
1704
1705
1706             return style_String;
1707
1708
1709         }
1710         // decToHex[Math.floor(alpha * 255)] +
1711         return '#' + str;
1712     }         
1713         
1714         
1715    //--------------------------------------------------------------------------
1716      var colorData = {
1717         aliceblue: '#F0F8FF',
1718         antiquewhite: '#FAEBD7',
1719         aquamarine: '#7FFFD4',
1720         azure: '#F0FFFF',
1721         beige: '#F5F5DC',
1722         bisque: '#FFE4C4',
1723         black: '#000000',
1724         blue:'#0000FF',
1725         blanchedalmond: '#FFEBCD',
1726         blueviolet: '#8A2BE2',
1727         brown: '#A52A2A',
1728         burlywood: '#DEB887',
1729         cadetblue: '#5F9EA0',
1730         chartreuse: '#7FFF00',
1731         chocolate: '#D2691E',
1732         coral: '#FF7F50',
1733         cornflowerblue: '#6495ED',
1734         cornsilk: '#FFF8DC',
1735         crimson: '#DC143C',
1736         cyan: '#00FFFF',
1737         darkblue: '#00008B',
1738         darkcyan: '#008B8B',
1739         darkgoldenrod: '#B8860B',
1740         darkgray: '#A9A9A9',
1741         darkgreen: '#006400',
1742         darkgrey: '#A9A9A9',
1743         darkkhaki: '#BDB76B',
1744         darkmagenta: '#8B008B',
1745         darkolivegreen: '#556B2F',
1746         darkorange: '#FF8C00',
1747         darkorchid: '#9932CC',
1748         darkred: '#8B0000',
1749         darksalmon: '#E9967A',
1750         darkseagreen: '#8FBC8F',
1751         darkslateblue: '#483D8B',
1752         darkslategray: '#2F4F4F',
1753         darkslategrey: '#2F4F4F',
1754         darkturquoise: '#00CED1',
1755         darkviolet: '#9400D3',
1756         deeppink: '#FF1493',
1757         deepskyblue: '#00BFFF',
1758         dimgray: '#696969',
1759         dimgrey: '#696969',
1760         dodgerblue: '#1E90FF',
1761         firebrick: '#B22222',
1762         floralwhite: '#FFFAF0',
1763         forestgreen: '#228B22',
1764         gainsboro: '#DCDCDC',
1765         ghostwhite: '#F8F8FF',
1766         gold: '#FFD700',
1767         goldenrod: '#DAA520',
1768         grey: '#808080',
1769         greenyellow: '#ADFF2F',
1770         green: '#00FF00',
1771         honeydew: '#F0FFF0',
1772         hotpink: '#FF69B4',
1773         indianred: '#CD5C5C',
1774         indigo: '#4B0082',
1775         ivory: '#FFFFF0',
1776         khaki: '#F0E68C',
1777         lavender: '#E6E6FA',
1778         lavenderblush: '#FFF0F5',
1779         lawngreen: '#7CFC00',
1780         lemonchiffon: '#FFFACD',
1781         lightblue: '#ADD8E6',
1782         lightcoral: '#F08080',
1783         lightcyan: '#E0FFFF',
1784         lightgoldenrodyellow: '#FAFAD2',
1785         lightgreen: '#90EE90',
1786         lightgrey: '#D3D3D3',
1787         lightpink: '#FFB6C1',
1788         lightsalmon: '#FFA07A',
1789         lightseagreen: '#20B2AA',
1790         lightskyblue: '#87CEFA',
1791         lightslategray: '#778899',
1792         lightslategrey: '#778899',
1793         lightsteelblue: '#B0C4DE',
1794         lightyellow: '#FFFFE0',
1795         limegreen: '#32CD32',
1796         linen: '#FAF0E6',
1797         magenta: '#FF00FF',
1798         mediumaquamarine: '#66CDAA',
1799         mediumblue: '#0000CD',
1800         mediumorchid: '#BA55D3',
1801         mediumpurple: '#9370DB',
1802         mediumseagreen: '#3CB371',
1803         mediumslateblue: '#7B68EE',
1804         mediumspringgreen: '#00FA9A',
1805         mediumturquoise: '#48D1CC',
1806         mediumvioletred: '#C71585',
1807         midnightblue: '#191970',
1808         mintcream: '#F5FFFA',
1809         mistyrose: '#FFE4E1',
1810         moccasin: '#FFE4B5',
1811         navajowhite: '#FFDEAD',
1812         oldlace: '#FDF5E6',
1813         olivedrab: '#6B8E23',
1814         orange: '#FFA500',
1815         orangered: '#FF4500',
1816         orchid: '#DA70D6',
1817         palegoldenrod: '#EEE8AA',
1818         palegreen: '#98FB98',
1819         paleturquoise: '#AFEEEE',
1820         palevioletred: '#DB7093',
1821         papayawhip: '#FFEFD5',
1822         peachpuff: '#FFDAB9',
1823         peru: '#CD853F',
1824         pink: '#FFC0CB',
1825         plum: '#DDA0DD',
1826         powderblue: '#B0E0E6',
1827         rosybrown: '#BC8F8F',
1828         royalblue: '#4169E1',
1829         saddlebrown: '#8B4513',
1830         salmon: '#FA8072',
1831         sandybrown: '#F4A460',
1832         seagreen: '#2E8B57',
1833         seashell: '#FFF5EE',
1834         sienna: '#A0522D',
1835         skyblue: '#87CEEB',
1836         slateblue: '#6A5ACD',
1837         slategray: '#708090',
1838         slategrey: '#708090',
1839         snow: '#FFFAFA',
1840         springgreen: '#00FF7F',
1841         steelblue: '#4682B4',
1842         tan: '#D2B48C',
1843         thistle: '#D8BFD8',
1844         tomato: '#FF6347',
1845         turquoise: '#40E0D0',
1846         violet: '#EE82EE',
1847         wheat: '#F5DEB3',
1848         whitesmoke: '#F5F5F5',
1849         yellowgreen: '#9ACD32',
1850         yellow: '#FFFF00'
1851     };
1852    //--------------------------------------------------------------------------
1853
1854     function hexToDec(hex) {
1855         return parseInt(hex, 16);
1856     } 
1857    for (i = 0; i < 16; i++) {
1858             for (var j = 0; j < 16; j++) {
1859                 decToHex[i * 16 + j] = i.toString(16) + j.toString(16);
1860             }
1861    }   
1862   //=====================================================================
1863   function copyState(o1, o2) {
1864   o2.style=o1.style ;
1865         o2.fillStyle = o1.fillStyle;
1866         o2.lineCap = o1.lineCap;
1867         o2.lineJoin = o1.lineJoin;
1868         o2.lineWidth = o1.lineWidth;
1869         o2.miterLimit = o1.miterLimit;
1870         o2.shadowBlur = o1.shadowBlur;
1871         o2.shadowColor = o1.shadowColor;
1872         o2.shadowOffsetX = o1.shadowOffsetX;
1873         o2.shadowOffsetY = o1.shadowOffsetY;
1874         o2.strokeStyle = o1.strokeStyle;
1875         o2.globalAlpha = o1.globalAlpha;
1876         o2.font = o1.font;
1877         o2.textAlign = o1.textAlign;
1878         o2.textBaseline = o1.textBaseline;
1879         o2.arcScaleX_ = o1.arcScaleX_;
1880         o2.arcScaleY_ = o1.arcScaleY_;
1881         o2.lineScale_ = o1.lineScale_;
1882     }
1883//================================================================================
1884
1885     // alias some functions to make (compiled) code shorter
1886     var m = Math;
1887     var mr = m.round;
1888     var ms = m.sin;
1889     var mc = m.cos;
1890     var abs = m.abs;
1891     var sqrt = m.sqrt;
1892
1893     // this is used for sub pixel precision
1894     var Z = 10;
1895     var Z2 = Z / 2;
1896
1897
1898function createMatrixIdentity() {
1899         return [
1900       [1, 0, 0],
1901       [0, 1, 0],
1902       [0, 0, 1]
1903     ];
1904     }
1905
1906function getContext() {
1907         return this.context_ ||
1908         (this.context_ = new CanvasRenderingContext2D_(this));
1909     }
1910
1911function CanvasRenderingContext2D_(canvasElement) {
1912         this.m_ = createMatrixIdentity();
1913
1914         this.mStack_ = [];
1915         this.aStack_ = [];
1916         this.currentStringPath_ = [];
1917
1918         // Canvas context properties
1919         this.strokeStyle = '#000';
1920         this.fillStyle = '#000';
1921
1922         this.lineWidth = 1;
1923         this.lineJoin = 'miter';
1924         this.lineCap = 'butt';
1925         this.miterLimit = Z * 1;
1926         this.globalAlpha = 1;
1927         this.font = '10px sans-serif';
1928         this.textAlign = 'left';
1929         this.textBaseline = 'alphabetic';
1930         this.canvas = canvasElement;
1931
1932         var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' +
1933         canvasElement.clientHeight + 'px;overflow:hidden;position:absolute';
1934
1935         var el = canvasElement.ownerDocument.createElement('div');
1936
1937         el.style.cssText = cssText;
1938         canvasElement.appendChild(el);
1939
1940         var overlayEl = el.cloneNode(false);
1941         // Use a non transparent background.
1942         overlayEl.style.backgroundColor = 'red';
1943         overlayEl.style.filter = 'alpha(opacity=0)';
1944         canvasElement.appendChild(overlayEl);
1945
1946         this.element_ = el;
1947         this.currentPath_ = "";
1948         this.arcScaleX_ = 1;
1949         this.arcScaleY_ = 1;
1950         this.lineScale_ = 1;
1951     }
1952
1953//==================================================================================
1954var G_vmlCanvasManager_ = {
1955         init: function (opt_doc) {
1956             var doc = opt_doc || document;
1957             // Create a dummy element so that IE will allow canvas elements to be
1958             // recognized.
1959             doc.createElement('canvas');
1960             doc.attachEvent('onreadystatechange', bind(this.init_, this, doc));
1961         },
1962
1963         init_: function (doc) {
1964             // find all canvas elements
1965             var els = doc.getElementsByTagName('canvas');
1966             for (var i = 0; i < els.length; i++) {
1967                 this.initElement(els[i]);
1968             }
1969         },
1970
1971         /**
1972         * Public initializes a canvas element so that it can be used as canvas
1973         * element from now on. This is called automatically before the page is
1974         * loaded but if you are creating elements using createElement you need to
1975         * make sure this is called on the element.
1976         * @param {HTMLElement} el The canvas element to initialize.
1977         * @return {HTMLElement} the element that was created.
1978         */
1979         initElement: function (el) {
1980             if (!el.getContext) {
1981                 el.getContext = getContext;
1982
1983                 // Add namespaces and stylesheet to document of the element.
1984               //  addNamespacesAndStylesheet(el.ownerDocument);
1985
1986                 // Remove fallback content. There is no way to hide text nodes so we
1987                 // just remove all childNodes. We could hide all elements and remove
1988                 // text nodes but who really cares about the fallback content.
1989           //      el.innerHTML = '';
1990
1991                 // do not use inline function because that will leak memory
1992                 el.attachEvent('onpropertychange', onPropertyChange);
1993                 el.attachEvent('onresize', onResize);
1994
1995                 var attrs = el.attributes;
1996                 if (attrs.width && attrs.width.specified) {
1997                     // TODO: use runtimeStyle and coordsize
1998                     // el.getContext().setWidth_(attrs.width.nodeValue);
1999                     el.style.width = attrs.width.nodeValue + 'px';
2000                 } else {
2001                     el.width = el.clientWidth;
2002                 }
2003                 if (attrs.height && attrs.height.specified) {
2004                     // TODO: use runtimeStyle and coordsize
2005                     // el.getContext().setHeight_(attrs.height.nodeValue);
2006                     el.style.height = attrs.height.nodeValue + 'px';
2007                 } else {
2008                     el.height = el.clientHeight;
2009                 }
2010                 //el.getContext().setCoordsize_()
2011             }
2012             return el;
2013         }
2014     };
2015
2016
2017 //==============================================================================
2018jQuery.fn.extend({
2019
2020
2021aff_path: function (Obj_src,s,r ){
2022if (Obj_src.tagName=="BODY")
2023 return ;
2024 if (Obj_src.tagName=="A")
2025 return ;
2026 //========================================
2027 s = Obj_src.currentStyle;
2028
2029
2030      if (mode==7)
2031      {
2032      correct={x:0,y:0};
2033      }
2034      else
2035      {
2036        correct={x:0,y:0};
2037      }
2038
2039
2040    //==================== width:300px;height:200px; /* interieur */==================================
2041        _Width  =   Dimension[Obj_src.id].Width   ; 
2042        _Height =   Dimension[Obj_src.id].Height ; 
2043        _Left   =   Dimension[Obj_src.id].Left+  (strokeWeight.Left/2  ) ;  ;
2044        _Top    =    Dimension[Obj_src.id].Top  + (strokeWeight.Top/2 ) ;;
2045 
2046    //==========================================================
2047    var typeelement="";
2048   path=Set_Path(r,_Width,_Height );
2049   Path=path.Path;
2050   typeelement=path.typeelement;
2051  if ( path.typeelement=='no') return ;;
2052   CoordSize=path.CoordSize;
2053 var  coordorigin=path.CoordOrigin;
2054
2055    font=[];
2056    var reg=new RegExp('(")', "g");
2057 var   background=[];
2058
2059    for (i in s)
2060    {
2061  name = i.replace(rupper, "-$1").toLowerCase()
2062    if (i.match("font")||i.match("background")) 
2063    {
2064 variable= s[i]  ;
2065
2066   if (i.match("Color")) { variable = translateColor(variable); }
2067   if (i.match("Size"))    variable = jQuery(Obj_src).css(i); 
2068
2069
2070        if (i.match("font"))   font.push(   variable );
2071   //  if (i.match("background"))  background.push(  name +  ":" + variable + "; ");
2072 
2073        }
2074
2075    } 
2076         background = background.join( ' ').replace(reg,"") ;
2077         font = font.join( ' ').replace(reg,"") ;
2078    filled= (Fill_Color!="none") || (Fill_Src!="none") ; 
2079    filtre = Obj_src.style.filter ;
2080
2081     ;
2082    //==================================================================
2083    Options.style={};
2084    Options.stroke={};
2085    Options.fill={};
2086    Options.shape={};
2087
2088
2089
2090    Options.style={   
2091        position:"absolute",
2092        width: _Width+'px'   ,
2093        height: _Height+'px'  ,
2094        font  : font ,
2095        display : 'block',
2096        antialias: 'true',
2097        overflow: 'visible',
2098        color:jQuery(Obj_src).css("color"),
2099        padding:jQuery(Obj_src).css("padding"), 
2100        zoom:'1' 
2101    }
2102
2103
2104
2105        Options.style.left= _Left+correct.x+"px";
2106        Options.style.top=_Top+correct.y+"px";
2107
2108        Options.element= typeelement;
2109
2110
2111    //====================== STROKE =============================
2112 
2113    stroked = (strokeColor.Top != "none") && (strokeWeight.Top!=0)  ;
2114
2115    var  fn="none";
2116    var tile="frame";
2117
2118    if (!stroked) { 
2119        strokeColor.Left="none" ;
2120        strokeColor.Top="none" ;
2121        strokeColor.Bottm="none" ;
2122        strokeColor.Right="none" ;
2123    };
2124
2125    Options.stroke={   
2126    } 
2127     opacity= alpha|0.99;
2128
2129   Fill_Type=Fill_Type || "tile";
2130    Options.fill={   
2131         //  opacity obligatoire
2132       opacity:alpha-0.01 ,
2133       src: Fill_Src,
2134       type : Fill_Type 
2135    }
2136    //==================================================================
2137    Options.shape={
2138        id: Obj_src.id+"_Shape" ,
2139        path:Path ,
2140        stroked : stroked ,
2141     
2142        strokecolor : strokeColor.Left,
2143        strokelinestyle :  strokeStyle.Left ,
2144        strokeweight : strokeWeight.Left+'px'  ,
2145 
2146        coordorigin: coordorigin,
2147        coordSize: CoordSize,
2148
2149
2150        FillColor:Fill_Color ,        //  Defines the brush color that fills the closed path of a shape. 
2151        filled: (Fill_Color != "none")  || (Fill_Src!="none") ,  //  Determines whether the closed path will be filled.         
2152        style:  Set_Value_to_str(Options.style,":",";") 
2153    } 
2154     
2155    //============================================================================
2156    //<textbox string="VML text" layout-flow="vertical"/>
2157    Options.textbox={   
2158        string : texte,
2159        'layout-flow':"vertical" 
2160    }     
2161
2162    Options.group={   
2163             
2164
2165    } 
2166
2167    //====================================================================
2168  var  vml_str=[];
2169 
2170    vml_str.push(  Set_Shape(Nom_classe,Options) );
2171    vml_str.push(  Set_Fill( Nom_classe,Options )  );
2172    //   vml_str.push(  Set_Stroke( Nom_classe,Options )  );
2173     vml_str.push("<div style='line-height:"+Obj_src.currentStyle.lineHeight+"'>" + texte + "</div>"  );
2174  //     vml_str.push(Set_textbox( Nom_classe,Options )  );
2175 
2176//================================================================
2177//--- ajout du texte ---
2178
2179  l0=0  ;
2180  t0=0  ;
2181  texte= jQuery( Obj_src).text(); ;
2182  fils  = Obj_src.childNodes ;
2183  texte_couleur_ombre="";
2184//==========================================================   
2185  vml_texte=[];
2186 if (texte!="") {
2187texte=S;
2188    if (text_shadow)  {
2189     var argShadow= jQuery(Obj_src).getVariables(text_shadow);
2190   jQuery.each(Obj_src.childNodes, function (i, val) { 
2191        if (val.nodeType!=3) val.id=val.id+"_"+i ;
2192                jQuery.each(val.childNodes, function (i, val) { 
2193                 if (val.nodeType!=3) val.id=val.id+"_"+i ;
2194                });
2195
2196            })
2197
2198
2199        l0= argShadow.offset_v -argShadow.flou;
2200        t0= argShadow.offset_h -argShadow.flou;
2201        l0=0;
2202        t0=0;
2203 
2204        vml_texte.push('<div id="' +  Obj_src.id  + '_Texte_Ombre" style=" '+
2205        'padding:' + strokeWeight.Top + 'px ;  '+ ' '+
2206        'position:absolute;left:'+ l0 +'px ; top:'+ t0 +'px;  ">'+ texte +"</div>") ;
2207   
2208//=======================================================================   
2209
2210 vml_texte.push('<div id="' +  Obj_src.id  + '_Texte" style=" '+
2211    'padding:' + strokeWeight.Top + 'px ; '+
2212     'position:absolute; '+
2213    'left:-'+ l0+'px ; top:'+ l0+'px;  ">' + texte +"</div>" );   
2214   
2215
2216    }
2217//=======================================================================   
2218
2219     
2220 
2221
2222   
2223  if(argShadow)  texte_couleur_ombre=argShadow.couleur;
2224
2225  }
2226
2227//==================================================
2228 var  vml_Ombre=[];;
2229 if (box_shadow)  {
2230    argShadow= jQuery(Obj_src).getVariables(box_shadow);
2231        vml_Ombre=[];
2232        Options.shape.id=Obj_src.id + "_Ombre";
2233        Options.shape.FillColor=argShadow.couleur;
2234        Options.shape.filled=true;
2235        Options.stroke.color=argShadow.couleur;
2236        Options.fill.src="none";
2237        Options.fill.type="solid";
2238          /*
2239        Options.stroke.weight="0px"; 
2240        Options.style.padding="0px";
2241        Options.style.background="transparent";
2242        Options.style.position="absolute";
2243        Options.style.padding="0px"; 
2244        Options.style.left="-100px";
2245        Options.style.top="0px";
2246*/
2247  //  Obj_init.style.padding="0px";
2248 
2249  //  Obj_init.style.marginLeft=Dimension[Obj_init.id].Left+argShadow.offset_v|0+"px";
2250  //  Obj_init.style.marginTop=Dimension[Obj_init.id].Top+argShadow.offset_h|0+"px";
2251 
2252    // Options.stroke.weight="0px"; 
2253    l0=argShadow.flou-argShadow.offset_v ;
2254    t0=argShadow.flou-argShadow.offset_h ;
2255    Options.shape.coordorigin= l0 + " , " + t0 ;
2256    vml_Ombre.push(  Set_Shape(Nom_classe,Options) );
2257    vml_Ombre.push(  Set_Fill( Nom_classe,Options )  );
2258    vml_Ombre.push(  Set_Stroke( Nom_classe,Options )  );
2259   vml_Ombre.push(  Set_end_Shape( Nom_classe,Options) );
2260
2261 
2262 }
2263    //============================================================
2264     
2265vml_Ombre= vml_Ombre.join(" ") ; 
2266vml_texte=vml_texte.join(" ") ; 
2267   vml_str.push(   Set_end_Shape( Nom_classe,Options) );
2268vml_str= vml_str.join(" ") ; 
2269
2270 jQuery("#"+Obj_src.id).css("backgroundColor","transparent");
2271
2272
2273/* */
2274   if (texte_couleur_ombre)
2275  jQuery("#"+Obj_src.id+"_Texte_Ombre").css("color",texte_couleur_ombre);
2276  ret={}; 
2277
2278  return { ombre:vml_Ombre, Shape:vml_str,Texte:vml_texte};
2279
2280},
2281//------------------------------------------------------------------------
2282rotate:  function ( deg) {
2283
2284    obj_str=jQuery(this);
2285    obj=obj_str.get(0);
2286if (!obj) return ;
2287
2288
2289     if (typeof obj_str != "string") obj = jQuery(obj_str).get(0);
2290        else obj = jQuery("#"+obj_str).get(0);
2291
2292        if (!externe) {
2293           angle=deg;
2294
2295            jQuery(obj).affFiltres( argShadow);
2296
2297        } else {
2298
2299            //===========================================================
2300            boxShadow = jQuery(obj).css("box-shadow");
2301
2302
2303 var argShadow = jQuery(obj).getVariables(boxShadow);
2304           
2305            argShadow.gradientType= -1;
2306            argShadow.boxShadow= (argShadow.offset_h !=0) || (argShadow.offset_v !=0) ;
2307
2308            argShadow.texteShadow=false;
2309            argShadow.texteRotation=false;
2310
2311             argShadow.boxRotation= (argShadow.deg !=deg) ;
2312             argShadow.deg=deg;
2313
2314          //   argShadow.offset_h +=200;
2315
2316             jQuery(obj).affFiltres( argShadow);
2317
2318        }
2319   },
2320 //-----------------------------------------------------------------------------
2321 affFiltres: function(argShadow)
2322 {
2323obj=this.get(0);
2324
2325    obj.style.zIndex=1;
2326    obj.style.zoom=1;
2327    obj.style.position="absolute";
2328 
2329
2330 id=obj.id;
2331  var  Ombre=jQuery("#"+obj.id+"_ombre").get(0)  ;
2332
2333  if (obj.style.position!='absolute')    obj.style.position='absolute';
2334   if (obj.style.zIndex=='') obj.style.zIndex=1;
2335   if (obj.style.zoom=='')  obj.style.zoom=1;
2336   if (!argShadow) argShadow = jQuery(obj).getVariables(obj.style['boxShadow']);
2337    if (!argShadow) return ;
2338if ( argShadow.boxShadow  ) 
2339        if (!Ombre) { 
2340         
2341                jQuery(this).clone().insertBefore(obj).addClass("Ombre").attr("id", id + "_ombre1");
2342                ombre=jQuery("#"+obj.id+"_ombre1").get(0);
2343             
2344                ombre.style.backgroundImage="none";
2345                ombre.style.backgroundColor="transparent";
2346               
2347                ombre.filled = "true" ;
2348                ombre.fillColor =  argShadow.couleur;
2349               
2350                ombre.stroked = "true" ;
2351                 ombre.strokeweight=0;
2352                ombre.strokecolor = argShadow.couleur;
2353                childs = jQuery( ombre.childNodes).remove() ;
2354
2355
2356                jQuery(ombre).clone().insertBefore(obj).addClass("Ombre").attr("id", id + "_ombre");
2357               jQuery("#"+obj.id+"_ombre1").remove();
2358                ombre=jQuery("#"+obj.id+"_ombre");
2359                Ombre=jQuery("#"+obj.id+"_ombre").get(0)  ;
2360            //   
2361                texte=Ombre.outerHTML;
2362if (/import namespace/.test(texte))
2363{
2364    /*
2365        Ombre.style.backgroundColor="transparent" ;
2366        Ombre.style.backgroundImage="none";
2367        Ombre.filled = "true" ;
2368        Ombre.fillcolor = argShadow.couleur ;
2369        Ombre.stroked = "true" ;
2370        Ombre.strokecolor = argShadow.couleur;
2371        */
2372
2373}else{     
2374            jQuery( Ombre).css("background-color",argShadow.couleur);
2375            jQuery( Ombre).css("border-color", argShadow.couleur);
2376            jQuery( Ombre).css("background-image", "none");
2377           
2378          } 
2379
2380    }
2381
2382   
2383
2384        if (!Init[obj.id]) Init[obj.id]=jQuery("#"+obj.id).position();
2385        if ( Ombre)     if (!Init[ Ombre.id]) Init[Ombre.id]=jQuery("#"+ Ombre.id).position();
2386     
2387         var opacity = parseInt(argShadow.alpha, 10) + "" === "NaN" ? "100" : "" + argShadow.alpha * 100 + "";
2388         if (opacity>100) opacity = parseInt(argShadow.alpha, 10);
2389
2390        var   alpha = opacity;
2391        var   Strength = argShadow.flou;
2392        var   ShadowColor = argShadow.couleur;
2393        var   Horizontal = argShadow.offset_h|1;
2394        var   Vertical = argShadow.offset_v|1;
2395        var   gradientType = argShadow.gradientType ;
2396        var   startColorStr = argShadow.startColorStr ;
2397        var   endColorStr = argShadow.endColorStr ;
2398        var   deg = argShadow.deg ;
2399        if (Vertical == 0) Vertical = 1;
2400        var  direction = 180 - Math.atan(Horizontal / Vertical) * 180 / Math.PI;
2401
2402
2403
2404        //======================================================================================
2405if ( argShadow.boxRotation )  {       
2406        var deg2radians = Math.PI * 2 / 360;
2407        var rad = deg * deg2radians;
2408        var costheta = Math.cos(rad);
2409        var sintheta = Math.sin(rad);
2410        sProperties = "sizingMethod='auto expand',M11=" + costheta + ",M12=" + (-sintheta) + ",M21=" + sintheta + ",M22=" + costheta;
2411
2412        obj.style.filter = "progid:DXImageTransform.Microsoft.Matrix(" + sProperties + ")";
2413        if ( Ombre)   Ombre.style.filter = "progid:DXImageTransform.Microsoft.Matrix(" + sProperties + ")";
2414}
2415        //========= gradient ==========================
2416if (gradientType >= 0) {
2417        sProperties = "gradientType=" + gradientType + ",startColorStr=" + startColorStr + ",endColorStr=" + endColorStr + "";
2418        obj.style.filter += "  progid:DXImageTransform.Microsoft.Gradient(" + sProperties + ") ";
2419}
2420
2421        //=========== opacity========================
2422        sProperties = "opacity = " +  opacity;
2423        if (!obj.style.filter.match("progid:DXImageTransform.Microsoft.Alpha"))
2424        {
2425        if ( Ombre) Ombre.style.filter += "  progid:DXImageTransform.Microsoft.Alpha(" + sProperties + ") ";
2426        obj.style.filter += "  progid:DXImageTransform.Microsoft.Alpha(" + sProperties + ") ";
2427        }
2428//======================================================================================
2429
2430if ( Ombre)     {
2431        filtres =  Ombre.style.filter;
2432
2433        //======================================================================================
2434        sProperties = "color=" + ShadowColor + ", Direction=" + direction + ",Strength=" + Strength / 2 + " ";
2435        if (!filtres.match("progid:DXImageTransform.Microsoft.Glow"))
2436            filtres += " progid:DXImageTransform.Microsoft.Glow(" + sProperties + ")"; /**/
2437        //======================================================================================
2438
2439        sProperties = "pixelradius=" + Strength / 2 + " ,MakeShadow:" + 'false' + ",ShadowOpacity:" + '0.8' + "";
2440        if (!filtres.match("progid:DXImageTransform.Microsoft.Blur"))
2441            filtres += "  progid:DXImageTransform.Microsoft.Blur(" + sProperties + ") ";
2442
2443
2444        //========== DRop==========================================
2445        sProperties = "OffX=" + Horizontal + ", OffY=" + Vertical + ", Color='" + ShadowColor + "', Positive='true'";
2446        //  filtres += "  progid:DXImageTransform.Microsoft.dropshadow(" + sProperties + ") ";
2447        //============================================================
2448         Ombre.style.filter = filtres;
2449
2450        var Top = (( Ombre.clientHeight - Ombre.offsetHeight) / 2);
2451        var Left = (( Ombre.clientWidth - Ombre.offsetWidth) / 2);
2452
2453            jQuery( Ombre).css("left", Left + Init[ Ombre.id].left + Vertical + "px");
2454            jQuery( Ombre).css("top", Top + Init[ Ombre.id].top + Horizontal + "px");
2455
2456
2457}
2458        //================================================================================
2459        Top = ((obj.clientHeight - obj.offsetHeight) / 2);
2460        Left = ((obj.clientWidth - obj.offsetWidth) / 2);
2461        jQuery(obj).css("left", Left + Init[obj.id].left + "px");
2462        jQuery(obj).css("top", Top + Init[obj.id].top + "px");
2463
2464
2465
2466 },
2467
2468//============================================================
2469 getVariables: function(Args)
2470{
2471 var argShadow={
2472       alpha:0.99,
2473       flou:0,
2474       couleur:'transparent',
2475       offset_h:0,
2476       offset_v:0,
2477       gradientType:0,
2478       startColorStr:'yellow',
2479       endColorStr:'blue',
2480       deg:0
2481
2482} 
2483
2484if (!Args) return argShadow;
2485
2486                if (Args.length==4)  Args=Args.join(" ");
2487                Args =   removeExtraSpace(Args);
2488               if (/rgb/.test(Args)) {
2489                     var start = Args.indexOf('(', 3);
2490                     var end = Args.indexOf(')', start + 1);
2491                     var temp = Args.substring(start + 1, end)
2492
2493                if (/rgba/.test(Args))  temp= "rgba(" +temp  +")";
2494               else temp= "rgba(" +temp  +")";
2495
2496                      var  color_Shadow = temp;
2497                        Args=Args.replace(color_Shadow,translateColor(color_Shadow));
2498                    }
2499
2500                   var sizeShadow = Args.split(" ");
2501
2502                   c=sizeShadow.length-1 ;
2503                   a=0 ;
2504                   var st_v=false,st_h=false,st_f=false,st_c=false;
2505
2506                   for (i in sizeShadow)
2507                   {
2508                        g=sizeShadow[i] ;
2509 
2510                        if ( /#/.test(g) ) { argShadow.couleur=sizeShadow[i];st_c=true } 
2511                        else if ( st_v && /px/.test(g) )   { argShadow.flou=parseInt(g|0);st_f=true } 
2512                        else if ( st_h  &&  /px/.test(g) )  {  argShadow.offset_v=parseInt(g );st_v=true } 
2513                        else if ( !st_h && /px/.test(g) ) { argShadow.offset_h=parseInt(g  );st_h=true } 
2514                        else if (isNaN(g))  { argShadow.couleur=translateColor(sizeShadow[i]);st_c=true } 
2515                        else   { argShadow.flou=parseInt(sizeShadow[i]);st_f=true }; 
2516 
2517                   }
2518
2519//==========================================================
2520argShadow.boxShadow=(argShadow.offset_v != 0)||(argShadow.offset_h != 0);
2521            argShadow.gradientType= -1;
2522
2523            argShadow.texteShadow=false;
2524            argShadow.texteRotation=false;
2525            argShadow.boxRotation= (argShadow.deg !=angle) ;
2526            argShadow.deg=angle;
2527
2528            return argShadow;
2529  },
2530   //=======================================================
2531   findPos : function() {
2532    obj_ = jQuery(this).get(0);
2533    if (typeof (obj_)=="undefined") return ;
2534
2535    var curleft = obj_.offsetLeft || 0;
2536    var curtop = obj_.offsetTop || 0;
2537
2538
2539    s=obj_.currentStyle ;
2540    id=obj_.id ;
2541      if ( obj_.tagName!='IMG')   
2542   { 
2543      while (obj_  = obj_.offsetParent) {
2544        id=obj_.id ;
2545        tag=obj_.tagName ;
2546
2547        if (obj_.style.position !="absolute") {
2548        if (mode==8)
2549        if (tag=="BODY") 
2550        break ;
2551
2552        curleft += obj_.offsetLeft;
2553        curtop += obj_.offsetTop;
2554
2555        curleft += obj_.clientLeft;
2556        curtop += obj_.clientTop;
2557        if (mode==7)
2558                if (tag=="BODY") 
2559                    break ;
2560             
2561          }
2562        }
2563        obj_ = jQuery(this).get(0);
2564  var   Origine=jQuery( obj_).position() ;
2565        curwidth  = jQuery(obj_ ).width(); //300x200
2566        curheight = jQuery(obj_ ).height();   
2567        winit=jQuery(obj_ ).css("width") ; //  valeur interieur (auto,"",%)
2568        hinit=jQuery(obj_ ).css("height") ; //  valeur interieur
2569    }else{
2570        tag=obj_.tagName ;
2571        winit= obj_.width || "auto" ; //  Dimension Image
2572        hinit=obj_.height || "auto"  ; ; //   Dimension Image
2573        jQuery(obj_).css("width", winit) ;
2574        jQuery(obj_).css("height", hinit) ;
2575        jQuery(obj_).css("left", obj_.style.left) ;
2576        jQuery(obj_).css("top", obj_.style.top) ;
2577        curwidth  = jQuery(obj_ ).css("width"); //300x200
2578        curheight = jQuery(obj_ ).css("height");
2579        jQuery(obj_ ).width(curwidth);
2580        jQuery(obj_ ).height(curheight);
2581
2582    Origine={left:obj_.style.left,top:obj_.style.top};
2583         w =  parseInt(curwidth) +strokeWeight.Left+strokeWeight.Right; //  valeur interieur + left  border+ right border
2584         h =  parseInt(curheight)+strokeWeight.Bottom+strokeWeight.Top ; //  valeur interieur + left  border+ right border
2585
2586       ;
2587    }
2588         
2589           
2590 
2591
2592 
2593
2594    if (curleft != Origine.left) {
2595    if (mode==7) {   
2596
2597    }
2598    }
2599    if (curtop != Origine.top) {
2600            if (mode==7) {   
2601
2602    }
2603    }
2604
2605    curleft +=strokeWeight.Left ; 
2606    curtop +=strokeWeight.Top ; 
2607 
2608        if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
2609                    largeur = document.documentElement.clientWidth;
2610                    hauteur = document.documentElement.clientHeight;
2611
2612                    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
2613                    largeur = jQuery('body').width();
2614                    hauteur =  jQuery('body').height();
2615                    }
2616
2617
2618
2619
2620
2621
2622
2623
2624    if (curwidth==0) // init document
2625    {
2626    curwidth=largeur ;
2627    if (winit.match("%"))
2628            curwidth=largeur * percent( winit) ;
2629    else if (winit.match("auto"))
2630            curwidth=largeur ;
2631   
2632    jQuery(obj_).width(curwidth);
2633    curheight = jQuery(obj_).height();
2634
2635    }
2636    if (!/img/gi.test(tag)){
2637    w = this[0].offsetWidth ; //  valeur interieur + left  border+ right border
2638    h = this[0].offsetHeight ; //  valeur interieur + left  border+ right border
2639    }
2640    return {x:curleft,y:curtop,Left:Origine.left,Top:Origine.top,Width:curwidth,Height:curheight,w:w,h:h};
2641    }
2642,
2643                                 
2644findSize : function() {
2645         obj = jQuery(this).get(0);
2646
2647
2648          size={ 
2649                 offsetWidth: obj.offsetWidth,
2650                 offsetHeight: obj.offsetHeight,
2651                 offsetLeft: obj.offsetLeft,
2652                 offsetTop: obj.offsetTop,
2653
2654                 clientWidth: obj.clientWidth,
2655                 clientHeight: obj.clientHeight,
2656                 clientLeft: obj.clientLeft,
2657                 clientTop: obj.clientTop,
2658
2659                 scrollWidth: obj.scrollWidth,
2660                 scrollHeight: obj.scrollHeight,
2661                 scrollLeft: obj.scrollLeft,
2662                 scrollTop: obj.scrollTop
2663                 
2664          }
2665
2666
2667 if (obj.style.position=="")  obj.style.position= "static"  ;
2668 var pos_obj = jQuery(obj).findPos();
2669 //=======================================================================
2670 var sel = jQuery(obj).position();
2671          return  { 'Width': obj.offsetWidth,
2672                   'Height': obj.offsetHeight,
2673                   'Left':  pos_obj.x ,
2674                   'Top':  pos_obj.y  ,
2675
2676                 clientWidth: obj.clientWidth,
2677                 clientHeight: obj.clientHeight,
2678                 clientLeft: obj.clientLeft,
2679                 clientTop: obj.clientTop,
2680
2681                 scrollWidth: obj.scrollWidth,
2682                 scrollHeight: obj.scrollHeight,
2683                 scrollLeft: obj.scrollLeft,
2684                 scrollTop: obj.scrollTop,
2685
2686                 x:sel.left+obj.clientLeft,
2687                 y:sel.top+obj.clientTop
2688                    } ;
2689    },
2690                                 
2691    setStyle : function() { 
2692                tables= jQuery("style").get();
2693                reg=new RegExp("(})", "g");
2694            var Styles=[];
2695
2696
2697                for (table in tables)
2698                        {
2699                        styl=removeExtraSpace(tables[table].innerHTML);
2700                        if (styl !="")  Styles.push( styl.replace(reg,"}|") ) ;
2701                        }
2702         var tranche=Styles.slice(0,Styles.length);
2703
2704        classes = removeExtraSpace(Styles.join("")).split("|") ; 
2705        classes=classes.slice(0,classes.length>1 ? classes.length-1 : 0);
2706        classe_style={};
2707                //========== Lecture des Classess ===============
2708        jQuery.each(classes, function (i, val) { 
2709
2710            if (val==" }") return ;
2711            n=i;
2712            if(classes[i+1]==" }") val +=classes[i+1];
2713            cl_str=[];
2714            classe_style2={};
2715
2716            cl_str= (val.replace(reg,'').split("{") );
2717            n2=[];
2718            n0= cl_str[0];
2719            n1= cl_str[1];
2720            n0 = Sup_Bloc(n0,"/\*","\*/" );
2721            if (n0 !="")
2722                {
2723
2724                   n1 = Sup_Bloc(n1,"/\*","\*/" );
2725                   n2=n1.split(";");
2726                //  replace(/[\t\n]/g," ")
2727                var    del =new RegExp("((-)[a-zA-Z0-9/.]+(-))+","gi");
2728                for (n20 in n2)
2729                   { 
2730                   if ( !isNaN(n20)){
2731                     {
2732                        adr1=removeExtraSpace(n2[n20].split(":")[0]).replace(del,"");
2733                        if (adr1)
2734                        {
2735                        val1=removeExtraSpace(n2[n20].split(":")[1]);
2736                         if (val1.indexOf("/\*",0) >= 0){
2737                       
2738                        val1 = Sup_Bloc(val1,"/\*","\*/" );
2739
2740                            }
2741
2742                        if(val1 ) classe_style2[adr1]=val1 ;
2743                        }
2744                       }
2745                     }
2746                   }
2747                  classe_style[n0] = classe_style2 ;
2748              //================================================
2749                                   try {
2750                                        c1=jQuery(n0);
2751                                                        if (c1.length>0) 
2752                                                                if ( classe_style2 )   jQuery(n0).css(classe_style2);
2753                                                } catch (_) {
2754             
2755                                        }
2756
2757                }
2758                    });
2759                //================================================
2760                   IDS=" ";
2761 }
2762
2763 });
2764
2765//================================================================================
2766var window={cross_elements:[]};
2767
2768//=========================================================================
2769jQuery(window).resize(function () {
2770var tmp = navigator.appName == 'Microsoft Internet Explorer' && navigator.userAgent.indexOf('Opera') < 1 ? 1 : 0;
2771if(tmp) var isIE = document.namespaces ? 1 : 0;
2772
2773Window.Width=jQuery(window).width() ;
2774Window.Height=jQuery(window).height() ;
2775     if (  (window.cross_elements.length>  0)  ) {
2776   for (a in window.cross_elements)
2777    jQuery().crossbrowser(window.cross_elements[a]);
2778     }
2779 
2780     
2781});
2782//=========================================================================
2783 jQuery(window).ready(function () { 
2784  externe= (typeof externe!="undefined") ? externe : false ;
2785  if (externe)    jQuery().setStyle();
2786  else   jQuery(':Radius') ; 
2787   
2788   var doc =   document;
2789           if (  (window.cross_elements.length>  0)  ) {
2790    for (a in window.cross_elements)
2791   jQuery().crossbrowser( window.cross_elements[a]);
2792   
2793     }
2794
2795
2796});
2797
2798
2799//=============================================================================================
2800// Ajoute une fonctionnalité jQuery
2801jQuery.extend( jQuery.expr[':'], {
2802    // Nom du sélecteur personnalisé
2803    Radius: function (a) {
2804        var mode = document.documentMode || 0; 
2805        //==========================================================================
2806     
2807        var reg = new RegExp("body+","gi");
2808        if ( reg.test(a.tagName))  {
2809       jQuery(a).setStyle();
2810        }
2811   
2812    if (IDS=="") return ;
2813    if (a.tagName=="BR") return ;
2814    if (a.tagName=="STYLE") return ;
2815    if (a.tagName=="SCRIPT") return ;
2816    if (a.tagName=="BODY") return ;
2817    if (typeof a.uniqueID=="undefined") {
2818       IDS += "op_" + uniqueId + " " + a.tagName + "|";
2819      }
2820     else{
2821    if ( IDS.match(a.uniqueID)) return ;
2822    if ( (a.id=="No")) return ;
2823      IDS += a.uniqueID + " " + a.tagName +" " +a.id + "|";
2824  }
2825if (a.tagName=="!") return ;
2826  reg = new RegExp("(clone|ombre)","gi") ; // atention a la casse
2827    if (reg.test( a.id) ) return ;
2828   reg = new RegExp("(src)","gi") ; // atention a la casse
2829    if (reg.test( a.id) ) return ;
2830  reg = new RegExp("(vml)","gi") ; // atention a la casse
2831    if (reg.test( a.id) ) return ;
2832
2833Unique_id += 1;
2834var m1=style_match.join(",").split(","); 
2835var   Attribut = false;
2836var argus= arguments[3] ;
2837var ids=IDS;
2838
2839 Object = a ;
2840 var  s = a.style;
2841  if (typeof  Object.currentStyle!="undefined") s = Object.currentStyle ;
2842  var cssText =   a.style.cssText ; // lecture style="....
2843    // recupère le style courant
2844  var cle = style_match;
2845
2846  var Message = a.innerText;
2847
2848
2849   Message   =  a.id + "<br />" ;
2850   var name=a.id ;
2851    jQuery.each(jQuery.browser, function (i, val) { 
2852    Message += i +  " " + val + ", " ;
2853     
2854    });
2855   Message  +=  "<br />" ;
2856var sMatch ;
2857
2858if (!a.id) a.id=a.uniqueID;       
2859for(var j in cle) {
2860
2861  /*
2862    name = cle[j].replace(rdashAlpha, fcamelCase); test-shadow -> textShadow ;
2863    name = name.replace(rupper, "-$1").toLowerCase();textShadow -> test-shadow ;
2864    */
2865    //   var camelCase = name.replace(rdashAlpha, fcamelCase);
2866 
2867if (!isNaN(j))
2868{
2869  Smatch=cle[j].replace(rupper, "-$1").toLowerCase();
2870  sMatch=Smatch.replace(rdashAlpha, fcamelCase);
2871
2872   var valeur  = s[Smatch] || s[sMatch];
2873
2874
2875if (classe_style["#"+a.id])  if (!valeur) { valeur = classe_style["#"+a.id][Smatch] ; }
2876
2877         reg = new RegExp(Smatch,"g") ; // atention a la casse
2878             if ( cssText.match(reg) ) {   //======= si défini dans le style
2879                                         Message  += "Style(csstext) OK  : " + a.id + " " + Smatch + ":" + valeur;   
2880                                         }
2881
2882  if (!valeur) {
2883              for (cl in  classe_style["#"+a.id])
2884              {
2885               cl0=classe_style["#"+a.id][cl] ;
2886               if (reg.test(cl)) { valeur=cl0; }
2887               }
2888           }
2889if ( valeur) {
2890        var Nmatch="xxx"; 
2891         jQuery.each(jQuery.browser, function (i, val) { 
2892         if (val==true){
2893                    Nmatch=browsers[i];
2894                    return ;
2895                    }
2896               
2897            })
2898 
2899      Attribut= true   ;
2900       jQuery("#"+a.id).css( Nmatch + Smatch,valeur);
2901       Window={ width:jQuery(window).width(),height:jQuery(window).height()
2902     };
2903       
2904
2905      try{ 
2906     Message +="W:" + Window.width + "#"+a.id+ " " + Nmatch + "<br /> "+Nmatch  + Smatch + ":" + valeur + "  --> " + Smatch + ":" + jQuery("#"+a.id).css( Nmatch + Smatch)+ "<br /> "; 
2907      jQuery("#debug").get(0).innerHTML=("<pre>"+Message+"<br /></pre>");}catch (_)
2908      {            }
2909    } 
2910
2911     }
2912  } 
2913    if ( Attribut && jQuery.browser.msie) { 
2914           if (typeof (window.cross_elements) == 'undefined') {
2915             window.cross_elements = new Array();
2916           
2917         }else{
2918 
2919 }
2920       
2921         window.cross_elements.push(a);
2922          return Attribut;
2923           
2924      }
2925 return false;
2926        }
2927});
2928 //==============================================================================       
2929jQuery.fn.crossbrowser = function (Element) {
2930  jQuery(Element).ready(function () {
2931  if (Element.readyState=="complete")
2932  {
2933  //--------------------------------------------------
2934  t1=Element.tagName + Element.id;
2935       
2936      jQuery(Element,"img" ).ready(function () {
2937                    oncontentready(Element);
2938      });
2939
2940
2941
2942   //--------------------------------------------------
2943     }
2944     });
2945 }
2946
2947})(jQuery);
Note: See TracBrowser for help on using the repository browser.