function init(item){ if(item!="")nav(item); skinGetURL(); startpromos(); } //************************************************************************ function startpromos(){ try { fadeboxstart(0); fadeboxstart(1); fadeboxstart(2); } catch(err) { //Handle errors here } } var fadebox ; var color = new Array(0,0,0) var maxfadebox = new Array(10,3,9); //starting from 1 var current = new Array(1,1,1); // var current = new Array(3,3,4); var step = new Array(1,1,1); var idname = new Array('CSSoc','CSEnv','CSEco'); function fadeboxstart(id){ document.getElementById(idname[id]).innerHTML = document.getElementById(idname[id]+""+current[id]).innerHTML; } function fadeboxnext(id){ id = parseFloat(id); step[id] = 1; fadeboxfade(id); } function fadeboxprevious(id){ id = parseFloat(id); step[id] = -1; fadeboxfade(id); } function fadeboxfade(id){ color[id] ++; fadebox = document.getElementById(idname[id]); var opacity = ((100-color[id]))+""; setOpacity(fadebox, opacity); if(color[id] < 100) { runfade= "fadeboxfade(" + id + ")"; setTimeout(runfade, 10); }else{ nextfadebox(id); } } function nextfadebox(id){ current[id] = current[id] + step[id]; if(current[id] > maxfadebox[id])current[id]=1; if(current[id] < 1)current[id] = maxfadebox[id]; document.getElementById(idname[id]).innerHTML = document.getElementById(idname[id]+""+current[id]).innerHTML; fadeboxshow(id); } function fadeboxshow(id){ color[id] --; fadebox = document.getElementById(idname[id]); var opacity = ((100-color[id]))+""; setOpacity(fadebox, opacity); runshow = "fadeboxshow(" + id + ")"; if(color[id] > 0) setTimeout(runshow , 10); } var ie = (document.all) ? 1 : 0; var p = (ie) ? "filter" : "MozOpacity"; function op(n,v){ /* n is the element node v is the opacity value, from 0 to 100. */ v = (ie) ? "alpha(opacity="+v+")" : v/100; n.style[p] = v; } function setOpacity(obj, opacity) { opacity = (opacity == 100)?99.999:opacity; // IE/Win op(obj,opacity); // Safari<1.2, Konqueror obj.style.KHTMLOpacity = opacity/100; // Older Mozilla and Firefox obj.style.MozOpacity = opacity/100; // Safari 1.2, newer Firefox and Mozilla, CSS3 obj.style.opacity = opacity/100; } //************************************************************************ function dot(el){ el.getElementsByTagName('img')[0].src = "skins/media/all/dot.gif"; } function dot_o(el){ el.getElementsByTagName('img')[0].src = "skins/media/all/dot_o.gif"; } function imgvalue(v){ document.getElementById('imgvalues').src = "skins/media/values/"+v+".gif"; } function nav(item){ addClassName(document.getElementById(item),"open"); } function skinGetURL(){ elementID = ''; if ( location.href.indexOf( "/iag/" ) > -1 ) { thisurl = top.location.href.split('/2006/' )[1]; thenav = document.getElementById("nav"); listItems = thenav.getElementsByTagName("li"); var prev = "none" for (i=0; i < listItems.length; ++i) { test = listItems[i].getElementsByTagName("a")[0].href.split('/2006/' )[1] ; if(test == thisurl){ if(prev != "none") { removeClassName(prev,"selected"); } prev = listItems[i]; addClassName(listItems[i],"selected"); } } } } /* Some functions to add and remove ClassNames cleanly - if an element has a className we don't want to overwrite it when we add or remove another className */ function addClassName(obj,newClassName){ if(obj.className==''){ CLname=newClassName; }else{ CLname=obj.className+' '+newClassName; } obj.className=CLname } function removeClassName(obj,ClassName){ if(obj.className=='')return false; flagFound = false; if(obj.className==ClassName){ CLname=''; flagFound = true; }else{ CLnameArray=obj.className.split(" "); aLen=CLnameArray.length; var newClassNames = new Array(); var count = 0; for(var i = 0; i