Daum - 카페
function changeCurrentLinkStyle() {
var res = null;
var pathname = location.pathname;
if (pathname.indexOf("/_cafeteria/cafeteria_") >= 0) {
res = /_cafeteria\/cafeteria_([^\.]*)/.exec(pathname);
} else if (pathname.indexOf("/_cafefocus/") >= 0) {
res = /_cafefocus\/([^\.]*)/.exec(pathname);
if (res != null) {
var id = res[1];
if (id.indexOf("cafefocus_list") >= 0) {
var link = document.getElementById("focus");
if (link != null) link.style.color = '#F00F4C';
}
}
} else if (pathname.indexOf("/_event/") >= 0) {
var link = document.getElementById("event");
if (link != null) link.style.color = '#F00F4C';
} else if (pathname.indexOf("/_bbs/") >= 0) {
res = /_bbs\/(.{5})\//.exec(pathname);
if (res != null) {
var fldid = res[1];
if (fldid.indexOf("best") >= 0) {
var link = document.getElementById("best");
if (link != null) link.style.color = '#F00F4C';
} else if (fldid.indexOf("0000a") >= 0) {
var link = document.getElementById("qna");
if (link != null) link.style.color = '#F00F4C';
} else if (fldid.indexOf("toppt") >= 0 || fldid.indexOf("00pto") >= 0) {
var link = document.getElementById("photo");
if (link != null) link.style.color = '#F00F4C';
}
}
}
if (res != null) {
var link = document.getElementById(res[1]);
if (link != null) link.style.color = '#F00F4C';
}
}
function chop(str, length, endstr) {
var strLength = 0;
var retstr = "";
for ( var i = 0; i < str.length ; i++) {
if (escape(str.charAt(i)).length > 3) {
strLength +=2;
if (strLength > length) {
retstr = retstr+endstr;
break;
}
retstr+= str.charAt(i);
} else {
strLength++;
if (strLength > length) {
retstr = retstr+endstr;
break;
}
retstr += str.charAt(i);
}
}
return retstr;
}
function submitForm() {
document.search.submit();
}
function onTab(tab_name){
var img_url=tab_name.src;
var url_length;
url_length=img_url.length;
url_length=url_length-5;
img_url=img_url.substr(0,url_length);
tab_name.src=img_url+"2.gif";
}
function outTab(tab_name){
var img_url=tab_name.src;
var url_length;
url_length=img_url.length;
url_length=url_length-5;
img_url=img_url.substr(0,url_length);
tab_name.src=img_url+"1.gif";
}
function go_url(move)
{
location.href=move.value;
}