arr_notes=new Array() ; note_it_branding_url="http://www.noteiton.com" ; note_it_div_ids = new Array() ; var note_it_float_speed = 0.1 ; var note_it_timer_speed = 25; note_it_win_size = note_it_get_client_size() ; note_it_win_scroll =note_it_get_scroll_pos() ; function close_note_it(div_id){document.body.removeChild(document.getElementById(div_id)); note_it_div_ids[div_id]["Show"] = 0;} function load_note_it_now(){ note_it_set_onresize() note_it_win_size = note_it_get_client_size() ; note_it_win_scroll =note_it_get_scroll_pos() ; //alert(_query) ; //alert(_oppa_) ; //alert(arr_notes.length); for(id in arr_notes){ noteit = new NoteIt(arr_notes[id]) ; //alert('creating noteit, ID='+id+' arr_notes[id][mageURL]'+arr_notes[id]['ImageURL']) ; } //alert(docFullHeight()) ; } function note_it_set_onresize(){ old_on_resize = window.onresize ; window.onresize=function(){if(old_on_resize!=null)old_on_resize(); note_it_win_size = note_it_get_client_size();} ; } function note_it_get_scroll_pos() { var scrOfX = 0, scrOfY = 0; if( typeof( window.pageYOffset ) == 'number' ){ //Netscape compliant scrOfY = window.pageYOffset; scrOfX = window.pageXOffset; } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft; } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) { //IE6 standards compliant mode scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft; } return [ scrOfX, scrOfY ]; } function note_it_get_client_size() { var myWidth = 0, myHeight = 0; if( typeof( window.innerWidth ) == 'number' ) { //Non-IE myWidth = window.innerWidth; myHeight = window.innerHeight; } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode' myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight; } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible myWidth = document.body.clientWidth; myHeight = document.body.clientHeight; } return [ myWidth, myHeight ]; } function docTop(){return (note_it_win_scroll[1]!=null)?note_it_win_scroll[1]:0 ;} function docLeft(){return (note_it_win_scroll[0]!=null)?note_it_win_scroll[0]:0 ;} function docWidth(){return (note_it_win_size[0]!=null)?(note_it_win_size[0]-20):0;}// -20 is compensating to scrollbars function docHeight(){return (note_it_win_size[1]!=null)?(note_it_win_size[1]-20):0;}// -20 is compensating to scrollbars function docGetFullHeight(){return document.body.scrollHeight;} function floatSticky(id){ note_it_win_scroll =note_it_get_scroll_pos() ; t_div = document.getElementById(id) ; if(t_div==null) return ; _top = t_div.style.top; _left = t_div.style.left ; if(_top.indexOf('px')>-1) _top = _top.replace(/px/i,"") ; if(_left.indexOf('px')>-1) _left = _left.replace(/px/i,"") ; switch(note_it_div_ids[id]["Type"]){ case "fixed_top_left": if(_leftdocLeft()){ _left-=Math.ceil((_left-docLeft())*note_it_float_speed) ; }else _left = docLeft(); break ; case "float_top_left": if(_topdocTop()){_top-=Math.ceil((_top-docTop())*note_it_float_speed) ; }else _top = docTop(); if(_leftdocLeft()){ _left-=Math.ceil((_left-docLeft())*note_it_float_speed) ; }else _left = docLeft(); break; case "fixed_top_right": if(_left<(docLeft()+(docWidth()-note_it_div_ids[id]["Width"]))){ _left=((docLeft()+docWidth()-note_it_div_ids[id]["Width"])-Math.floor(((docLeft()+docWidth()-note_it_div_ids[id]["Width"])-_left)*(1-note_it_float_speed))) ; }else if(_left>(docLeft()+(docWidth()-note_it_div_ids[id]["Width"]))){ _left -= Math.ceil((_left-(docLeft()+docWidth()-note_it_div_ids[id]["Width"]))*note_it_float_speed); }else left = (docLeft()+docWidth()-note_it_div_ids[id]["Width"]); break; case "float_top_right": if(_topdocTop()){ _top-=Math.ceil((_top-docTop())*note_it_float_speed) ; }else _top = docTop(); if(_left<(docLeft()+(docWidth()-note_it_div_ids[id]["Width"]))){ _left=((docLeft()+docWidth()-note_it_div_ids[id]["Width"])-Math.floor(((docLeft()+docWidth()-note_it_div_ids[id]["Width"])-_left)*(1-note_it_float_speed))) ; }else if(_left>(docLeft()+(docWidth()-note_it_div_ids[id]["Width"]))){ _left -= Math.ceil((_left-(docLeft()+docWidth()-note_it_div_ids[id]["Width"]))*note_it_float_speed); }else left = (docLeft()+docWidth()-note_it_div_ids[id]["Width"]); break; case "fixed_bottom_left": if(_leftdocLeft()){ _left-=Math.ceil((_left-docLeft())*note_it_float_speed) ; }else _left = docLeft(); break; case "float_bottom_left": if(_top<(docTop()+(docHeight()-note_it_div_ids[id]["Height"]))){ _top=((docTop()+(docHeight()-note_it_div_ids[id]["Height"]))-Math.floor((docTop()+docHeight()-note_it_div_ids[id]["Height"]-_top)*(1-note_it_float_speed))) ; }else if(_top>(docTop()+(docHeight()-note_it_div_ids[id]["Height"]))){ _top -= Math.ceil((_top-(docTop()+docHeight()-note_it_div_ids[id]["Height"]))*note_it_float_speed); }else _top = (docTop()+docHeight()-note_it_div_ids[id]["Height"]); if(_leftdocLeft()){ _left-=Math.ceil((_left-docLeft())*note_it_float_speed) ; }else _left = docLeft(); break; case "fixed_bottom_right": if(_left<(docLeft()+(docWidth()-note_it_div_ids[id]["Width"]))){ _left=((docLeft()+docWidth()-note_it_div_ids[id]["Width"])-Math.floor(((docLeft()+docWidth()-note_it_div_ids[id]["Width"])-_left)*(1-note_it_float_speed))) ; }else if(_left>(docLeft()+(docWidth()-note_it_div_ids[id]["Width"]))){ _left -= Math.ceil((_left-(docLeft()+docWidth()-note_it_div_ids[id]["Width"]))*note_it_float_speed); }else left = (docLeft()+docWidth()-note_it_div_ids[id]["Width"]); break ; case "float_bottom_right": if(_top<(docTop()+(docHeight()-note_it_div_ids[id]["Height"]))){ _top=((docTop()+(docHeight()-note_it_div_ids[id]["Height"]))-Math.floor((docTop()+docHeight()-note_it_div_ids[id]["Height"]-_top)*(1-note_it_float_speed))) ; }else if(_top>(docTop()+(docHeight()-note_it_div_ids[id]["Height"]))){ _top -= Math.ceil((_top-(docTop()+docHeight()-note_it_div_ids[id]["Height"]))*note_it_float_speed); }else _top = (docTop()+docHeight()-note_it_div_ids[id]["Height"]); if(_left<(docLeft()+(docWidth()-note_it_div_ids[id]["Width"]))){ _left=((docLeft()+docWidth()-note_it_div_ids[id]["Width"])-Math.floor(((docLeft()+docWidth()-note_it_div_ids[id]["Width"])-_left)*(1-note_it_float_speed))) ; }else if(_left>(docLeft()+(docWidth()-note_it_div_ids[id]["Width"]))){ _left -= Math.ceil((_left-(docLeft()+docWidth()-note_it_div_ids[id]["Width"]))*note_it_float_speed); }else left = (docLeft()+docWidth()-note_it_div_ids[id]["Width"]); break; case "float_center": if(_top<(docTop()+(docHeight()/2)-(note_it_div_ids[id]["Height"]/2))){ _top=((docTop()+(docHeight()/2)-(note_it_div_ids[id]["Height"]/2))-Math.floor((docTop()+(docHeight()/2)-(note_it_div_ids[id]["Height"]/2)-_top)*(1-note_it_float_speed))) ; }else if(_top>(docTop()+(docHeight()/2)-(note_it_div_ids[id]["Height"]/2))){ _top-=Math.ceil((_top-(docTop()+((docHeight()/2)-(note_it_div_ids[id]["Height"]/2))))*note_it_float_speed) ; }else _top = (docTop()+((docHeight()/2)-(note_it_div_ids[id]["Height"]/2))); if(_left<(docLeft()+((docWidth()/2)-(note_it_div_ids[id]["Width"]/2)))){ _left=((docLeft()+((docWidth()/2)-(note_it_div_ids[id]["Width"]/2)))-Math.floor((docLeft()+(docWidth()/2)-(note_it_div_ids[id]["Width"]/2)-_left)*(1-note_it_float_speed))) ; }else if(_left>(docLeft()+((docWidth()/2)-(note_it_div_ids[id]["Width"]/2)))){ _left-=Math.ceil((_left-(docLeft()+((docWidth()/2)-(note_it_div_ids[id]["Width"]/2))))*note_it_float_speed) ; }else _left = (docLeft()+((docWidth()/2)-(note_it_div_ids[id]["Width"]/2))); break; } if(!(_top==null || _top.length==0)) t_div.style.top = _top+"px" ; if(!(_left==null || _left.length==0)) t_div.style.left = _left+"px" ; setTimeout("floatSticky('"+id+"')",note_it_timer_speed) ; } function renderStickyImage007(r_properties){ var arVersion = navigator.appVersion.split("MSIE"); var version = parseFloat(arVersion[1]); if(r_properties!=null && r_properties["id"]!=null){ var _div; var _div_exists = true ; // Make sure we don't create a div with the same ID if(document.getElementById("sticky_div_"+r_properties["id"])==null){ _div_exists = false ; _div = document.createElement('div') ; _div.id = "sticky_div_"+r_properties["id"] ; _div.style.position="absolute" ; _div.style.marginBottom="0" ; _div.style.zIndex=100000; }else _div=document.getElementById("sticky_div_"+r_properties["id"]) ; if(_div==null) return; //Set position properties if(r_properties["Type"]!=null && r_properties["Type"].length>0){ switch(r_properties["Type"]){ case "fixed_top_left": case "float_top_left": r_properties["XLoc"] = 0 ; r_properties["YLoc"] = 0 ; break; case "float_top_right": case "fixed_top_right": r_properties["XLoc"] = (docWidth()-r_properties["Width"]) ; r_properties["YLoc"] = 0 ; break; case "fixed_bottom_left": r_properties["XLoc"] = 0; r_properties["YLoc"] = (docGetFullHeight()-r_properties["Height"]) ; break ; case "fload_bottom_left": r_properties["XLoc"] = 0; r_properties["YLoc"] = (docHeight()-r_properties["Height"]) ; break; case "fixed_bottom_right": r_properties["XLoc"] = (docWidth()-r_properties["Width"]) ; r_properties["YLoc"] = (docGetFullHeight()-r_properties["Height"]) ; break; case "float_bottom_right": r_properties["XLoc"] = (docWidth()-r_properties["Width"]) ; r_properties["YLoc"] = (docHeight()-r_properties["Height"]) ; break; case "float_center": case "fixed_center": r_properties["XLoc"] = ((docWidth()/2)-(r_properties["Width"]/2)) ; r_properties["YLoc"] = ((docHeight()/2)-(r_properties["Height"]/2)) ; break; } } if(r_properties['Height']!=null) _div.style.height = r_properties['Height']+"px" ; if(r_properties['Width']!=null) _div.style.width = r_properties['Width']+"px" ; if(r_properties['MapShape']!=null && r_properties['MapShape'].length>0){ if(r_properties["MapCoords"]!=null && r_properties["MapCoords"].length>0){ _map = document.createElement('map') ; _map.name="stickymap_"+r_properties["id"] ; _map.id="stickymap_"+r_properties["id"] ; _area = document.createElement('area') ; _area.id = "stickyarea_"+r_properties["id"] ; _area.href="javascript:close_note_it('sticky_div_"+r_properties["id"]+"');" ; _area.shape = r_properties["MapShape"]; _area.coords = r_properties["MapCoords"] ; _area.title="Close NoteIt!" ; _map.appendChild(_area) ; if(r_properties["LinkCoords"]!=null && r_properties["LinkCoords"].length>0 && r_properties["LinkURL"]!=null && r_properties["LinkURL"].length>0){ _area_link = document.createElement('area') ; _area_link.id = "stickylink_"+r_properties["id"] ; _area_link.href=r_properties["LinkURL"] ; _area_link.shape = "poly"; _area_link.coords = r_properties["LinkCoords"] ; _map.appendChild(_area_link) ; } if(r_properties["BrandingCoords"]!=null && r_properties["BrandingCoords"].length>0){ _area_brand = document.createElement('area') ; _area_brand.id = "brandinglink_"+r_properties["id"] ; _area_brand.href= note_it_branding_url ;//r_properties["LinkURL"] ; _area_brand.shape = "poly"; _area_brand.coords = r_properties["BrandingCoords"] ; _map.appendChild(_area_brand) ; } document.body.appendChild(_map) ; //(document.documentElement?document.documentElement:document.body).appendChild(_map) ; }//end if }//end if if(r_properties["ImageURL"]!=null && r_properties["ImageURL"].length>0){ if(_div_exists ==false){ doc = document.body;//document.body; doc.appendChild(_div) ; note_it_div_ids[_div.id] = new Array(); note_it_div_ids[_div.id]["Show"] = 1 ; note_it_div_ids[_div.id]["Type"] = r_properties["Type"]; note_it_div_ids[_div.id]["XLoc"] = r_properties["XLoc"]; note_it_div_ids[_div.id]["YLoc"] = r_properties["YLoc"]; note_it_div_ids[_div.id]["Height"] = r_properties["Height"]; note_it_div_ids[_div.id]["Width"] = r_properties["Width"]; } _image = document.createElement('img') ; _image.onload = function(){ } _image.src=r_properties["ImageURL"] ; _image.style.border="0" ; if(r_properties["Height"]!=null){_image.style.height = r_properties["Height"]+"px" ;} if(r_properties["Width"]!=null){_image.style.width = r_properties["Width"]+"px" ;} if ((version >= 5.5 && version < 7.0) && (document.body.filters)){ _span=document.createElement('div') ; _close_span=document.createElement('a') ; _r_close_coords =(r_properties["MapCoords"]).split(",") ; _close_span.style.position="absolute" ; _close_span.style.display="block" ; _close_span.title="Close!"; _close_span.href="javascript:close_note_it('sticky_div_"+r_properties["id"]+"');" ; _close_span.style.top = _r_close_coords[1]+"px"; _close_span.style.height= (_r_close_coords[5]-_r_close_coords[1])+"px"; _close_span.style.left = _r_close_coords[0]+"px" ; _close_span.style.width= (_r_close_coords[2]-_r_close_coords[0])+"px"; // Link Span _span.style.display="block" ; _span.style.height = r_properties['Height'];//_div.style.height ; _span.style.width = r_properties['Width'];//_div.style.width ; _span.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + _image.src + "', sizingMethod='scale')" ; _span.appendChild(_close_span) ; var _span2=document.createElement('span') ; if(r_properties["LinkCoords"]!=null && r_properties["LinkCoords"].length>0 && r_properties["LinkURL"]!=null && r_properties["LinkURL"].length>0){ _link_span=document.createElement('a') ; _r_link_coords = r_properties["LinkCoords"].split(",") ; _link_span.style.position="absolute" ; _link_span.style.display="block" ; _link_span.href=r_properties["LinkURL"] ; _link_span.style.top = _r_link_coords[1]+"px"; _link_span.style.height= (_r_link_coords[5]-_r_link_coords[1])+"px"; _link_span.style.left = _r_link_coords[0]+"px" ; _link_span.style.width= (_r_link_coords[2]-_r_link_coords[0])+"px"; _span2.appendChild(_link_span) ; } var _span3=document.createElement('span') ; if(r_properties["BrandingCoords"]!=null && r_properties["BrandingCoords"].length>0){ _brand_span=document.createElement('a') ; _r_brand_coords = r_properties["BrandingCoords"].split(",") ; _brand_span.style.position="absolute" ; _brand_span.style.display="block" ; _brand_span.href= note_it_branding_url ; _brand_span.style.top = _r_brand_coords[1]+"px"; _brand_span.style.height= (_r_brand_coords[5]-_r_brand_coords[1])+"px"; _brand_span.style.left = _r_brand_coords[0]+"px" ; _brand_span.style.width= (_r_brand_coords[2]-_r_brand_coords[0])+"px"; _span3.appendChild(_brand_span) ; } _div.appendChild(_span) ; _div.appendChild(_span3) ; _div.appendChild(_span2) ; }else{ _image.useMap="#stickymap_"+r_properties["id"] ; _image.id = "stickyimage_"+r_properties["id"] ; _div.appendChild(_image) ; } if(r_properties["Type"].substr(0,5)=="float"){ r_properties["YLoc"]=0-r_properties["Height"] ; }else{ } floatSticky("sticky_div_"+r_properties["id"]) ; _div.style.left = r_properties["XLoc"]+"px" ; _div.style.top = r_properties["YLoc"] +"px" ; _div.style.visibility="visible" ; }//end if }//end if }//end Sticky_renderDIV() function NoteIt(r_props){ this.r_XML = r_props ; var image_ = new Image() ; image_.onload = function(){r=new Renderer(r_props);} image_.onerr = function(){return} image_.onabort = function(){return} if(this.r_XML["ImageURL"]!=null && this.r_XML["ImageURL"].length>0){ //alert("Loading Image: "+(this.r_XML["ImageURL"]).replace(/&/gi,"&")) ; image_.src=(this.r_XML["ImageURL"]).replace(/&/gi,"&") ; } }//end NoteIt class function Renderer(r_props){ this.render(r_props) ; } Renderer.prototype.render = renderStickyImage007 ; Renderer.prototype.float_note_it = floatSticky ; for(id in arr_notes){ im = new Image() ; im.src=arr_notes[id]['ImageURL'] ; }