disableAddDrive = false; function d(id) { return document.getElementById(id); } function removeElement(id){ obj = d(id); if(obj) obj.parentNode.removeChild(obj); } function addClass(element, value) { if (!element.className) { element.className = value; } else { var newClassName = element.className; newClassName += " "; newClassName += value; element.className = newClassName; } } function hasClass (element, value) { if (typeof element == 'undefined' || element==null ) { return false; } if(element.className) { str = element.className.split( " " ); for( i = 0; i < str.length; i++ ){ if(str[i]==value) return true; } } return false; } function removeClass(element, value) { if (element.className) { var newClassName = ""; str = element.className.split( " " ); for( i = 0; i < str.length; i++ ){ if( str[i] != value && str[i]!="" ) newClassName += ( i==0 ? "" : " " ) + str[i]; } element.className = newClassName; } return 0; } function addClassSimple(element, value) { element.className = value; } function removeClassSimple(element) { element.className = ''; } function bindAddClass() { addClass (this, 'hover') } function chengeTab(num) { removeClassSimple(d('tabArea')); removeClassSimple(d('content')); removeClassSimple(d('mainControls')); addClassSimple(d('tabArea'), 'tab'+num); addClassSimple(d('content'), 'cont'+num); addClassSimple(d('mainControls'), 'ctrl'+num); addClassSimple(d('tab'+num), 'selected'); for (i=1; i<=3; i++){ if(i!=num){ removeClassSimple(d('tab'+i)); } } } flyoutFileName = ''; function blockContent (remove_on_click, loader, opacity) { var imgBlockContent = document.createElement('img'); imgBlockContent.setAttribute('src','img/1.gif'); imgBlockContent.className = "positionAbsolute blockStandart"; var mainConteiner = d('mainDTGadjet'); imgBlockContent.style.width = (mainConteiner.offsetWidth - 8) + "px"; //d('alert_div').innerHTML = imgBlockContent.style.height; imgBlockContent.style.height = mainConteiner.offsetHeight + "px"; imgBlockContent.id = "block_content"; if(opacity) { var opacityBlockContent = document.createElement('img'); opacityBlockContent.setAttribute('src','img/1.gif'); opacityBlockContent.className = "positionAbsolute opacity_80 blockLoader"; opacityBlockContent.style.width = (mainConteiner.offsetWidth-11) +"px"; opacityBlockContent.style.height = (mainConteiner.offsetHeight - 57) + "px"; opacityBlockContent.id = "block_content_opacity"; mainConteiner.appendChild(opacityBlockContent); } if(remove_on_click) imgBlockContent.attachEvent('onclick', function(){ return function(){removeElement('block_content'); bodyHideFlyout();}}()); mainConteiner.appendChild(imgBlockContent); if(loader) { imgLoader = document.createElement('img'); mainConteiner.offsetHeight } } function unBlockContent () { removeElement('block_content'); removeElement('block_content_opacity'); } function unBlockContentOnHide() { unBlockContent(); d(flyoutFileName+'_selected').style.display = 'none'; if( disableAddDrive == true && flyoutFileName=='add_drive') {} else d(flyoutFileName).style.display = 'block'; } function showFlyout() { System.Gadget.Flyout.show = true; } function hideFlyout() { System.Gadget.Flyout.show = false; } function bodyHideFlyout() { if(System.Gadget.Flyout.show == true) { hideFlyout(); d(flyoutFileName+'_selected').style.display = 'none'; d(flyoutFileName).style.display = 'block'; } } function flyoutShowHide(fileName) { if(System.Gadget.Flyout.show == true) { hideFlyout(); d(flyoutFileName+'_selected').style.display = 'none'; if( disableAddDrive == true && flyoutFileName=='add_drive') d(flyoutFileName).style.display = 'none'; else d(flyoutFileName).style.display = 'block'; System.Gadget.Flyout.file = fileName+".html"; } else { System.Gadget.Flyout.file = fileName+".html"; flyoutFileName = fileName; showFlyout(); blockContent(true); d(fileName).style.display = 'none'; d(fileName+'_selected').style.display = 'block'; } } function returnGadgetOnHide(){ System.Gadget.Flyout.onHide = unBlockContentOnHide; } function RemoveS(str) { if(str.length > 2) { return str.substr(1, str.length-2); } return ""; } function dTLoader() { d('dt_loader').style.backgroundPosition = "-"+Gadget.loaderStep+"px 0"; if (Gadget.loaderStep == 715) Gadget.loaderStep=0; else Gadget.loaderStep += 65; Gadget.dtLoaderTimeout = setTimeout("dTLoader()",60); }