function getXmlHttpObj(){ var xmlhttp; var xmlhttp=false; /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. // and security blocked creation of the objects. try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @end @*/ if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } } return xmlhttp; } function callWebpage(url, method, variables, callback, cookieValue, userContext){ var xmlhttp = getXmlHttpObj(); var div = document.getElementById(getElementFromUserContext(userContext, "content")); if(div) div.innerHTML = ''; if(xmlhttp){ try{ xmlhttp.open(method, url, true); xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded; charset=ISO-8859-1'); if(cookieValue) xmlhttp.setRequestHeader('Cookie', cookieValue); if(callback){ xmlhttp.onreadystatechange = function(){ if(xmlhttp.readyState == 4){ callback(xmlhttp, userContext); } }; } xmlhttp.send(variables); return true; }catch(e){ return false; } }else return false; } function CallbackWithUserContext(sender, userContext){ contentDiv = document.getElementById(getElementFromUserContext(userContext, 'content')); if(contentDiv){ contentDiv.innerHTML = sender.responseText; EvaluateScript(contentDiv); } } function getElementFromUserContext(userContext, element){ var stringArr = userContext.split('&'); for(var i = 0; i < stringArr.length; i++){ var keyValue = stringArr[i].split('='); if(keyValue[0].toLowerCase() == element.toLowerCase()) return keyValue[1]; } return ""; } function checkVariables(hash){ if(hash && hash.substr(0,8) == '#params:'){ hash = hash.substr(8, hash.length-8); var id = getElementFromUserContext(hash, 'id'); var lid = getElementFromUserContext(hash, 'lid'); var template = unescape(getElementFromUserContext(hash, 'template').replace(/\+/g,'%20')); var pagetitle = unescape(getElementFromUserContext(hash, 'pagetitle').replace(/\+/g, '%20')); var sidid = unescape(getElementFromUserContext(hash, 'id').replace(/\+/g, '%20')); callWebpage('/ajax.asp/content/main/template/' + template + '/id/' + id + '/lid/' + lid, 'GET', null, CallbackWithUserContext, null, 'content=main'); callWebpage('/ajax.asp/content/menu/id/' + id, 'GET', null, CallbackWithUserContext, null, 'content=menu'); callFlashMovieClip(pagetitle,sidid,'true'); } } function EvaluateScript(contentDiv){ var scripts = contentDiv.getElementsByTagName("script"); for(var i=0; i < scripts.length; i++){ eval(scripts[i].innerHTML); } } function callFlashMovieClip(clip, sidid, trigger){ var movie = window.document.selma; if (movie != undefined){ movie.SetVariable('sida', clip); movie.SetVariable('sidID', sidid); movie.SetVariable('triggerVar', trigger); } }