Guest User

Untitled

a guest
May 24th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. Event.observe('pageWrap', 'mouseover', function(event) {
  2. var element = Event.element(event);
  3.  
  4. if($(element).tagName.toLowerCase() === "a" && $(element).hasClassName("tt")){
  5. linkUrl = ($(element).getAttribute('href').indexOf('index')!=-1)?$(element).getAttribute('href'):'';
  6. linkID = (linkUrl)?(((linkUrl.split("?"))[1].split("&"))[0].split("="))[1]:linkID;
  7. }
  8.  
  9. if ($(element).tagName.toLowerCase() === 'img' && $(element).hasClassName('thumbnail')) {
  10. var url = location.protocol+'//'+location.host;
  11. var newLocation = ($(element).src).replace(url, "");
  12.  
  13. $($(element)).observe('click', function(obj){
  14. $($(element)).up('a').setAttribute('href', newLocation.replace("/tn_","/"));
  15. $($(element)).up('a').setAttribute('rel', "lightbox_assets/galleries/"+linkID+"/gallery");
  16. validateInitLightBox();
  17. });
  18. $($(element)).observe('mouseout', function(obj){
  19. $($(element)).up('a').setAttribute('href',linkUrl);
  20. });
  21. }
  22.  
  23. if ($(element).tagName.toLowerCase() === 'span' && $(element).hasClassName('bottom')){
  24.  
  25. $(element).setAttribute('title', "Click here to view the property information");
  26.  
  27. $($(element)).observe('click', function(obj){
  28. $($(element)).up('a').removeAttribute('rel');
  29. $($(element)).up('a').setAttribute('href',linkUrl);
  30. if(validateInitLightBox()){
  31. document.location.href = linkUrl;
  32. }
  33. });
  34. }
  35.  
  36. });
Add Comment
Please, Sign In to add comment