/*Add Eventlistner to the Change Location var fld = document.getElementById('languageSubmitButton'); if (fld.addEventListener) fld.addEventListener('onClick',eventClickformSubmit,false );*/ // Fix background image flickering in IE try { document.execCommand('BackgroundImageCache', false, true); } catch(e) { } var close_text = 'close'; // Contact Block layout placeholder $(function() { var $block = $('#ContentChannel .contactBlock'); if ($block.length > 0) { $('body').addClass('contentChannelContactBlock'); var width = $block.width(); var height = $block.height(); var placeholder_div = '
'; // If we're on a product page, we need to position the placeholder div // in such a way that it integrates well with the other bits on the page var product_intro = $('#ContentChannel .productIntro'); if (product_intro.length > 0) { var no_images = $('#ContentChannel .productIntro .noImages'); if (no_images.length > 0) { no_images.prepend(placeholder_div); } else { var media = $('#ContentChannel .productIntro .media'); if (media.length > 0) { media.before(placeholder_div); } } } else { // If the contact block overlaps with a section block, it will force down // the section block. The extra margin on the li pushes the section block // even further down so we just strip it out var $section_block = $('#ContentChannel ul.sectionBlock:first'); if ($section_block.length > 0) { if (overlapsVertically($section_block, $block)) { $('li:first', $section_block).css( { 'margin-top': 0 } ); } } // The best for last....if the contact block overlaps with a table in a content // block we need to do something magical var $content_text_table = $('#ContentChannel div.contentText > table'); if ($content_text_table.length > 0) { if (overlapsVertically($content_text_table, $block)) { // Since the table won't wrap around the placeholder div, we need to // reduce the height on the div so that it doesn't overlap with the table // anymore. This means that if the table text extends out as far as the // contact block, it will be overlapped by the block. // Our new height is the difference between the top of the table and // the bottom of the contact block, subtracted from the existing block // height. The fudge factor is in there to get it as tightly as we can // get it. I'm not sure why it's slightly off. var new_height = height // height of the contact block - ( $block.position().top // top offset for the block + height // height of the block + parseInt($block.css('margin-top')) // top margin for the block + 2 // fudge factor - $content_text_table.position().top // top offset for the table ); // Replace the existing height of the placeholder div with this new height placeholder_div = placeholder_div.replace(/height:\d+px;/, 'height:' + new_height + 'px;'); } } $('#ContentChannel').prepend(placeholder_div); } } }); $(function() { if ($.getURLParam('plain_view') == 1) { $('html').addClass('plainView'); } $('#MainChannel a, #SidebarSecondary a').bind('contextmenu', function(e){ // added by shash to prevent default for following files. var url = $(this).attr('href'); if(url.match(/.zip$|.exe$|.bin$|.tar.gz$|.upg$|.pkg$|.gho$|.rar$|.gz$|.taz$|.cab$/)) return false; var domainName = window.location.hostname; var dname = window.location; dname = dname.toString(); var url = this.href; var check_absolute = 0; var polycomServiceUrlValue='.com/'; var polycomServiceUrl = document.getElementById('polycomServiceUrl'); if(polycomServiceUrl!=null){ polycomServiceUrlValue=polycomServiceUrl.value; } if( url.indexOf('www.polycom.com') > 0){ check_absolute = 1; } if(url.indexOf('PolycomService') > 0 ) { check_absolute = 1; } var old_url = url.substring(url.indexOf(polycomServiceUrlValue), url.length); old_url = old_url.substring(old_url.indexOf('/'), old_url.length); var one_more = (dname.split("/",6)); if(domainName.split(".",1) != 'corpiwov01' && check_absolute == 0) { if( (url.indexOf('/support') > 0) && (url.indexOf('partner.polycom.com') < 0 )&& (url.indexOf('/global')< 0) && (url.indexOf('connect.polycom.com') < 0 )) { new_url = '/PolycomService/support/'+ one_more[5] + old_url; this.href = new_url; // window.location.href = new_url; }else if((url.indexOf('/global') > 0)) { var documentFolder = document.getElementById('productAndDocumentUrl'); if(documentFolder!=null){ var documentFolerValue=documentFolder.value; } if(documentFolerValue!=null){ new_url = documentFolerValue + old_url; }else{ new_url = 'http://supportdocs.polycom.com/PolycomService/support' + old_url; } this.href = new_url; // window.open(new_url, "document"); // return false; }else if((url.indexOf('/products') > 0) && (url.indexOf('www.microsoft')<0)) { new_url = '/PolycomService/support/'+ one_more[5] + old_url; this.href = new_url; // window.location.href = new_url; } } }); $('#MainChannel a, #SidebarSecondary a').click(function(event) { event.preventDefault(); // alert('ini'); // added by shash to prevent default for following files. var url = $(this).attr('href'); if(url.match(/.zip$|.exe$|.bin$|.tar.gz$|.upg$|.pkg$|.gho$|.rar$|.gz$|.taz$|.cab$/)) return false; var domainName = window.location.hostname; var dname = window.location; dname = dname.toString(); var url = this.href; var check_absolute = 0; if(url.indexOf('partner.polycom.com') < 0 && url.indexOf('support.polycom.com') < 0 && url.indexOf('corpprtqaweb0') < 0 && url.indexOf('connect.polycom.com') < 0 ) { window.open(url,"_blank"); return false; } var polycomServiceUrlValue='.com/'; var polycomServiceUrl = document.getElementById('polycomServiceUrl'); if(polycomServiceUrl!=null){ polycomServiceUrlValue=polycomServiceUrl.value; } if( url.indexOf('www.polycom.com') > 0){ check_absolute = 1; } if(url.indexOf('PolycomService') > 0 ) { check_absolute = 1; } var old_url = url.substring(url.indexOf(polycomServiceUrlValue), url.length); old_url = old_url.substring(old_url.indexOf('/'), old_url.length); var one_more = (dname.split("/",6)); if(domainName.split(".",1) != 'corpiwov01' && check_absolute == 0) { if( (url.indexOf('/support') > 0) && (url.indexOf('partner.polycom.com') < 0 )&& (url.indexOf('/global')< 0) && (url.indexOf('connect.polycom.com') < 0 )) { new_url = '/PolycomService/support/'+ one_more[5] + old_url; this.href = new_url; window.location.href = new_url; return false; }else if((url.indexOf('/global') > 0)) { var documentFolder = document.getElementById('productAndDocumentUrl'); if(documentFolder!=null){ var documentFolerValue=documentFolder.value; } if(documentFolerValue!=null){ new_url = documentFolerValue + old_url; }else{ new_url = 'http://supportdocs.polycom.com/PolycomService/support' + old_url; } this.href = new_url; window.open(new_url, "document"); return false; }else if((url.indexOf('/products') > 0) && (url.indexOf('www.microsoft')<0)) { new_url = '/PolycomService/support/'+ one_more[5] + old_url; this.href = new_url; window.location.href = new_url; return false; } } window.location = url; }); }); // Detect if an element overlaps vertically with another element var overlapsVertically = function($elm, $overlaps_with) { var elm_position = $elm.position(); var olap_position = $overlaps_with.position(); return (elm_position.top < (olap_position.top + fullHeight($overlaps_with))); } // Find the full height of an element, including top and bottom margin var fullHeight = function($elm) { var margin_top = parseInt($elm.css('margin-top')); var margin_bottom = parseInt($elm.css('margin-bottom')); return margin_top + margin_bottom + $elm.height(); } // Threshold of Wrapper height for showing back to top link. // If height is less than this, hide the link. var backToTopHeight = 700; var activeSection; /* begin - Navigation Primary */ var NavigationPrimary = { init: function() { var c = this; var n = $('#NavigationPrimary .content > ul'); if (activeSection != null) $('#' + activeSection).addClass('active'); // Use bgiframe to fix dropdowns over selects if it's available. $.fn.bgiframe && $('li', n).bgiframe(); // Mark parent elements so that we can style them with CSS $('> li', n).each(function() { c.markParents(this); }); // Use the hoverintent plugin if it's available if ($.fn.hoverIntent) { $('li', n).hoverIntent( { sensitivity: 1, over: this.mouseenter, out: this.mouseleave, timeout: 100 }); } else $('> li', n).hover(this.mouseenter, this.mouseleave); // Setup Opacity in browser-neutral way - Removed transperency.. //$(' > li > ul', n).css('opacity', 100%); }, markParents: function(li) { var c = this; if ($('> ul', li).size() > 0) $(li).addClass('parent').find('> a').addClass('parent').end().find('> ul li').each( function() { c.markParents(this); }); }, mouseenter: function() { $(this).addClass('over').children('a').addClass('over'); /*Set a width for menus in IE so that they display right and are just long enough for the longest item if ($.browser.msie && ! $(this).is('.widthSet')) { var width = 0; $('li', this).each( function() { if ($(this).width() > width) width = $(this).width() - 20; }); width = width + "px"; $('li', this).each( function() { $(this).css("width", width).children('a').css("width", width); }); $(this).addClass('widthSet'); }*/ }, mouseleave: function() { $(this).removeClass('over').children('a').removeClass('over'); } }; $(function() { NavigationPrimary.init(); }); /* end - Primary Navigation */ /* Fix PNGs with alpha transparencies to display correctly in IE6 */ var _isIE6 = (document.all && document.fireEvent && document.createComment); if(_isIE6){ if ($.fn.pngfix) { $('#NavigationPrimary, #Footer .channel').pngfix(); } } // Hide "Back to top" link if the page isn't long enough to warrant displaying it. var BackToTop = { init: function() { if ($('#Wrapper').height() < backToTopHeight) $('#BackToTop').hide(); } }; $(function() { BackToTop.init(); }); /* Special search behavior */ var Search = { prompt: "Search", // default value - should get real value from markup init: function() { this.prompt = $('#qt').focus(this.focus).blur(this.blur).val(); }, focus: function() { if (this.value == Search.prompt) { this.value = ''; } }, blur: function() { if (this.value.length == 0) { this.value = Search.prompt; } } }; $(function() { Search.init(); }); var ProductMediaControl = { carousel: null, mediaContainer: null, label: null, imageNumTag: null, viewLargerLink: null, prompt: 'View more images: ', // Editable by setting ProductMediaControl.prompt after library.js is loaded init: function() { if (! $.fn.jcarousel) return; var t = this; t.mediaContainer = $('.productIntro > .media'); if (t.mediaContainer.length == 0) { return; } t.carousel = $('ul.images', t.mediaContainer); t.label = $('p.label', t.mediaContainer); t.modalDialog = null; $('li.hideOnLoad', ProductMediaControl.mediaContainer).removeClass('hideOnLoad'); t.carousel.jcarousel({ scroll: 1, initCallback: t.carouselInitCallback, itemVisibleInCallback: t.carouselItemVisibleInCallback, animation: 0, buttonNextHTML: null, buttonPrevHTML: null, visible: 1, wrap: 'both' }); }, carouselInitCallback: function(carousel) { var PMC = ProductMediaControl; PMC.viewLargerLink = $('a.view-larger', PMC.mediaContainer); // Only setup label and next/prev controls if we have multiple // images. if (carousel.size() > 1) { PMC.label.html(PMC.prompt + '1/' + carousel.size()); PMC.imageNumTag = $('span.imageNum', PMC.label); $('a.jcarousel-next', PMC.mediaContainer).bind('click', function() { carousel.next(); return false; }); $('a.jcarousel-prev', PMC.mediaContainer).bind('click', function() { carousel.prev(); return false; }); $('p.label,ul.controls li', PMC.mediaContainer).show(); } else { // Hide label and next/prev controls, but not view larger // We might have a single image that still has a view larger option. $('p.label,ul.controls li', PMC.mediaContainer).hide(); } PMC.viewLargerLink.facebox({ opacity: 0.5, loadingImage: '/images/common/loading.gif', modalId: 'ProductMediaModal', contentSelector: '.channel .content', faceboxHtml: '\ ' }); }, carouselItemVisibleInCallback: function(carousel, li, i, state) { if (ProductMediaControl.imageNumTag) ProductMediaControl.imageNumTag.html(i); ProductMediaControl.setViewLarger(li); return false; }, clickViewLarger: function() { return false; }, setViewLarger: function(li) { var largerImage = $('img', li).metadata().largerImage; if (largerImage) { ProductMediaControl.viewLargerLink.parent().show(); ProductMediaControl.viewLargerLink.css( { 'background-position': '100% 0', 'cursor': 'pointer' } ); ProductMediaControl.viewLargerLink.attr('href', largerImage); } else { ProductMediaControl.viewLargerLink.parent().hide(); ProductMediaControl.viewLargerLink.css( { 'background-position': '100% -50px', 'cursor': 'default' } ); ProductMediaControl.viewLargerLink.attr('href', '#'); } } }; $(function() { ProductMediaControl.init(); }); var SolutionMediaControl = { mediaContainer: null, viewLargerLink: null, init: function() { var t = this; t.mediaContainer = $('.solutionIntro > .media'); if (t.mediaContainer.length == 0) { return; } t.modalDialog = null; $('ul.controls', t.mediaContainer).show(); t.viewLargerLink = $('a.view-larger', t.mediaContainer); t.viewLargerLink.facebox({ opacity: 0.5, loadingImage: '/images/common/loading.gif', modalId: 'ProductMediaModal', contentSelector: '.channel .content', faceboxHtml: '\ ' }); t.setViewLarger($('li:first', t.mediaContainer)); }, clickViewLarger: function() { return false; }, setViewLarger: function(li) { var largerImage = $('img', li).metadata().largerImage; if (largerImage) { SolutionMediaControl.viewLargerLink.parent().show(); SolutionMediaControl.viewLargerLink.css( { 'background-position': '100% 0', 'cursor': 'pointer' } ); SolutionMediaControl.viewLargerLink.attr('href', largerImage); } else { SolutionMediaControl.viewLargerLink.parent().hide(); SolutionMediaControl.viewLargerLink.css( { 'background-position': '100% -50px', 'cursor': 'default' } ); SolutionMediaControl.viewLargerLink.attr('href', '#'); } } }; $(function() { SolutionMediaControl.init(); }); $(function() { $('a.newWindow').popupwindow(); $('#PrintLink').popupwindow(); // Make the print page link open in a new window $('#ContentChannel a').printPage(); // Footnote the content }); $(document).ready(function() { $('#homepageContactOptionsBox').hide(); $('#homepageContactOptionsBox').css('z-Index', 8); if($('#NavigationPrimary ul li.primary ul>div.drop-links-small').length == 0 && $('#NavigationPrimary ul li.primary ul>div.drop-links').length == 0) { //minisite $('#NavigationPrimary div.content ul li.primary>a:first-child').bind('mouseover', function(event) { $(this).parents('li.primary').children('.right_separator').css('visibility', 'visible'); $(this).parents('li.primary').children('.left_separator').css('visibility', 'visible'); }); $('#NavigationPrimary div.content ul li.primary>a:first-child').bind('mouseout', function(event) { $(this).children('a').css('color', '#ffffff'); $(this).parents('li.primary').children('.right_separator').css('visibility', 'hidden'); $(this).parents('li.primary').children('.left_separator').css('visibility', 'hidden'); }); } else { //full site $('#NavigationPrimary ul li.primary ul>div.drop-links-small').bind('mouseover', function(event) { $(this).parents('li.primary').children('a').css('color', '#e00009'); $(this).parents('li.primary').children('.right_separator').css('visibility', 'visible'); $(this).parents('li.primary').children('.left_separator').css('visibility', 'visible'); }); $('#NavigationPrimary ul li.primary ul>div.drop-links').bind('mouseover', function(event) { $(this).parents('li.primary').children('a').css('color', '#e00009'); $(this).parents('li.primary').children('.right_separator').css('visibility', 'visible'); $(this).parents('li.primary').children('.left_separator').css('visibility', 'visible'); }); $('#NavigationPrimary div.content ul li.primary>a:first-child').bind('mouseover', function(event) { $(this).parents('li.primary').children('.right_separator').css('visibility', 'visible'); $(this).parents('li.primary').children('.left_separator').css('visibility', 'visible'); }); $('#NavigationPrimary ul li.primary ul>div.drop-links-small').bind('mouseout', function(event) { $(this).parents('li.primary').children('a').css('color', '#ffffff'); $(this).parents('li.primary').children('.right_separator').css('visibility', 'hidden'); $(this).parents('li.primary').children('.left_separator').css('visibility', 'hidden'); }); $('#NavigationPrimary ul li.primary ul>div.drop-links').bind('mouseout', function(event) { $(this).parents('li.primary').children('a').css('color', '#ffffff'); $(this).parents('li.primary').children('.right_separator').css('visibility', 'hidden'); $(this).parents('li.primary').children('.left_separator').css('visibility', 'hidden'); }); $('#NavigationPrimary div.content ul li.primary>a:first-child').bind('mouseout', function(event) { $(this).children('a').css('color', '#ffffff'); $(this).parents('li.primary').children('.right_separator').css('visibility', 'hidden'); $(this).parents('li.primary').children('.left_separator').css('visibility', 'hidden'); }); } //event listener for footer social media icons $('#socialMediaIcons, #followUs').each(function() { $(this).bind('mouseover', function(event) { $('#socialMediaIcons').attr("src","/global/images/common/social-media-color.jpg"); $('#followUs').css({'color':'#e00009','text-decoration':'underline'}); }); $(this).bind('mouseout', function(event) { $('#socialMediaIcons').attr("src","/global/images/common/social-media-bw.jpg"); $('#followUs').css({'color':'#000000','text-decoration':'none'}); }); }); // Hide/show the language change block $('.language a').click( function() { var $$ = $('#LanguageChange'); if ($$.is(':visible')) $$.hide(); // Let second click on link close interface else $$.show(); }); $('#LanguageChange a.close').click( function() { $('#LanguageChange').hide(); } ); /* Display JS alert when the 'Go' button is clicked in the language box and no language has been selected. */ $('#LanguageChange input.languageSubmit').click( function() { if (document.getElementById("locationSelector").value == "") { alert("Please select a language."); return false; } else { var v = document.getElementById("locationSelector").options[document.getElementById("locationSelector").selectedIndex].value; if(document.getElementById("remember_me").checked==true){ document.getElementById("Change").action = 'http://www.polycom.com/plantCookie.html?select='+ v +'&remember_me=on'; } else { if(v == 'us_en') { document.getElementById("Change").action = countryArray[v] + '?showme=y'; // US home page to pass the cookie test document.getElementById("Change").method = 'post' } else if(v == 'jp_ja') { document.getElementById("Change").method = 'get'; document.getElementById("Change").action = countryArray[v]; } else { document.getElementById("Change").action = countryArray[v]; document.getElementById("Change").method = 'post' } } document.getElementById("Change").submit; } }); var contactUsTimer; var mouse_enter = false; //CONTACT US BOX - This is for now to work on BrandZone. Will go back to this. /* if ( $('#Toolbar #contactUs').not(':visible') ) { $('#homepageContactOptionsBox').css('visibility','visible'); $('#homepageContactOptionsBox').hide(); }*/ $('#Toolbar #contactUs').bind('mouseenter', function(event) { clearTimeout ( contactUsTimer ); mouse_enter = false; $('#homepageContactOptionsBox').fadeIn('fast'); ntptEventTag('contactUsBox=activated'); //unica }); $('#Toolbar #contactUs').bind('mouseleave', function(event) { contactUsTimer = setTimeout(function(){ if(mouse_enter != true) $('#homepageContactOptionsBox').fadeOut('fast'); } , 200); //wait 300ms before init }); $('#homepageContactOptionsBox #homepageContactOptionsBoxClose').bind('click', function(event) { $('#homepageContactOptionsBox').fadeOut('fast'); }); $('#homepageContactOptionsBox').bind('mouseenter', function(event) { mouse_enter = true; }); $('#homepageContactOptionsBox').bind('mouseleave', function(event) { mouse_enter = false; $('#homepageContactOptionsBox').fadeOut('fast'); }); }); // end of document.ready /* Re-sizing solution for the right channel rich media content block on the product details template. */ var rhsFlashDivHeight = ""; function changecss(element, property, value) { $(element).css(property, value); } var _hbPageView = function() { // Stub for development return null; }; var flash_popup = function(swfName, title, width, height, tagline, domain) { //alert("swf: " + swfName); //alert("title: " + title); //alert("width: " + width); //alert("height: " + height); //alert("tagline: " + tagline); //alert("domain: " + domain); jQuery.facebox( { ajax: swfName }); //jQuery.facebox(function($) { // $(this).get(swfName, function(data) { $.facebox(data) }) //}) }; function initialiseRHSFlashDiv() { changecss('#rightnav #rhs_flash_navi', 'height', rhsFlashDivHeight); } /* End re-sizing JS solution */ function openProductfinderhref(url) { var myheight = 958; var mywidth = 950; if((url.indexOf("/product_finder/wireless/index.html") > -1)) { myheight =525 ; mywidth = 675 ; } window.open(url,'SelectProduct','height='+myheight+',width='+mywidth+',menubar=0, toolbar = 0, resizable=1,location=1,scrollbars=1'); return false; } /* image swap over */ function MM_swapImgRestore() { var i,x,a=document.MM_sr; for(i=0;a&&i