function createRequestObject(){var a;if(window.XMLHttpRequest){a=new XMLHttpRequest()}else{if(window.ActiveXObject){a=new ActiveXObject("Microsoft.XMLHTTP")}else{alert("Problem creating the XMLHttpRequest object")}}return a}var http=createRequestObject();function handleResponseCountry(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchCountryResults").innerHTML=a}}}function sendRequestCountry(a){http.open("get","selectclub-ajax.php?p="+a);http.onreadystatechange=handleResponseCountry;http.send(null)}function handleResponseClub(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchClubResults").innerHTML=a}}}function sendRequestEnglishChamp(a){http.open("get","selectclub-ajax.php?englishchamp="+a);http.onreadystatechange=handleResponseEnglishChamp;http.send(null)}function handleResponseEnglishChamp(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchEnglishChampResults").innerHTML=a}}}function sendRequestWorldChamp(a){http.open("get","selectclub-ajax.php?worldchamp="+a);http.onreadystatechange=handleResponseWorldChamp;http.send(null)}function handleResponseWorldChamp(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchWorldChampResults").innerHTML=a}}}function sendRequestEuroChamp(a){http.open("get","selectclub-ajax.php?eurochamp="+a);http.onreadystatechange=handleResponseEuroChamp;http.send(null)}function handleResponseEuroChamp(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchEuroChampResults").innerHTML=a}}}function sendRequestGoldChamp(a){http.open("get","selectclub-ajax.php?goldchamp="+a);http.onreadystatechange=handleResponseGoldChamp;http.send(null)}function handleResponseGoldChamp(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchGoldChampResults").innerHTML=a}}}function sendRequestCustomChamp(a){http.open("get","selectclub-ajax.php?custom="+a);http.onreadystatechange=handleResponseCustomChamp;http.send(null)}function handleResponseCustomChamp(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchCustomChampResults").innerHTML=a}}}function sendRequestSpanishChamp(a){http.open("get","selectclub-ajax.php?spanishchamp="+a);http.onreadystatechange=handleResponseSpanishChamp;http.send(null)}function handleResponseSpanishChamp(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchSpanishChampResults").innerHTML=a}}}function sendRequestItalianChamp(a){http.open("get","selectclub-ajax.php?italianchamp="+a);http.onreadystatechange=handleResponseItalianChamp;http.send(null)}function handleResponseItalianChamp(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchItalianChampResults").innerHTML=a}}}function sendRequestGermanChamp(a){http.open("get","selectclub-ajax.php?germanchamp="+a);http.onreadystatechange=handleResponseGermanChamp;http.send(null)}function handleResponseGermanChamp(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchGermanChampResults").innerHTML=a}}}function sendRequestFrenchChamp(a){http.open("get","selectclub-ajax.php?frenchchamp="+a);http.onreadystatechange=handleResponseFrenchChamp;http.send(null)}function handleResponseFrenchChamp(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchFrenchChampResults").innerHTML=a}}}function toggleAll(b){var e=b.checked;var d=document.f1;var a=d.elements.length;var c=0;for(c=0;c<a;c++){if(d.elements[c].name=="emails[]"){d.elements[c].checked=e}}}function toggleCheckAll(){var d=document.f1.checkall.checked;if(d){d=false}else{d=true}var c=document.f1;var a=c.elements.length;var b=0;for(b=0;b<a;b++){if(c.elements[b].name=="emails[]"){c.elements[b].checked=d}}document.f1.checkall.checked=d}function toggleAllfr(b){var e=b.checked;var d=document.f1;var a=d.elements.length;var c=0;for(c=0;c<a;c++){if(d.elements[c].name=="friends[]"){d.elements[c].checked=e}}}function toggleCheckAllfr(){var d=document.f1.checkall.checked;if(d){d=false}else{d=true}var c=document.f1;var a=c.elements.length;var b=0;for(b=0;b<a;b++){if(c.elements[b].name=="friends[]"){c.elements[b].checked=d}}document.f1.checkall.checked=d}function sendRequestCustomChampNoOwner(a){http.open("get","selectclub-ajax.php?customno="+a);http.onreadystatechange=handleResponseCustomChampNoOwner;http.send(null)}function handleResponseCustomChampNoOwner(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchCustomResults").innerHTML=a}}}function sendRequestClub(a){if(a.length>2){http.open("get","selectclub-ajax.php?action=sc&q="+a);http.onreadystatechange=handleResponseClub;http.send(null)}else{document.getElementById("searchClubResults").innerHTML=""}}function handleResponseClub(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("searchClubResults").innerHTML=a}}}var searchClubAjax=new AjaxClass("","select-gameworld-ajax.php","~#~","searchClubLoading");searchClubResponders=[];searchClubResponders.searchClubResults="searchClubResults";searchClubAjax.setResponders(searchClubResponders);var clubTimerRunning=false;function sendRequestSearchClub(a){if(!clubTimerRunning){clubTimerRunning=true;setTimeout(function(){clubTimerRunning=false;var b=document.getElementById("q");if(b){var d=b.value;if(d.length>2){if(document.getElementById("searchClubLoading")){document.getElementById("searchClubLoading").style.display="block"}var c="action=sc&q="+d;searchClubAjax.fire(c)}else{document.getElementById("searchClubResults").innerHTML="";if(document.getElementById("searchClubLoading")){document.getElementById("searchClubLoading").style.display="none"}}}},1000)}}var gwTimerRunning=false;function sendRequestGameWorldName(a){if(!gwTimerRunning){gwTimerRunning=true;setTimeout(function(){gwTimerRunning=false;var c=document.getElementById("gameworldname1");if(c){var b=c.value;if(b.length>3){http.open("get","select-gameworld-ajax.php?action=sgwn&gameworldname="+b);http.onreadystatechange=handleResponseGameWorldName;http.send(null)}else{document.getElementById("GameWorldNameResults").innerHTML=""}}},1000)}}function handleResponseGameWorldName(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){document.getElementById("GameWorldNameResults").innerHTML=a}}}function sendRequestGameWorldNumber(a){var b=document.getElementById("GameWorldNumberResults");if(b){b.innerHTML='<br /><div class="loadingsmall">Loading...</div>'}http.open("get","select-gameworld-ajax.php?action=sgwnum&gameworldnumber="+a);http.onreadystatechange=handleResponseGameWorldNumber;http.send(null)}function handleResponseGameWorldNumber(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a){var b=document.getElementById("GameWorldNumberResults");if(b){b.innerHTML=a}}}}function getScrollXY(){var b=0,a=0;if(typeof(window.pageYOffset)=="number"){a=window.pageYOffset;b=window.pageXOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){a=document.body.scrollTop;b=document.body.scrollLeft}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){a=document.documentElement.scrollTop;b=document.documentElement.scrollLeft}}}return[b,a]}var openClubListAjax=new AjaxClass("","select-gameworld-ajax.php","~#~");var openClubListPopup=new SmPopUp("baseDiv","clublistDiv",openClubListAjax,"basePopupLoading","closeX","300",["adslot_1","adslot_2"]);openClubListPopup.setXOffset(20);openClubListPopup.setWidth(940);openClubListPopup.setHeight(680);openClubListAjax.addCleverResponder(function(b){if(b.clublistDivHead){if(document.getElementById("clublistDivHead")){var a=document.getElementById("clublistDivHead");a.style.width="940px";a.style.height="45px";document.getElementById("clublistDivHead").innerHTML=b.clublistDivHead}}if(b.clublistDivBody){if(document.getElementById("clublistDivBody")){var c=document.getElementById("clublistDivBody");c.style.backgroundColor="#fff";c.style.width="940px";c.style.height="610px";c.style.overflow="auto";document.getElementById("clublistDivBody").innerHTML=b.clublistDivBody}}});function openclublist(f,d){var c=document.getElementById("clubDiv");if(c){clearDivFullSetup(c)}var a=document.getElementById("setupDiv");if(a){clearDivFullSetup(a)}var b="action=clublist&ispop=1&cldid="+f;return openClubListPopup.pop(b,d,"bestfit")}function closeRenewGMPopup(c){var b=document.getElementById("adslot_1");if(b){b.style.display="block"}var a=document.getElementById(c);if(a){a.style.display="none"}}function openRenewGMPopup(e){var b=document.getElementById(e);if(b){var a=getScrollXY();y=a[1]+10;b.style.visibility="visible";b.style.display="block";b.style.position="absolute";b.style.zIndex="300";b.style.padding="5px";b.style.border="1px solid #000";b.style.backgroundColor="#fff";b.style.width="600px";var c=document.getElementById("adslot_1");if(c){c.style.display="none"}http.open("get","select-gameworld-ajax.php?action=remindGM");http.onreadystatechange=function f(){};http.send(null)}}function openreserveclublist(b){var d=260;var j;var e=document.getElementById("baseDiv");if(e){j=e.offsetLeft;j+=20}var f=document.getElementById("clubDiv");if(f){clearDivFullSetup(f)}var a=document.getElementById("setupDiv");if(a){clearDivFullSetup(a)}var i=document.getElementById("adslot_1");if(i){i.style.display="none"}var h=document.getElementById("adslot_2");if(h){h.style.display="none"}var c=document.getElementById("clublistDiv");var l=document.getElementById("clublistDivHead");var g=document.getElementById("clublistDivBody");if(c){var k=getScrollXY();l.innerHTML='<div class="loadingsmall">Loading...</div>';y=k[1]+20;c.style.visibility="visible";c.style.display="block";c.style.position="absolute";c.style.left=j+"px";c.style.top=y+"px";c.style.zIndex="300";c.style.padding="5px";c.style.border="1px solid #000";c.style.backgroundColor="#fff";c.style.width="940px";c.style.height="580px";l.style.visibility="visible";l.style.display="block";l.style.backgroundColor="#fff";l.style.width="940px";l.style.height="30px";y=y+30;g.style.visibility="visible";g.style.display="block";g.style.backgroundColor="#fff";g.style.width="940px";g.style.height="550px";g.style.overflow="auto";http.open("get","select-gameworld-ajax.php?action=reserveclublist&msg="+b);http.onreadystatechange=handleResponseClubListDisplay;http.send(null)}}var openSetupAjax=new AjaxClass("","select-gameworld-ajax.php","~#~");var openSetupPopup=new SmPopUp("baseDiv","setupDiv",openSetupAjax,"basePopupLoading","closeX","300",["adslot_1","adslot_2"]);openSetupPopup.setXOffset(20);openSetupPopup.setWidth(940);openSetupAjax.addCleverResponder(function(b){if(b.setupDivHead){if(document.getElementById("setupDivHead")){var c=document.getElementById("setupDivHead");c.style.width="940px";c.style.height="45px";document.getElementById("setupDivHead").innerHTML=b.setupDivHead}}if(b.setupDivBody){if(document.getElementById("setupDivBody")){var a=document.getElementById("setupDivBody");a.style.backgroundColor="#fff";a.style.width="940px";document.getElementById("setupDivBody").innerHTML=b.setupDivBody}}});var updateSetupAjax=new AjaxClass("","select-gameworld-ajax.php","~#~","popupDivDivisions");var responders=[];responders.setupDivBody="setupDivBody";updateSetupAjax.setResponders(responders);function opensetup(a,d){var c=document.getElementById("clubDiv");if(c){clearDivFullSetup(c)}var b="action=setup&ispop=1&setup="+a;return openSetupPopup.pop(b,d,"below")}var openClubAjax=new AjaxClass("","select-gameworld-ajax.php","~#~");var openClubPopup=new SmPopUp("baseDiv","clubDiv",openClubAjax,"basePopupLoading","closeX","300",["adslot_1","adslot_2"]);openClubPopup.setXOffset(40);openClubPopup.setWidth(940);openClubPopup.setHeight(650);openClubAjax.addCleverResponder(function(b){if(b.clubDivHead){if(document.getElementById("clubDivHead")){var c=document.getElementById("clubDivHead");c.style.width="940px";c.style.height="45px";document.getElementById("clubDivHead").innerHTML=b.clubDivHead}}if(b.clubDivBody){if(document.getElementById("clubDivBody")){var a=document.getElementById("clubDivBody");a.style.backgroundColor="#fff";a.style.width="940px";a.style.height="580px";a.style.overflow="auto";document.getElementById("clubDivBody").innerHTML=b.clubDivBody}}fdTableSort.init(false)});function openclub(a,c,b,f){var d="action=club&ispop=1&clubid="+c+"&sid="+a+"&v="+b;return openClubPopup.pop(d,f,"bestfit")}function takecontrol(a,c,b){var d=document.getElementById("clubDiv");if(d){d.innerHTML='<div class="loadingsmall">Loading...</div>'}http.open("get","select-gameworld-ajax.php?action=takecontrol&clubid="+c+"&sid="+a+"&v="+b);http.onreadystatechange=handleResponsetakecontrolDisplay;http.send(null)}function takejob(a,c,b){var d=document.getElementById("clubDiv");if(d){d.innerHTML='<div class="loadingsmall">Loading...</div>'}http.open("get","select-gameworld-ajax.php?action=takejob&clubid="+c+"&sid="+a+"&v="+b);http.onreadystatechange=handleResponsetakecontrolDisplay;http.send(null)}function apply(a,c,b){var d=document.getElementById("clubDiv");if(d){d.innerHTML='<div class="loadingsmall">Loading...</div>'}http.open("get","select-gameworld-ajax.php?action=apply&clubid="+c+"&sid="+a+"&v="+b);http.onreadystatechange=handleResponsetakecontrolDisplay;http.send(null)}function handleResponsetakecontrolDisplay(){if(http.readyState==4&&http.status==200){var a=http.responseText;if(a>""){var c=a.split("~_~",4);if(c[1]=="SUCCESS"){var b=document.getElementById("clubDiv");if(b){b.innerHTML='<div class="loadingsmall">Success. Loading Club...</div>'}ClubID=c[2];SetupID=c[3];window.location="my-teams.php?action=setclub&clubid="+ClubID+"&sid="+SetupID;return}if(c[1]=="FAIL"){var b=document.getElementById("clubDiv");if(b){b.innerHTML=c[2]}}if(c[1]=="APPLYSUCCESS"){var b=document.getElementById("clubDiv");if(b){b.innerHTML='<div class="loadingsmall">Success. Loading...</div>'}Msg=c[2];window.location="my-home.php?info="+Msg;return}if(c[1]=="APPLYFAIL"){var b=document.getElementById("clubDiv");if(b){b.innerHTML=c[2]}}}}return false}function dehighLightClose(a){var b=document.getElementById(a);if(b){b.src="http://smimgs.com/images/bullets/gif/bg_close1515.gif"}}function highLightClose(a){var b=document.getElementById(a);if(b){b.src="http://smimgs.com/images/bullets/gif/bg_close_highlight1515.gif"}}function clearDiv(a){var b=document.getElementById(a);if(b){b.innerHTML=""}}function submitadvsearch(f){if(!f){f=0}if(f<0){f=0}var d=document.getElementById("advsearchreslist");d.innerHTML='<br /><div class="loadingsmall">Loading...</div>';var e=document.getElementById("advansearch");var c=e.elements.setuptype.value;var b=e.elements.access.value;var a=e.elements.club.value;http.open("get","select-gameworld-ajax.php?action=selectsetuplist&setuptypeid="+c+"&access="+b+"&club="+a+"&offset="+f);http.onreadystatechange=handleResponseSetupTypeList;http.send(null)}function handleResponseSetupTypeList(){if(http.readyState==4&&http.status==200){var b=http.responseText;if(b>""){var a=document.getElementById("advsearchreslist");if(a){a.innerHTML=b}}}}function showFriendsClubs(b){var a=document.getElementById("fnd_"+b);if(a.style.display=="block"){a.style.display="none"}else{http.open("get","select-gameworld-ajax.php?action=showfndclub&fid="+b);http.onreadystatechange=handleResponseShowFriendsClubs;http.send(null)}}function handleResponseShowFriendsClubs(){if(http.readyState==4&&http.status==200){var b=http.responseText;if(b>""){var c=b.split("~_~",2);var a=document.getElementById(c[1]);if(a.style.display=="none"){a.style.display="block"}else{a.style.display="none"}if(a){a.innerHTML=c[0]}}}}function expandDiv(b){var a=document.getElementById(b);if(a.style.display=="none"){a.style.display="block"}else{a.style.display="none"}}function clearDivFullSetup(d){if(document.getElementById(d)){document.getElementById(d).innerHTML='<div id="'+d+'Head"></div><div id="'+d+'Body"></div>';document.getElementById(d).style.visibility="hidden";document.getElementById(d).style.display="none";document.getElementById(d).style.borderStyle="none"}if(d=="clublistDiv"){var a=document.getElementById("setupDiv");if(a){a.innerHTML='<div id="setupDivHead"></div><div id="setupDivBody"></div>';a.style.visibility="hidden";a.style.display="none";a.style.borderStyle="none"}var e=document.getElementById("clubDiv");if(e){e.innerHTML='<div id="clubDivHead"></div><div id="clubDivBody"></div>';e.style.visibility="hidden";e.style.display="none";e.style.borderStyle="none"}}if(d=="setupDiv"){var e=document.getElementById("clubDiv");if(e){e.innerHTML='<div id="clubDivHead"></div><div id="clubDivBody"></div>';e.style.visibility="hidden";e.style.display="none";e.style.borderStyle="none"}}var c=document.getElementById("adslot_1");if(c){c.style.display="block"}var b=document.getElementById("adslot_2");if(b){b.style.display="block"}}function clearDivFullClubList(e){if(document.getElementById(e)){document.getElementById(e).innerHTML='<div id="'+e+'Head"></div><div id="'+e+'Body"></div>';document.getElementById(e).style.visibility="hidden";document.getElementById(e).style.display="none";document.getElementById(e).style.borderStyle="none"}if(e=="clublistDiv"){var a=document.getElementById("setupDiv");if(a){a.innerHTML='<div id="setupDivHead"></div><div id="setupDivBody"></div>';a.style.visibility="hidden";a.style.display="none";a.style.borderStyle="none"}var f=document.getElementById("clubDiv");if(f){f.innerHTML='<div id="clubDivHead"></div><div id="clubDivBody"></div>';f.style.visibility="hidden";f.style.display="none";f.style.borderStyle="none"}}if(e=="setupDiv"){var f=document.getElementById("clubDiv");if(f){f.innerHTML='<div id="clubDivHead"></div><div id="clubDivBody"></div>';f.style.visibility="hidden";f.style.display="none";f.style.borderStyle="none"}}var c=document.getElementById("adslot_1");if(c){c.style.display="block"}var b=document.getElementById("adslot_2");if(b){b.style.display="block"}var d=document.getElementById("searcharea");if(d){d.style.display="block"}}function deleteGMF(b){var a=document.getElementById("gmf_"+b);if(a){a.innerHTML='<br /><div class="loadingsmall">Loading...</div>';http.open("get","myhome-ajax.php?action=deleteGMF&gmfid="+b);http.onreadystatechange=handleResponsedeleteGMF;http.send(null)}}function handleResponsedeleteGMF(){if(http.readyState==4&&http.status==200){var a=http.responseText;a=a.replace("\n","");if(a>""){var b=document.getElementById("gmf_"+a);if(b){b.innerHTML="";b.style.visibility="hidden";b.style.display="none"}}}}function setSetupType(){var c=document.getElementById("setuptype");var b=c.options[c.selectedIndex].value;http.open("get","select-gameworld-ajax.php?action=selectsetupclubs&setuptypeid="+b);http.onreadystatechange=handleResponseSetupType;http.send(null)}function handleResponseSetupType(){if(http.readyState==4&&http.status==200){var b=http.responseText;if(b>""){var a=document.getElementById("setuptypeclublist");if(a){a.innerHTML=b}}}}var sendRequestGameWorldNameAjax=new AjaxClass("","select-gameworld-ajax.php","~#~","setSetupTypeNameLoading");sendRequestGameWorldNameResponders=[];sendRequestGameWorldNameResponders.GameWorldNameResults="GameWorldNameResults";sendRequestGameWorldNameAjax.setResponders(sendRequestGameWorldNameResponders);function sendRequestGameWorldNameNew(a){var c=document.getElementById("gameworldname1");var b=c.value;if(document.getElementById("setSetupTypeNameLoading")){document.getElementById("setSetupTypeNameLoading").style.display="block"}var d="action=sgwn1&setuptypeid="+a+"&name="+b;sendRequestGameWorldNameAjax.fire(d)}var setSetupTypeNameAjax=new AjaxClass("","select-gameworld-ajax.php","~#~","setSetupTypeNameLoading");setSetupTypeNameResponders=[];setSetupTypeNameResponders.gameworldnamesearchbox="gameworldnamesearchbox";setSetupTypeNameAjax.setResponders(setSetupTypeNameResponders);function setSetupTypeNameSearch(){var c=document.getElementById("setuptypenamesearch");var b=c.options[c.selectedIndex].value;var e=document.getElementById("GameWorldNameResults");if(e){e.innerHTML=""}if(document.getElementById("setSetupTypeNameLoading")){document.getElementById("setSetupTypeNameLoading").style.display="block"}var d="action=setuptypenamesearch&setuptypeid="+b;setSetupTypeNameAjax.fire(d)}var myhomeFriendInviterPopup=new SmPopUp("baseDiv","freegm",null,"fpopupload","closeX",null,"adslot_1");myhomeFriendInviterPopup.setXOffset(180);myhomeFriendInviterPopup.setWidth(440);