//var iframeNames=new Array("demo1.html","demo2.html", "demo3.html", "brainjar.html", "layout3.html"); var iframeNames=new Array("demo1.html","demo2.html", "demo3.html"); var iframeTitles=new Array('Introduction', 'Adding cookies', 'The end'); var hasScript=new Array(); var iframeLoaded=new Array(); var iframeIds=new Array(); var currentFrame; var current; var iframeNode; var loadEvent = Getter.browserType?'load':'onload'; function createIFrameNode(){ iframeNode = document.createElement('iframe'); iframeNode.style.display="none"; iframeNode.style.width="100%"; iframeNode.style.height="530px"; //Mozilla doesnt support % for height? if(Getter.browserType != 1) { iframeNode.style.height = "80%"; } iframeNode.style.padding="0px"; iframeNode.style.margin="0px"; } createIFrameNode(); function cloneIFrameNode(){ return iframeNode.cloneNode(true); } function none(){ } function generateDemos(){ for(var i=0; i < iframeNames.length; i++){ var a=document.createElement('A'); a.className = 'faq'; a.id='demo' + i; a.innerHTML =iframeTitles[i]; a.index=i; a.onmouseover=function(){ setTitle(this.index); } a.href = "javascript:link(" + i + ");"; a.title = 'Click to ' + (i?'select ':'transform '); var al=document.getElementById('navAlpha1'); al.appendChild(a); if(i == iframeNames.length - 1) break; var h=document.createElement('HR'); al.appendChild(h); } } function refreshIframe(){ //some strange bug in IE. The content of the iframe becomes invisible. if(navigator.userAgent.indexOf('MSIE') != -1) { var w=currentFrame.currentStyle.width; var h=currentFrame.currentStyle.height; currentFrame.style.width=currentFrame.parentNode.offsetWidth; currentFrame.style.width=w; } } function createMovingScript(frameDocument){ var movingScript = frameDocument.createElement('SCRIPT'); movingScript.src = "../cgi-bin/getscript.cgi?src=moving2"; return movingScript; } function addMovingScript(no) { if(hasScript[no]) return; var frameDocument = Getter.browserType != 2 ? iframeIds[no].contentWindow.document:iframeIds[no].contentDocument; var sc = createMovingScript(frameDocument); sc.id='vasile'; frameDocument.body.appendChild(sc); hasScript[no] = true; } function loadIFrame(no){ var demoFrame = document.getElementById('demoFrame'); if(no >= iframeNames.length) return null; var thisNode = cloneIFrameNode(); if(!thisNode.addEventListener) //IE has its own ways... thisNode.addEventListener=thisNode.attachEvent; var nom=no; iframeIds[no] = thisNode; thisNode.src = iframeNames[no]; demoFrame.appendChild(thisNode); if(no) if(Getter.browserType != 2) thisNode.addEventListener(loadEvent, function() { iframeLoaded[nom]=true; link(nom); },true); else { setTimeout(function() { iframeLoaded[nom] = true; link(nom);}, 500); } return thisNode; } function createFirstIFrame() { var thisNode = loadIFrame(0); currentFrame = thisNode; current = 0; var load=function(ev){ currentFrame.style.display="block"; //addMovingScript(0); //Opera7 cant handle added scripts :( refreshIframe(); showInfo(0); currentFrame.onload=null; iframeLoaded[0]=true; } if(Getter.browserType != 2) currentFrame.addEventListener(loadEvent, load, true); else { currentFrame.style.display="block"; iframeLoaded[0]=true; setTimeout(function(){showInfo(0);},500); } } function loadOtherIframes() { for(var i = 1; i < iframeNames.length; i++) { var thisNode = loadIFrame(i); thisNode.i = i; if( Getter.browserType == 1) { thisNode.onload = function() { //addMovingScript(this.i); this.onload=null; } } } } function loadAllIframes() { createFirstIFrame(); setTimeout("loadOtherIframes()", 1000); } var loading; function isLoaded(){ } function link(n){ var a = document.getElementById('demo' + n); if( !iframeLoaded[n]){ loadIFrame(n); return; } if(currentFrame == iframeIds[n]){ var Document = Getter.browserType != 2?iframeIds[n].contentWindow.document:iframeIds[n].contentDocument; if(cont) delete cont; var cont = Getter.browserType != 2?currentFrame.contentWindow.container:currentFrame.contentDocument.defaultView.container; var wrapper; if(cont && Document.getElementById(cont)) wrapper = Document.getElementById(cont).__getWrapperContainer; else wrapper = Document.body.__getWrapperContainer; if(wrapper != null){ wrapper().restore(); a.title='Click to transform '; } else { a.title='Click to restore '; var contWindow = Getter.browserType != 2?currentFrame.contentWindow:currentFrame.contentDocument.defaultView; var cont = contWindow.container; var useCookies = contWindow.useCookies; if(cont) { contWindow.MoveContainer(Document.getElementById(cont),useCookies); } else contWindow.MoveContainer(Document.body, useCookies); } } else{ a.title = 'Click to ' + (wrapper == null?'transform ':'restore '); currentFrame.style.display="none"; iframeIds[n].style.display='block'; currentFrame = iframeIds[n]; var aa = document.getElementById('demo' + current); aa.style.fontColor = 'black'; a.style.fontColor = 'blue'; current = n; if(Getter.browserType != 2) { showInfo(n); } else { setTimeout(function() {showInfo(n);},200); //Opera fix } } } function showInfo(index){ var disp = document.getElementById('display'); var a = document.getElementById('demo' + index); a.style.fontStyle='italic'; var contWindow = Getter.browserType != 2? iframeIds[index].contentWindow: iframeIds[index].contentDocument.defaultView; if(!contWindow) return; disp.innerHTML = '
' + contWindow.description+ '
'; } function setTitle(index){ var a = document.getElementById('demo' + index); if(currentFrame != iframeIds[index]){ a.title='Click to select '; } } function setTop(id1, id2, margin){ var d1 = document.getElementById(id1); document.getElementById(id2).style.top = d1.offsetTop + d1.offsetHeight + margin + 'px'; }