
var GSMCreator;function getXMLHttpRequest(){if(typeof XMLHttpRequest!='undefined')
{return new XMLHttpRequest();}
try{return new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}return false;}
var http=getXMLHttpRequest();var sessCount=0;var sbm;var ifloaded=false;function wfKeepSession(){http.open("POST","/library/extensions/GSMCreator/keepsession.php?action=load",true);http.setRequestHeader("Content-Type","application/x-www-form-urlencoded");http.onreadystatechange=function(){};data="count="+sessCount;http.send(data);sessCount++;setTimeout("wfKeepSession();",60000);};wfKeepSession();function loadingGSM(){telon=document.getElementById("gLoading");telon.style.display="block";setTimeout("llamarGSM();",2000);}
function unloadingGSM(){telon=document.getElementById("gLoading");telon.style.display="none";}
loadedIFR=function(){ifloaded=true;cs=doc.getElementById('gsmCreatorControls');inps=cs.getElementsByTagName("INPUT");for(var i=0;i<inps.length;i++){inps[i].removeAttribute("disabled");}
if((typeof(gsmAutoLoadCreator)!="undefined")&&(gsmAutoLoadCreator)){llamarGSM();}}
function llamarGSM(){ifr=document.getElementById('GSMCreator');GSMDoc=ifr.contentWindow;if(ifloaded){GSMDoc.startEditing('gml',document,window);ifr.style.position='fixed';ifr.style.top='0px';ifr.style.left='0px';ifr.style.width='100%';ifr.style.height='100%';ifr.style.display='block';hts=document.getElementsByTagName('HTML');hts[0].style.overflow='hidden';}}
function doneEditing(){if((typeof(gsmAutoLoadCreator)!="undefined")&&(gsmAutoLoadCreator)){btn=doc.getElementById("gsmSaveBtn");btn.click();}
ifr=document.getElementById('GSMCreator');ifr.style.position='relative';ifr.style.top='0px';ifr.style.left='0px';ifr.style.width='10px';ifr.style.height='10px';ifr.style.display='none';hts=document.getElementsByTagName('HTML');hts[0].style.overflow='auto';setTimeout("unloadingGSM();",2000);}
function switchCreator(){flag=doc.getElementById('gmlenabled');controls=doc.getElementById('gsmCreatorControls');enabtn=doc.getElementById('reenablebtn');logo=doc.getElementById('showLogo');if(flag.value=="true"){flag.value="false";controls.style.display='none';enabtn.style.display='block';logo.style.display='block';}else{flag.value="true";controls.style.display='block';enabtn.style.display='none';logo.style.display='none';}}
function switchArea(bt){ta=doc.getElementById('gml');if(ta.getAttribute("readonly")=="readonly"){ta.removeAttribute('readonly');ta.setAttribute("enable","true");ta.className="gsmRichMediaEnabled";bt.value='Lock Raw GML';}else{ta.setAttribute("readonly","readonly");ta.setAttribute("enable","false");ta.className="gsmRichMedia";bt.value='Edit Raw GML';}}
sbm=false;window.onbeforeunload=function(){if(sbm==false)
return"You will lose all your unsaved work";}
function saveForm(){sbm=true;return true;}