/*---------------------------------------------------------- ----------------------------------------------------------*/ var nMaxLen = 80; var flgTest = 0; var strLastSearchId = "lblBrowse"; var strLastDescriptionId = "lblDescNone"; /*---------------------------------------------------------- ----------------------------------------------------------*/ var aryDefCategory = []; aryDefCategory[0] = new setAryCommon("1", "~tv-episodes"); aryDefCategory[1] = new setAryCommon("5", "~daddies&sons"); aryDefCategory[2] = new setAryCommon("7", "~clips"); aryDefCategory[3] = new setAryCommon("9", "~chubbies"); aryDefCategory[4] = new setAryCommon("12", "~hunks"); aryDefCategory[5] = new setAryCommon("17", "~bears"); aryDefCategory[6] = new setAryCommon("19", "~bdsm"); aryDefCategory[7] = new setAryCommon("27", "~grey&older"); aryDefCategory[8] = new setAryCommon("28", "~youngblood"); aryDefCategory[9] = new setAryCommon("29", "~anal"); aryDefCategory[10] = new setAryCommon("30", "~asian"); aryDefCategory[11] = new setAryCommon("31", "~dvd-porn"); aryDefCategory[12] = new setAryCommon("32", "~group-sex"); aryDefCategory[13] = new setAryCommon("33", "~images"); aryDefCategory[14] = new setAryCommon("34", "~fetish"); aryDefCategory[15] = new setAryCommon("35", "~latino"); aryDefCategory[16] = new setAryCommon("36", "~mature"); aryDefCategory[17] = new setAryCommon("37", "~member"); aryDefCategory[18] = new setAryCommon("38", "~military"); aryDefCategory[19] = new setAryCommon("39", "~oral-sex"); aryDefCategory[20] = new setAryCommon("40", "~solo"); aryDefCategory[21] = new setAryCommon("41", "~twinks"); aryDefCategory[22] = new setAryCommon("42", "~vintage"); aryDefCategory[23] = new setAryCommon("43", "~bareback"); aryDefCategory[24] = new setAryCommon("44", "~blacks"); aryDefCategory[25] = new setAryCommon("45", "~themed-movies"); aryDefCategory[26] = new setAryCommon("46", "~anime-games"); aryDefCategory[27] = new setAryCommon("47", "~shemale"); aryDefCategory[28] = new setAryCommon("48", "~comic&yaoi"); aryDefCategory[29] = new setAryCommon("50", "~books&magazines"); aryDefCategory[30] = new setAryCommon("51", "~voyeur"); aryDefCategory[31] = new setAryCommon("52", "~3d"); aryDefCategory[32] = new setAryCommon("53", "~interracial"); aryDefCategory[33] = new setAryCommon("54", "~middle-eastern"); aryDefCategory[34] = new setAryCommon("55", "~dvd-nonporn"); aryDefCategory[35] = new setAryCommon("56", "~softcore"); aryDefCategory[36] = new setAryCommon("57", "~jocks"); aryDefCategory[37] = new setAryCommon("58", "~media-torrent-programs"); aryDefCategory[38] = new setAryCommon("59", "~bisexual"); aryDefCategory[39] = new setAryCommon("60", "~straight-younger"); aryDefCategory[40] = new setAryCommon("61", "~straight-older"); aryDefCategory[41] = new setAryCommon("100", "~modsonly"); var aryNonDVDR = []; aryNonDVDR[0] = "avi"; aryNonDVDR[1] = "asf"; aryNonDVDR[2] = "dat"; aryNonDVDR[3] = "flv"; aryNonDVDR[4] = "m4v"; aryNonDVDR[5] = "mkv"; aryNonDVDR[6] = "mov"; aryNonDVDR[7] = "mp4"; aryNonDVDR[8] = "mpeg"; aryNonDVDR[9] = "mpg"; aryNonDVDR[10] = "ogm"; aryNonDVDR[11] = "rm"; aryNonDVDR[12] = "rmvb"; aryNonDVDR[13] = "wmv"; var aryDVDR = []; aryDVDR[0] = "iso"; aryDVDR[1] = "vob"; var aryBD = []; aryBD[0] = "iso"; aryBD[1] = "m2ts"; var aryRipQuality = []; aryRipQuality[0] = new setAryCommon("(quality)", ""); aryRipQuality[1] = new setAryCommon("BDRip", "bd-rip"); aryRipQuality[2] = new setAryCommon("DVDRip", "dvd-rip"); aryRipQuality[3] = new setAryCommon("CAMRip", "cam-rip"); aryRipQuality[4] = new setAryCommon("ReRip", "re-rip"); aryRipQuality[5] = new setAryCommon("SiteRip", "site-rip"); aryRipQuality[6] = new setAryCommon("Stream", "stream"); aryRipQuality[7] = new setAryCommon("StreamRip", "stream-rip"); aryRipQuality[8] = new setAryCommon("VHSRip", "vhs-rip"); aryRipQuality[9] = new setAryCommon("VODRip", "vod-rip"); aryRipQuality[10] = new setAryCommon("WebDL", "web-dl"); aryRipQuality[11] = new setAryCommon("WebRip", "web-rip"); /*---------------------------------------------------------- ----------------------------------------------------------*/ /*---------------------------------------------------------- ----------------------------------------------------------*/ var aryPornDistributor = []; aryPornDistributor[0] = "Active Duty"; aryPornDistributor[1] = "Bang Bros"; aryPornDistributor[2] = "BarebackRT Media"; aryPornDistributor[3] = "Bel Ami"; aryPornDistributor[4] = "Bijou Video"; aryPornDistributor[5] = "Blake Mason"; aryPornDistributor[6] = "Blue Alley Studios"; aryPornDistributor[7] = "BuenosBoys"; aryPornDistributor[8] = "Butch Dixon"; aryPornDistributor[9] = "Cadinot / French Art"; aryPornDistributor[10] = "Catalina Video"; aryPornDistributor[11] = "Cazzo Film"; aryPornDistributor[12] = "Channel 1 Releasing"; aryPornDistributor[13] = "ChaosMen"; aryPornDistributor[14] = "Citébeur (Citebeur)"; aryPornDistributor[15] = "Clair Production"; aryPornDistributor[16] = "COAT"; aryPornDistributor[17] = "Cobra Video"; aryPornDistributor[18] = "Colt Studio Group"; aryPornDistributor[19] = "Cross"; aryPornDistributor[20] = "Crunchboy"; aryPornDistributor[21] = "CzechHunter"; aryPornDistributor[22] = "Dark Alley"; aryPornDistributor[23] = "Defiance"; aryPornDistributor[24] = "Eric Videos"; aryPornDistributor[25] = "Eurocreme"; aryPornDistributor[26] = "Falcon Studios"; aryPornDistributor[27] = "Flava Works"; aryPornDistributor[28] = "FraternityX"; aryPornDistributor[29] = "Fratmen"; aryPornDistributor[30] = "FratmenSucks"; aryPornDistributor[31] = "Fratpad"; aryPornDistributor[32] = "G@MES"; aryPornDistributor[33] = "Hammer Entertainment"; aryPornDistributor[34] = "Hancock Studios"; aryPornDistributor[35] = "Helix Studios"; aryPornDistributor[36] = "Hot House Entertainment"; aryPornDistributor[37] = "HotMale"; aryPornDistributor[38] = "Jet Set Men"; aryPornDistributor[39] = "Kink.com"; aryPornDistributor[40] = "Kristen Bjorn"; aryPornDistributor[41] = "Lucas Entertainment"; aryPornDistributor[42] = "Lucas Kazan Productions"; aryPornDistributor[43] = "Mecos Films"; aryPornDistributor[44] = "Men at Play"; aryPornDistributor[45] = "Men of Odyssey"; aryPornDistributor[46] = "Menoboy"; aryPornDistributor[47] = "Metabolic"; aryPornDistributor[48] = "Mojo Video"; aryPornDistributor[49] = "Next Door Studios"; aryPornDistributor[50] = "Ninn Worx"; aryPornDistributor[51] = "Nova Studios"; aryPornDistributor[52] = "On The Hunt"; aryPornDistributor[53] = "OTB Video"; aryPornDistributor[54] = "Powerhouse"; aryPornDistributor[55] = "PRISM"; aryPornDistributor[56] = "Puppy Productions"; aryPornDistributor[57] = "Raging Stallion Studios"; aryPornDistributor[58] = "Randy Blue"; aryPornDistributor[59] = "Rascal Video"; aryPornDistributor[60] = "Red Hot"; aryPornDistributor[61] = "Rude Britannia"; aryPornDistributor[62] = "Sean Cody"; aryPornDistributor[63] = "Sk8erboy"; aryPornDistributor[64] = "Stag homme studios"; aryPornDistributor[65] = "Studmall"; aryPornDistributor[66] = "SX Video"; aryPornDistributor[67] = "Third World Media"; aryPornDistributor[68] = "Treasure Island Media"; aryPornDistributor[69] = "Triga Films"; aryPornDistributor[70] = "UKNakedMen.com"; /*---------------------------------------------------------- ----------------------------------------------------------*/ /*---------------------------------------------------------- ----------------------------------------------------------*/ /* functions: initialize */ window.onload = function(){ var dummy; var i; if (!flgTest) { if(navigator.userAgent.indexOf("MSIE") != -1){ // browser: IE // doesn't work //doDisableObjectByClassName("pin"); } else { var anyObj = document.getElementsByClassName("inner"); for (i=0; i aryLang.length) { nIdx--; } return aryLang[nIdx].iso; } /*---------------------------------------------------------- ----------------------------------------------------------*/ function setAryCommon(_disp, _tag) { this.disp = _disp; this.tag = _tag; } /*---------------------------------------------------------- ----------------------------------------------------------*/ function createSelContainer( ){ var selObj = document._form.selContainer; if (document._form.rdVideoTypeDefault.checked) { selObj.length = aryNonDVDR.length; for(var i=0; i < aryNonDVDR.length; i++){ selObj.options[i].text = aryNonDVDR[i]; selObj.options[i].value = aryNonDVDR[i]; } } else if (document._form.rdVideoTypeDVD.checked) { selObj.length = aryDVDR.length; for(i=0; i < aryDVDR.length; i++){ selObj.options[i].text = aryDVDR[i]; selObj.options[i].value = aryDVDR[i]; } } else { selObj.length = aryBD.length; for(i=0; i < aryBD.length; i++){ selObj.options[i].text = aryBD[i]; selObj.options[i].value = aryBD[i]; } } } function createSelRipQuality(){ var selObj = document._form.selRipQuality; selObj.length = aryRipQuality.length for(var i=0; i < aryRipQuality.length; i++){ selObj.options[i].text = aryRipQuality[i].disp; if (i==0){ selObj.options[i].value = ""; } else{ selObj.options[i].value = aryRipQuality[i].disp; } } } function doSwitchMediaType ( ) { //document._form.rdMediaType[nIdx].checked = true; flg = document._form.rdMediaMovie.checked; for (i=0; i<3; i++) { document._form.rdVideoType[i].disabled = !flg; } document._form.selContainer.disabled = !flg; document._form.selMediaEBook.disabled = flg; document._form.selMediaImage.disabled = flg; document._form.selMediaArchive.disabled = flg; document._form.selMediaSoftware.disabled = flg; if (flg) { document._form.selDVD.disabled = !document._form.rdVideoTypeDVD.checked; document._form.selResolution.disabled = !document._form.rdVideoTypeDefault.checked; document._form.selRipQuality.disabled = !document._form.rdVideoTypeDefault.checked; } else { document._form.selDVD.disabled = !flg; document._form.selResolution.disabled = !flg; document._form.selRipQuality.disabled = !flg; } procEntMediaProperty (); } function doSwitchVideoType (rdObj) { createSelContainer(); document._form.selContainer.selectedIndex = 0; document._form.selResolution.selectedIndex = 0; document._form.selRipQuality.selectedIndex = 0; document._form.selDVD.disabled = !document._form.rdVideoTypeDVD.checked; document._form.selResolution.disabled = !document._form.rdVideoTypeDefault.checked; document._form.selRipQuality.disabled = !document._form.rdVideoTypeDefault.checked; procEntMediaProperty(); } function procEntMediaProperty () { if (!document._form.chkEntMediaProperty.checked) { document._form.txtEntMediaProperty.value = "(blank)"; document._form.txtEntTagMediaProperty.value = ""; return; } var strText = "", strTag = ""; aryTmp = ["", "", "", ""]; var nIdx = 0, i; if (document._form.rdMediaMovie.checked) { // movies aryTmp = ["", "", ""]; if (document._form.rdVideoTypeDVD.checked) { aryTmp[0] = getSelectValue(document._form.selDVD); aryTmp[1] = getSelectValue(document._form.selContainer); nIdx = 1; } else if (document._form.rdVideoTypeBD.checked) { aryTmp[0] = document._form.rdVideoTypeBD.value; aryTmp[1] = getSelectValue(document._form.selContainer); nIdx = 1; } else { aryTmp[0] = getSelectValue(document._form.selResolution); aryTmp[1] = getSelectValue(document._form.selRipQuality); aryTmp[2] = getSelectValue(document._form.selContainer); nIdx = 2; } for (i=0; i<3; i++) { if (aryTmp[i] != "") { if (strText != "") { strText += " | "; strTag += " " } strText += aryTmp[i]; switch (i) { case 0: if (document._form.rdVideoTypeBD.checked) { aryTmp[i] = "bd"; } break; case 1: if (document._form.rdVideoTypeDefault.checked) { aryTmp[i] = aryRipQuality[document._form.selRipQuality.selectedIndex].tag; } break; } strTag += "~" + aryTmp[i]; if (i == nIdx) { strTag += "format"; } } } } else { aryTmp[0] = getSelectValue(document._form.selMediaEBook); aryTmp[1] = getSelectValue(document._form.selMediaImage); aryTmp[2] = getSelectValue(document._form.selMediaArchive); aryTmp[3] = getSelectValue(document._form.selMediaSoftware); for (i=0; i<4; i++) { if (aryTmp[i] != "") { if (strText != "") { strText += ", "; } strText += (aryTmp[i]) strTag += " ~" + aryTmp[i] + "format"; } } } document._form.txtEntTagMediaProperty.value = strTag.trim(); document._form.txtEntMediaProperty.value = strText; } /*---------------------------------------------------------- ----------------------------------------------------------*/ function procEntPackInfo () { if (!document._form.chkEntPackInfo.checked) { document._form.txtEntPackInfo.value = "(blank)"; return; } // pack info var strText = ""; var aryNum = []; aryNum[0] = getNumber(document._form.nMovies.value); aryNum[1] = getNumber(document._form.nEpisodes.value); aryNum[2] = getNumber(document._form.nClips.value); aryNum[3] = getNumber(document._form.nExtras.value); aryNum[4] = getNumber(document._form.nPicset.value); var aryTmp = []; aryTmp [0] = "movie"; aryTmp [1] = "episode"; aryTmp [2] = "clip"; aryTmp [3] = "extras"; aryTmp [4] = "picture set"; for (var i=0; i<5; i++) { if (!aryNum[i]) { aryTmp[i] = ""; } else if (aryNum[i] > 1) { if(i < 3) { aryTmp[i] += "s"; } if (i <= 1) { aryTmp[i] = String(aryNum[i]) + " " + aryTmp[i]; } else{ aryTmp[i] = aryTmp[i] + " (" + String(aryNum[i]) + ")"; } } if (aryNum[i]) { if (i && aryNum[i-1]) { strText += " + "; } strText += aryTmp[i]; } else { aryNum[i] = aryNum[i-1]; } } document._form.txtEntPackInfo.value = strText; } /*---------------------------------------------------------- ----------------------------------------------------------*/ function procEntTorrentInfo () { if (!document._form.chkEntTorrentInfo.checked) { document._form.txtEntCriticalTags.value = "(blank)"; document._form.txtEntTorrentInfo.value = ""; return; } var strText = ""; var aryTmp = ["", ""]; var i; // critical tags aryTmp[0] = getCheckBoxValue(document._form.chkCriticalTagsDead); aryTmp[1] = getCheckBoxValue(document._form.chkCriticalTagsMS); aryTmp[2] = getCheckBoxValue(document._form.chkCriticalTagsNG); for(i=0; i<3; i++){ if (aryTmp[i] != "") { if (strText != "") strText += " "; strText += aryTmp[i]; } } document._form.txtEntCriticalTags.value = strText; // torrent info strText = ""; aryTmp[0] = getRadioValue(document._form.rdDateTag); aryTmp[1] = document._form.txtDate.value.trim(); if (!aryTmp[1].match(/^[0-9]{4}-[01]?[0-9]-[0123]?[0-9]$/)) { aryTmp[1] = ""; } if (aryTmp[0] != "" && aryTmp[1] != "" ){ strText += (aryTmp[0] + aryTmp[1]); } // orphaned if (document._form.chkOrphaned.checked) { if (strText != "") { strText += " | "; } strText += document._form.chkOrphaned.value; } document._form.txtEntTorrentInfo.value = strText; } /*---------------------------------------------------------- ----------------------------------------------------------*/ function createSelPornDistributor(){ var selObj = document._form.selPornDistributor; selObj.length = aryPornDistributor.length + 1; selObj.options[0].text = "(porn studios / sites)"; selObj.options[0].value = ""; for(var i=1; i < selObj.length; i++){ selObj.options[i].text = aryPornDistributor[i-1]; selObj.options[i].value = aryPornDistributor[i-1]; } } function createSelDistributor(){ var selObj = document._form.selDistributor; selObj.length = aryMovieDistributor.length + 1; selObj.options[0].text = "(movie distributors)"; selObj.options[0].value = ""; for(var i=1; i < selObj.length; i++){ selObj.options[i].text = aryMovieDistributor[i-1]; selObj.options[i].value = aryMovieDistributor[i-1]; } } function createSelTV(){ var selObj = document._form.selTV; selObj.length = aryTV.length + 1; selObj.options[0].text = "(TV)"; selObj.options[0].value = ""; for(var i=1; i < selObj.length; i++){ selObj.options[i].text = aryTV[i-1]; selObj.options[i].value = aryTV[i-1]; } } function procEntDistribution(){ if (!document._form.chkEntDistribution.checked) { document._form.txtEntDistribution.value = "(blank)"; return; } var strText = ""; aryTmp = []; // distribution - non-porn aryTmp[0] = getSelectValue(document._form.selTV); aryTmp[1] = getSelectValue(document._form.selDistributor); aryTmp[2] = getSelectValue(document._form.selPornDistributor); aryTmp[3] = document._form.txtDistributor.value.trim(); if (aryTmp.join("").length = 0){ document._form.txtEntDistribution.value = ""; return; } strText += aryTmp[0]; if (aryTmp[0] != "" && aryTmp[1] != ""){ strText += " / "; } strText += aryTmp[1]; if ((aryTmp[0] + aryTmp[1]) != "" && aryTmp[2] != ""){ strText += " / "; } strText += aryTmp[2]; if (strText != "" && aryTmp[3] != "") { strText += " / "; } strText += aryTmp[3]; document._form.txtEntDistribution.value = strText; } /*---------------------------------------------------------- ----------------------------------------------------------*/ function doDivOpenClose (btnObj, strID) { if(navigator.userAgent.indexOf("MSIE") != -1){ return; } var anyObj = document.getElementById(strID); if (!anyObj) return false; anyObj.hidden = !(anyObj.hidden); var str = ""; if (anyObj.hidden) { str = "+"; } else { str = "-"; } doLabelOverwrite(btnObj.value, str); } /*---------------------------------------------------------- ----------------------------------------------------------*/ function procChkCategoryGrp( chkObj, nSt, nNum ) { for (var i=nSt; i= nPos && !document._form.chkCategories[i].checked)) { aryCtg.length ++; aryCtg[aryCtg.length-1] = "&c" + document._form.chkCategories[i].value + "=1"; } } } var dummy; if (document._form.chkCategoryMods != dummy && document._form.chkCategoryMods.checked) { aryCtg.length++; aryCtg[aryCtg.length-1] = "&c" + document._form.chkCategoryMods.value + "=1"; } return aryCtg.join(""); } /*---------------------------------------------------------- ----------------------------------------------------------*/ function doJumpToTorrentDetailPage ( strID ) { var strUrl = "https://www.gaytorrent.ru/details.php?id=" + strID + "&filelist=1"; window.open(encodeURI(strUrl)); } /*---------------------------------------------------------- ----------------------------------------------------------*/ function doSearchGoogle() { var strText = document._form.txtSearch.value; strText.trim(); if (strText == ""){ return; } else { var strSite = getRadioValue(document._form.rdSites); window.open("http://www.google.com/search?q=" + encodeURI(strText + " " + strSite)); } return; } /*---------------------------------------------------------- ----------------------------------------------------------*/ function doSwitchEntGrp ( nId ) { var strLabelId = ""; switch (nId) { case 0: // non-porn movies strLabelId = "lblDescNonPorn"; document._form.chkEntTorrentInfo.checked = false; document._form.chkEntLanguage.checked = true; document._form.chkEntSubtitles.checked = true; document._form.chkEntMediaProperty.checked = true; document._form.chkEntDistribution.checked = true; document._form.chkEntPackInfo.checked = true; document._form.chkEntIMDb.checked = true; document._form.rdMediaMovie.checked = true; break; case 1: // porn movies strLabelId = "lblDescPorn"; document._form.chkEntTorrentInfo.checked = false; document._form.chkEntLanguage.checked = false; document._form.chkEntSubtitles.checked = false; document._form.chkEntMediaProperty.checked = true; document._form.chkEntDistribution.checked = true; document._form.chkEntPackInfo.checked = true; document._form.chkEntIMDb.checked = false; document._form.rdMediaMovie.checked = true; break; case 2: // misc strLabelId = "lblDescMisc"; document._form.chkEntTorrentInfo.checked = false; document._form.chkEntLanguage.checked = true; document._form.chkEntSubtitles.checked = false; document._form.chkEntMediaProperty.checked = true; document._form.chkEntDistribution.checked = true; document._form.chkEntPackInfo.checked = true; document._form.chkEntIMDb.checked = false; document._form.rdMediaTypeMisc.checked = true; break; default: strLabelId = "lblDescNone"; document._form.chkEntTorrentInfo.checked = true; document._form.chkEntLanguage.checked = false; document._form.chkEntSubtitles.checked = false; document._form.chkEntMediaProperty.checked = false; document._form.chkEntDistribution.checked = false; document._form.chkEntPackInfo.checked = false; document._form.chkEntIMDb.checked = false; document._form.rdMediaTypeMisc.checked = false; } document._form.rdMediaType[0].disabled = !document._form.rdMediaMovie.checked; document._form.rdMediaType[1].disabled = document._form.rdMediaMovie.checked; //procEntMediaProperty(); doSwitchMediaType(); procEntLanguage(); procEntSubtitles(); procEntDistribution(); procEntPackInfo(); procEntIMDb(); procEntTorrentInfo(); document.getElementById(strLastDescriptionId).style.color = "#5A5A5A"; document.getElementById(strLabelId).style.color = "#CC0000"; strLastDescriptionId = strLabelId; } /*---------------------------------------------------------- ----------------------------------------------------------*/ function procEntDescription () { var strText = ""; // critical tags if (document._form.chkEntTorrentInfo.checked && document._form.txtEntCriticalTags.value.length) { strText += (document._form.txtEntCriticalTags.value + " | "); } // spoken language if (document._form.chkEntLanguage.checked && document._form.txtEntLanguage.value.length) { strText += (document._form.txtEntLanguage.value + " | "); } // subtitles if (document._form.chkEntSubtitles.checked && document._form.txtEntSubtitles.value.length) { strText += ("subs: " + document._form.txtEntSubtitles.value + " | "); } // resolution, quality, container if (document._form.chkEntMediaProperty.checked && document._form.txtEntMediaProperty.value.length) { strText += (document._form.txtEntMediaProperty.value + " | "); } // pack info if (document._form.chkEntPackInfo.checked && document._form.txtEntPackInfo.value.length) { strText += (document._form.txtEntPackInfo.value + " | "); } // distribution if (document._form.chkEntDistribution.checked && document._form.txtEntDistribution.value.length) { strText += (document._form.txtEntDistribution.value + " | "); } // imdb info if (document._form.chkEntIMDb.checked && document._form.txtEntIMDb.value.length) { strText += (document._form.txtEntIMDb.value + " | "); } // torrent info if (document._form.chkEntTorrentInfo.checked && document._form.txtEntTorrentInfo.value.length) { strText += (document._form.txtEntTorrentInfo.value + " |"); } document._form.txtDescription.value = strText.trim(); } /*---------------------------------------------------------- ----------------------------------------------------------*/ function doAddRecycleChr() { var str = "♺ " + document._form.txtSearch.value; if (str.lastIndexOf(" ") == str.length-1){ str = str.substr(0, str.length-1); } document._form.txtSearch.value = str; } function doTextReplaceWithSpace( ) { var strText = document._form.txtSearch.value.trim(); if (!strText.length) return; var strChr = getSelectValue(document._form.selChr); strText = doStrReplaceAll(strText, strChr, " ").trim(); document._form.txtSearch.value = doStrReplaceAll(strText, " ", " "); } function doTextForming( ) { var strText = document._form.txtSearch.value.trim(); if (!strText.length) return; strText = doStrReplaceAll(strText, " ", " "); var aryTmp = strText.split(" "); var str; for (var i=0; i 1) { aryTmp[i] = str.substr(0, 1).toUpperCase() + str.substr(1, str.length-1).toLowerCase(); } } strText = aryTmp.join(" "); document._form.txtSearch.value = strText.trim(); } /*---------------------------------------------------------- ----------------------------------------------------------*/ function getCheckBoxValue( chkObj ) { if (!chkObj.checked) return "" return chkObj.value; } function getRadioValue( rdObj ){ for (var i=0; i= 2 && str.indexOf("--") != -1) return ""; //return str; return selObj.options[index].value; } /*---------------------------------------------------------- ----------------------------------------------------------*/ function doTextAreaSelect( strID ){ txtObj = document.getElementById (strID); if (!txtObj) return; txtObj.focus(); txtObj.select(); } function doDisableObjectByClassName( strClassName ) { var anyObj = document.getElementsByClassName(strClassName); for (var i=0; i= 0){ strText = strText.split(strOrg).join(strDest); } return strText.trim(); } /*---------------------------------------------------------- ----------------------------------------------------------*/ function getTagOfCategory(strNo) { var str = ""; for(var i=0; i= 0){ strTmp = strTmp.substr(0, nEd); } if (strTmp == strTag && strTmp.length == strTag.length){ return nIdx; } nIdx += (nSt + strTmp.length); strOrg = strOrg.substr(nIdx); } return -1; } function procEntTag ( nId ) { var nSt =0, nLength = 0; var strText = ""; var txtObj; var i; var nPos = [85, 67, 65]; switch (nId) { case 0: nSt = 0; nLength = document._form.chkCommonTags1.length; txtObj = document._form.txtTag; break; case 1: nSt = 0; nLength = nPos[0]; txtObj = document._form.txtEntTag1; break; case 2: nSt = nPos[0]; nLength = nPos[1]; txtObj = document._form.txtEntTag2; break; case 3: nSt = nPos[0] + nPos[1]; nLength = nPos[2]; txtObj = document._form.txtEntTag3; break; case 4: nSt = nPos[0] + nPos[1] + nPos[2]; nLength = document._form.chkCommonTags1.length-nSt; txtObj = document._form.txtEntTag4; break; default: // category for (i=0; i= 1) { txtObj.value = strText.trim(); return; } var strBuff = strText; var aryTmp = ["", "", ""]; //if (document._form.chkEntTagCategory) aryTmp[0] = document._form.txtEntTagCategory.value; var dummy; if (document._form.chkCategoryMods != dummy) { if (document._form.chkEntMediaProperty.checked) aryTmp[1] = document._form.txtEntTagMediaProperty.value; if (document._form.chkEntLanguage.checked) aryTmp[2] = document._form.txtEntTagLanguage.value; } for (i=0; i<3; i++) { if (aryTmp[i] != ""){ strBuff += aryTmp[i] + " "; } } strBuff = strBuff.trim(); // additional tags strText = document._form.txtTag.value.toLowerCase(); strText = doStrReplaceAll(strText, " ", " "); strText = doStrReplaceAll(strText, "~", ","); strText = doStrReplaceAll(strText, "\t", ","); strText = doStrReplaceAll(strText, "\n", ","); aryTmp = strText.split(","); strText = ""; nLength = 0; for (i=0; i= 2){ str = "~" + str; if (getTagIndex(strText, str) < 0 && getTagIndex(strBuff, str) < 0){ // no duplicate if (strText != ""){ if ((nLength + str.length) > nMaxLen){ strText += "\n"; nLength = 0; } else { strText += " "; nLength++; } } strText += str; nLength += str.length; } } } aryTmp = (strBuff + " " + strText).trim().split(" "); strBuff = ""; strText = ""; for (i=0; i nMaxLen && i < aryTmp.length-1) { if (strBuff != "") { strBuff += "\n"; } strBuff += strText.trim(); strText = ""; } strText += aryTmp[i] + " "; } if (strBuff != "") { strBuff += "\n"; } strBuff += strText.trim(); document._form.txtTag.value = strBuff.trim(); }