var subpic = 0; var chatStatusCode = "0"; var allowUpdateOfChat = true; var allowUpdateOfUsers = true; var doskey = new Array(); doskey[0]=""; var doskeyCounter = 0; var doskeyMax = 0; var doskeyTab = 1; var fullOrAdd = 3; var spanHolder = ""; var selectedMoodIcon = 0 var lastpage="" var subpic = "0"; var currentUser = 0 var effectVolume = 3; var effectEffect = 1; var menuopen = false; function doCancel(UserID) { document.getElementById('idright').innerHTML=lastPage; lastPage=""; } function doOk(UserID) { opener.makeRequestx('/community/updateImageEffect.asp?SetProfile=true&Effect='+effectEffect+'&Volume='+effectVolume+'&subpic='+subpic, 'propic', 0); } function doApply(UserID) { makeRequestx('/community/updateImageEffect.asp?Apply=true&Effect='+effectEffect+'&Volume='+effectVolume+'&subpic='+subpic, 'applyID', 0); } function updateProfileImageEffect(UserID) { for (var i=0; i < document.effectform.grp.length; i++) { if (document.effectform.grp[i].checked){ effectEffect = document.effectform.grp[i].value; } } makeRequestx('/community/updateImageEffect.asp?DoEffect=true&Effect='+effectEffect+'&Volume='+effectVolume+'&subpic='+subpic,'imagePreview',947582) document.getElementById('applyID').innerHTML = "
Apply" } function updateProfileImage(UserID) { document.getElementById('imagePreview').innerHTML = '' } function updateFormImage(userid) { document.getElementById('picHolder2').innerHTML=''; if (parent.document.getElementById('proheadline')) parent.document.getElementById('proheadline').style.visibility='visible'; } function showStandardProfileImage(nr) { subpic = nr; document.getElementById('picHolder2').innerHTML=''; if (parent.document.getElementById('proheadline')) parent.document.getElementById('proheadline').style.visibility='visible'; } function icon(iconid) { selectedMoodIcon = iconid; document.getElementById('moodiconholder').innerHTML = '' } var http_request4 = false; function makeRequest4(url) { http_request4 = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... http_request4 = new XMLHttpRequest(); if (http_request4.overrideMimeType) { http_request4.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE try { http_request4 = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request4 = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request4) { alert('Giving up :( Cannot create an XMLHTTP instance'); return false; } http_request4.onreadystatechange = alertContents4; bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime() http_request4.open('GET', url+bustcacheparameter, true); http_request4.send(null); } function alertContents4() { if (http_request4.readyState == 4) { if (http_request4.status == 200) { //parent.document.getElementById('Element').innerHTML = http_request4.responseText; } else { alert(http_request4.responseText); alert('There was a problem with the request.'); } } } function saveProfile(nr){ if (nr==1) { var tname = document.getElementById('Tname').value; var temail = document.getElementById('Temail').value; var tpassword = document.getElementById('Tpassword').value; var tage = document.getElementById('Tage').value; var tgender; for (var i=0; i < document.proform.grp1.length; i++) { if (document.proform.grp1[i].checked){ tgender = document.proform.grp1[i].value; } } makeRequestx('/community/EditUserData.asp?Save=yes&View=1&tname='+tname+'&temail='+temail+'&tpassword='+tpassword+'&tage='+tage+'&tgender='+tgender,'proarea1',0) } if (nr==2) { var tlocation = document.getElementById('tlocation').value; var tcountry = document.getElementById('tcountry').value; makeRequestx('/community/saveGeoData.asp?Location='+escape(tlocation)+'&Country='+escape(tcountry),'',2); makeRequestx('/community/EditUserData.asp?Save=yes&View=2&tlocation='+tlocation+'&tcountry='+tcountry,'proarea2',0) } if (nr==3) { var tmood = document.getElementById('tmood').value; var tmoodicon = selectedMoodIcon; makeRequestx('/community/EditUserData.asp?Save=yes&View=3&tmood='+escape(tmood)+'&tmoodicon='+tmoodicon,'',2) showProfileChange(); } } function profileClick(nr) { spanHolder = document.getElementById('proarea1').innerHTML; if (nr == 1) { menuopen = false; document.getElementById('proarea2').innerHTML=''; makeRequestx('/community/EditUserData.asp?View=1','proarea1',0); } if (nr==2) { menuopen = false; document.getElementById('proarea2').innerHTML=''; document.getElementById('row2').style.visibility='hidden'; document.getElementById('row3').style.visibility='hidden'; document.getElementById('row4').style.visibility='hidden'; document.getElementById('proarea2').style.top='-135'; //document.getElementById('proarea1').style.bottom='240'; makeRequestx('/community/EditUserData.asp?View=2','proarea2',0); } if (nr==3) { menuopen = false; document.getElementById('proarea2').innerHTML=''; document.getElementById('row3').style.visibility='hidden'; document.getElementById('row4').style.visibility='hidden'; document.getElementById('proarea2').style.top='-120'; makeRequestx('/community/EditUserData.asp?View=3','proarea2',0); } if (nr==4) { makeRequest4('/community/EditUserData.asp?Save=yes&View=4&tdescription='+escape(document.getElementById('tdescription').value)) document.getElementById('chatformcontent').innerHTML = ""; restoreSpace(); } } function reloadChat() { // makeRequestxChat('/community/UpdateChat.asp?GetLatest=yes&StatusCode='+chatStatusCode+'&Total='+fullOrAdd+'&rnd='+Math.random(),'none',fullOrAdd); // if (allowUpdateOfUsers) makeRequestUsers('/community/UpdateChat.asp?Userlist=yes&StatusCode='+chatStatusCode+'&rnd='+Math.random(),'none',4); // makeRequestRooms('/community/UpdateChat.asp?Roomlist=yes&StatusCode='+chatStatusCode+'&rnd='+Math.random(),'none',5); // fullOrAdd = 4; makeUpdateRequest('/community/UpdateChat.asp?StatusCode='+chatStatusCode); } function initChat() { UpdateFunc = reloadChat; UpdateFreq = 3000; reloadChat(); // setTimeout("initChat()", 3000); } function makeSpace1(){ document.getElementById('ifr').style.height=document.body.clientHeight-220; ifr.scrollBy(0,5000) document.getElementById('ifrusers').style.height=document.body.clientHeight-220; } function makeSpace2(){ document.getElementById('ifr').style.height=document.body.clientHeight-263; ifr.scrollBy(0,5000) document.getElementById('ifrusers').style.height=document.body.clientHeight-263; } function makeSpace3(){ document.getElementById('ifr').style.height=document.body.clientHeight-358; ifr.scrollBy(0,5000) document.getElementById('ifrusers').style.height=document.body.clientHeight-358; } function restoreSpace(){ menuopen = false; document.getElementById('ifr').style.height=document.body.clientHeight-180; ifr.scrollBy(0,5000) document.getElementById('ifrusers').style.height=document.body.clientHeight-180; } function insertAtCursor(myField, myValue) { if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = myValue; } else if (myField.selectionStart || myField.selectionStart == '0') { var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length); } else { myField.value += myValue; } } function iicon(str) { insertAtCursor(txtid, str) document.getElementById('chatformcontent').innerHTML = ""; restoreSpace(); } function chatIcons(IconStr) { if (!menuopen) { document.getElementById('chatformcontent').innerHTML = IconStr; menuopen = true } else { document.getElementById('chatformcontent').innerHTML = ""; restoreSpace(); } } function showPhotoHolder(idfelt,userid,addextra) { if (!menuopen) { var extrastr; extrastr = "
"; if (addextra) extrastr = extrastr + "Upload another image"; document.getElementById(idfelt).innerHTML = extrastr; menuopen = true } else { document.getElementById('chatformcontent').innerHTML = ""; restoreSpace(); } } function showProfileChange() { if (!menuopen) { var str1 = "
" document.getElementById('chatformcontent').innerHTML = str1; makeRequestx('/community/EditChatProfile.asp', 'innerform', 0) menuopen = true } else { document.getElementById('chatformcontent').innerHTML = ""; restoreSpace(); } } function kobieDOSKey(event) { //k = event.keyCode; if (!event) event=window.event; k = event.keyCode ? event.keyCode : event.which; if (k == 13) { //Enter // makeRequestxChat('/community/Updatechat.asp?WriteLine='+escape(document.getElementById("txtid").value)+'&picID='+subpic,'none',4) makeUpdateRequest('/community/Updatechat.asp?WriteLine='+escape(document.getElementById("txtid").value)+'&picID='+subpic) subpic=0; document.getElementById('chatformcontent').innerHTML = ""; doskeyMax = doskeyMax +1; doskey[doskeyMax] = document.getElementById("txtid").value; doskeyCounter = doskeyMax+1; document.getElementById("txtid").value = ""; restoreSpace(); } if (k == 38) { //Up if (doskeyCounter > 0) doskeyCounter = doskeyCounter -1; document.getElementById("txtid").value = doskey[doskeyCounter]; // return false; } if (k == 40) { //Down if (doskeyCounter < doskeyMax) { doskeyCounter = doskeyCounter +1; document.getElementById("txtid").value = doskey[doskeyCounter]; } // return false; } if (k == 9) { //Tab } } function CheckChatStatus() { // sætter chatstatus, så der kan informeres om at en bruger skriver i chatten if (document.getElementById('txtid').value != "") { chatStatusCode="1"; } else { chatStatusCode="0"; } } function chatContentReceived() { //alert('Chat received!') ifr.scrollTo(0,5000) ifr.scrollTo(0,5000) ifr.scrollTo(0,5000) //ifr.scrollBy(0,maxlen-2) //ifr.scrollBy(0,maxlen) } function sendPic(pic) { makeUpdateRequest('/community/Updatechat.asp?WriteLine=%20&picID='+pic); subpic=0; document.getElementById('chatformcontent').innerHTML = ""; restoreSpace(); } function picSelected(pic) { if (pic==-1) { if (parent.document.getElementById('picHolder1')) parent.document.getElementById('picHolder1').innerHTML = parent.picHolder; if (parent.document.getElementById('picHolder2')) parent.document.getElementById('picHolder2').innerHTML = ''; picHolderHere = false; parent.subpic = 0; if (parent.document.getElementById('proheadline')) parent.document.getElementById('proheadline').style.visibility='hidden'; if (parent.document.getElementById('effecttable')) parent.document.getElementById('effecttable').style.visibility='hidden'; } else { if (parent.document.getElementById('proheadline')) parent.document.getElementById('proheadline').style.visibility='visible'; parent.subpic = pic; parent.picHolder = parent.document.getElementById('picHolder1').innerHTML; if (parent.document.getElementById('picHolder2')) parent.document.getElementById('picHolder2').innerHTML = "" if (parent.document.getElementById('picHolder1')) parent.document.getElementById('picHolder1').innerHTML = "
 T_Delete image
 Undo
" } } function initPrivatChat(userGUID) { document.getElementById('ichatUser'+userGUID).innerHTML = ""; document.getElementById('userArea'+userGUID).style.border = ""; parent.makeUpdateRequest("/community/Updatechat.asp?PrivateChat="+userGUID) parent.allowUpdateOfUsers = true; } function initIgnore(userID) { parent.makeUpdateRequest("/community/Updatechat.asp?Ignore="+userID); document.getElementById('ichatUser'+userID).innerHTML = ""; document.getElementById('userArea'+userID).style.border = ""; parent.allowUpdateOfUsers = true; } function initUnIgnore(userID) { parent.makeUpdateRequest("/community/Updatechat.asp?UnIgnore="+userID); document.getElementById('ichatUser'+userID).innerHTML = ""; document.getElementById('userArea'+userID).style.border = ""; parent.allowUpdateOfUsers = true; } function initFriendship(userID) { document.getElementById('ichatUser'+userID).innerHTML = ""; document.getElementById('userArea'+userID).style.border = ""; parent.makeUpdateRequest("/community/Updatechat.asp?Friendship="+userID) parent.allowUpdateOfUsers = true; } function initUnFriendship(userID) { document.getElementById('ichatUser'+userID).innerHTML = ""; document.getElementById('userArea'+userID).style.border = ""; parent.makeUpdateRequest("/community/Updatechat.asp?UnFriendship="+userID) parent.allowUpdateOfUsers = true; } function acceptFriendInvitation(fromID, toID) { parent.makeUpdateRequest("/community/Updatechat.asp?AcceptFriendInvitation="+fromID); } function expandChatUser(userGUID,ignoring,IsFriend) { if (parent.allowUpdateOfUsers) { var str = "

Private
"; if (IsFriend) { str += "
Remove friend
"; } else { str += "
Friend
"; } str += ""; if (ignoring) { str += "
Unignore
" } else { str += "
Ignore
" } str += "

"; document.getElementById('ichatUser'+userGUID).innerHTML = str; document.getElementById('userArea'+userGUID).style.border = "1px solid #d0C0A0"; parent.allowUpdateOfUsers = false; } else { document.getElementById('ichatUser'+userGUID).innerHTML = ""; document.getElementById('userArea'+userGUID).style.border = ""; parent.allowUpdateOfUsers = true; } }