function home_init() { $('td[@class=promo] div[@class=item-list] div[@class*=view-data-node-data-field-textpromo-field-textpromo-value]').each(function() { this.onmouseover = function() { _obj = $(this); _obj.css({opacity: 0.7}); }; this.onmouseout = function() { _obj = $(this); _obj.css({opacity: 0.0}); }; this.onclick = function() { _obj = $(this); _link = _obj.siblings('.view-data-node-title').children('a'); location = _link.attr('href'); }; }); } function jump_to_url(url){ location = url; } function goto_term(select_name){ _obj = $('select[@name=' + select_name + ']'); jump_to_url(_obj.val()); } var current_img_popup = ''; function set_current_popup(imgpath){ current_img_popup = '/'+imgpath; } function change_pic(img_src, description,filepath){ $('div[@id=current_image] img').attr('src', img_src); $('div[@id=image_desc]').html(description); set_current_popup(filepath); } function popup_img(width, height, img_src) { if(current_img_popup == '') { window.open(img_src, "Image", "menubar=no,width="+(18 + width)+",height="+(18 + height)+",toolbar=no"); } else { window.open(current_img_popup, "Image", "menubar=no,width="+(18 + width)+",height="+(18 + height)+",toolbar=no"); } } function viewport_width() { if (typeof document.body.offsetWidth != 'undefined') { w = document.body.offsetWidth; } else if (typeof window.innerWidth != 'undefined') { w = window.innerWidth; } // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document) else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { w = document.documentElement.clientWidth; } // older versions of IE else { w = document.getElementsByTagName('body')[0].clientWidth; } return w; } function viewport_height() { if (typeof document.body.offsetHeight != 'undefined') { h = document.body.offsetHeight; } else if (typeof window.innerHeight != 'undefined') { h = window.innerHeight; } // IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document) else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientHeight != 'undefined' && document.documentElement.clientHeight != 0) { h = document.documentElement.clientHeight; } // older versions of IE else { h = document.getElementsByTagName('body')[0].clientHeight; } return h; } function find_x_pos(obj) { var x = 0; if(obj.offsetParent) { do { x += obj.offsetLeft; obj = obj.offsetParent; } while(obj); } else if(obj.x) { x += obj.x; } return x; } function find_y_pos(obj) { var y = 0; if(obj.offsetParent) { do { y += obj.offsetTop; obj = obj.offsetParent; } while(obj); } else if(obj.y) { y += obj.y; } return y; } function document_onload() { home_init(); document_resize(); // $.frameReady(adsense_onload, 'top.google_ads_frame'); } function document_resize() { w = viewport_width(); if(115 /* padding */ + 160 /* banner width */ + 823 /* canvas size */ < w) { $('div[@id=region-floating]').show(); } else { $('div[@id=region-floating]').hide(); } } function adsense_onload() { } // bind onload function when document has finished loading. $(window).resize(document_resize); var imagecache_372x279_link = '/sites/and.drupal.fw.comrax.com/files/imagecache/372x279/'; function change_large_image(pic_src,pic_name,pic_desc){ $('img[@id=large_img_disp]').attr('src',imagecache_372x279_link+pic_src); $('a[@id=lrg_img_link]').attr('href','/'+pic_src); $('span[@id=imgdesc]').html(pic_desc); } function replace_gallery(a_tag,gallery_id,first_img_path,first_img_title,first_img_name){ $('div[@class*=gallery_main_thumb] a[@class=active]').attr('class',''); a_tag.className = 'active'; $('div[@class=gallery_on]').attr('class','gallery_off'); $('div[@class=gallerydesc_on]').attr('class','gallerydesc_off'); $('div[@id=tumb_gallery_'+gallery_id+']').attr('class','gallery_on'); $('div[@id=desc_gallery_'+gallery_id+']').attr('class','gallerydesc_on'); galtitle = $('div[@id=desc_gallery_'+gallery_id+'] div[@class=gellery_desc_title]').html(); $('h3[@id=secgaltitle]').html(galtitle); $('span[@id=imgdesc]').html(''); change_large_image(first_img_path,first_img_name,first_img_title); } function next_gal_page(galleryid){ current = $('div[@id=tumb_gallery_'+galleryid+'] div[@class=thumb_page]'); next = current.next('.thumb_page_off'); if(next.attr('class')){ current.attr('class','thumb_page_off'); next.attr('class','thumb_page'); } } function back_gal_page(galleryid){ current = $('div[@id=tumb_gallery_'+galleryid+'] div[@class=thumb_page]'); back = current.prev('.thumb_page_off'); if(back.attr('class')){ current.attr('class','thumb_page_off'); back.attr('class','thumb_page'); } }