document.write("<link href=\"http://syahak.tvlplus.net/category-defstyles.css\" rel=\"stylesheet\" type=\"text/css\" />");

pLoadImg = new Image();
pLoadImg.src = "http://syahak.tvlplus.net/img/maplink-hover.jpg";

var cate_id = new Array();
var cate_level = new Array();
var mapwinWidth = "";
var mapwinHeight = "";
cate_id.push("169");
cate_level.push("top");
cate_id.push("175");
cate_level.push("top");
cate_id.push("188");
cate_level.push("top");
cate_id.push("193");
cate_level.push("sub");

function func_init() {
	for (i=0; i<cate_id.length; i++) {
		cate_uid = 'u' + cate_id[i];
		cate_lid = 'l' + cate_id[i];
		document.getElementById(cate_uid).style.display = "none";
		if (cate_level[i] == 'sub') {
			document.getElementById(cate_lid).style.backgroundImage = "url(http://syahak.tvlplus.net/img/category-seclistsub-back.gif)";
		} else {
			document.getElementById(cate_lid).style.backgroundImage = "url(http://syahak.tvlplus.net/img/category-list-back.gif)";
		}
	}
}

function cateShowHide(id) {
	cate_uid = 'u' + id;
	cate_lid = 'l' + id;
	for (i=0; i<cate_id.length; i++) {
		if (cate_id[i] == id) {
			var ic = i;
		}
	}
	if(document.getElementById(cate_uid).style.display == "block"){
		document.getElementById(cate_uid).style.display = "none";
		if (cate_level[ic] == 'sub') {
			document.getElementById(cate_lid).style.backgroundImage = "url(http://syahak.tvlplus.net/img/category-seclistsub-back.gif)";
		} else {
			document.getElementById(cate_lid).style.backgroundImage = "url(http://syahak.tvlplus.net/img/category-list-back.gif)";
		}
	}else{
		document.getElementById(cate_uid).style.display = "block";
		if (cate_level[ic] == 'sub') {
			document.getElementById(cate_lid).style.backgroundImage = "url(http://syahak.tvlplus.net/img/category-seclistopen-back.gif)";
		} else {
			document.getElementById(cate_lid).style.backgroundImage = "url(http://syahak.tvlplus.net/img/category-listopen-back.gif)";
		}
	}
	for (i=0; i<cate_id.length; i++) {
		if (cate_level[ic] == 'sub') {
			if (id != cate_id[i] && cate_level[i] == 'sub') {
				cate_uid = 'u' + cate_id[i];
				cate_lid = 'l' + cate_id[i];
				document.getElementById(cate_uid).style.display = "none";
				document.getElementById(cate_lid).style.backgroundImage = "url(http://syahak.tvlplus.net/img/category-seclist-back.gif)";
			}
		} else {
			if (id != cate_id[i]) {
				cate_uid = 'u' + cate_id[i];
				cate_lid = 'l' + cate_id[i];
				document.getElementById(cate_uid).style.display = "none";
				if (cate_level[i] == 'sub') {
					document.getElementById(cate_lid).style.backgroundImage = "url(http://syahak.tvlplus.net/img/category-seclistsub-back.gif)";
				} else {
					document.getElementById(cate_lid).style.backgroundImage = "url(http://syahak.tvlplus.net/img/category-list-back.gif)";
				}
			}
		}
	}
}

function mapWinOpen(UrlPara) {
	var mapurl = 'http://syahak.tvlplus.net/map/pamap.php';
	if (UrlPara) {
		mapurl += '?' + UrlPara;
	}
	var winname = 'syamap';
	if (mapwinWidth && mapwinHeight) {
		var winoption = "location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no,width=" + mapwinWidth + ",height=" + mapwinHeight + ",top=0,left=0";
	} else {
		var winoption = "location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no";
	}

	window.open(mapurl,winname,winoption);
}


function openWhm(theURL,winName) {
    var i = new Image(); i.src = theURL;
    var pop_win = window.open(
                      "",
                      "_blank",
                      "width="+560+",height="+314+",scrollbars=no,resizable=yes"
                  );
    pop_win.window.document.write(
     '<html>'
    +'<head><title>'+i.alt+'</title></head>'
    +'<body style="margin:0;pading:0;border:0;">'
    +'<a href="javascript:window.close()"><img src="'+i.src+'" border="0" alt="" /></a>'
    +'</body>'
    +'</html>'
    );
}

function openWhh(theURL,winName) {
    var i = new Image(); i.src = theURL;
    var pop_win = window.open(
                      "",
                      "_blank",
                      "width="+800+",height="+450+",scrollbars=no,resizable=yes"
                  );
    pop_win.window.document.write(
     '<html>'
    +'<head><title>'+i.alt+'</title></head>'
    +'<body style="margin:0;pading:0;border:0;">'
    +'<a href="javascript:window.close()"><img src="'+i.src+'" border="0" alt="" /></a>'
    +'</body>'
    +'</html>'
    );
}

function openWthm(theURL,winName) {
    var i = new Image(); i.src = theURL;
    var pop_win = window.open(
                      "",
                      "_blank",
                      "width="+314+",height="+560+",scrollbars=no,resizable=yes"
                  );
    pop_win.window.document.write(
     '<html>'
    +'<head><title>'+i.alt+'</title></head>'
    +'<body style="margin:0;pading:0;border:0;">'
    +'<a href="javascript:window.close()"><img src="'+i.src+'" border="0" alt="" /></a>'
    +'</body>'
    +'</html>'
    );
}

function openW(theURL,winName,features) {
  window.open(theURL,winName,features);
}
