(function($){ var varurl = decodeURIComponent('http%3A//kaamar.com/help/information/user-agreement'); if(varurl != '') { if(varurl.search('https') >= 0) { var callurl = 'https://del.icio.us'+'/save/get_iframe_login?url=http%3A//kaamar.com/help/information/user-agreement&title=User%20Agreement%20%28Information%2C%20Kaamar%20Help%29¬es=User%20Agreement%20%28Information%2C%20Kaamar%20Help%29'; var cimg = 'https://del.icio.us/static/bookmarklet/img/close-sprite.png'; } else { var callurl = 'https://del.icio.us'+'/save/get_iframe_login?url=http%3A//kaamar.com/help/information/user-agreement&title=User%20Agreement%20%28Information%2C%20Kaamar%20Help%29¬es=User%20Agreement%20%28Information%2C%20Kaamar%20Help%29'; var cimg = 'https://del.icio.us/static/bookmarklet/img/close-sprite.png'; } } else { var callurl = window.location.protocol+'//del.icio.us'+'/save/get_iframe_login?url=http%3A//kaamar.com/help/information/user-agreement&title=User%20Agreement%20%28Information%2C%20Kaamar%20Help%29¬es=User%20Agreement%20%28Information%2C%20Kaamar%20Help%29'; var cimg = window.location.protocol+'//del.icio.us/static/bookmarklet/img/close-sprite.png'; } var style = ''; var slidedown_html = '', mist_html = '
', iframe_html = ''; function init() { var body = $('body'); body.prepend(style); body.prepend(mist_html); $(slidedown_html).hide().prependTo('body').slideDown('normal'); $('#DELI_save_link_slidedown').html(''+iframe_html); $('#DELI_close').click(function(){ slide_toggle(); setTimeout(function() {$('#DELI_save_link_slidedown').remove(); $('#DELI_mist').remove();}, 2000); }) }; init() var slide_toggle = function(){ var slidedown = $('#DELI_save_link_slidedown') if (slidedown){ slidedown.slideUp('normal'); $('#DELI_mist').fadeOut('normal'); }else{ $('#DELI_mist').show(); slidedown.slideDown('normal'); } } // keep trace of mouse movement var mouse_in_save_link_slidedown = false; $('#DELI_save_link_slidedown').hover(function() { mouse_in_save_link_slidedown = true; }, function(){ mouse_in_save_link_slidedown = false; }); $('body').mouseup(function(){ if(! mouse_in_save_link_slidedown){ slide_toggle(); } }); // listen to iframe login succeeded message var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent"; var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message"; window[eventMethod](messageEvent, onMessage, false); function onMessage(e) { //if (e.origin !== "http://del.icio.us") if (e.origin !== "https://del.icio.us") return; if (e.data === 'login_succeeded'){ var varurl1 = decodeURIComponent('http%3A//kaamar.com/help/information/user-agreement'); if(varurl1.search('https') >= 0) { var callurl1 = 'https://'+'del.icio.us/save/get_iframe_savelink?url=http%3A//kaamar.com/help/information/user-agreement&title=User%20Agreement%20%28Information%2C%20Kaamar%20Help%29¬es=User%20Agreement%20%28Information%2C%20Kaamar%20Help%29'; } else { var callurl1 = 'https://'+'del.icio.us/save/get_iframe_savelink?url=http%3A//kaamar.com/help/information/user-agreement&title=User%20Agreement%20%28Information%2C%20Kaamar%20Help%29¬es=User%20Agreement%20%28Information%2C%20Kaamar%20Help%29'; } $('#iframe_bookmarklet').attr({ 'src': callurl1 }) }else if(e.data === 'savelink_succeeded' || e.data === 'destroy_bookmarklet'){ slide_toggle(); setTimeout(function() {$('#DELI_save_link_slidedown').remove(); $('#DELI_mist').remove();}, 2000); }else{} } })(jQuery); function closeAddto(p1,p2){ alert('call') }