
$(document).ready(function() {
	$("#prflPerusahaan").bind("click",prflService);
	$("#prflSDM").bind("click",prflService);
	$("#prflAfiliasi").bind("click",prflService);
	$("#prflProduk").bind("click",prflService);
	$("#prflLayanan").bind("click",prflService);
	$("#prflRencKerja").bind("click",prflService);
});

function menuPrflPerusahaan()
{
//        prfl_modules("s01","prfl");
	prfl_modules("s21","prfl","");

}

function menuPrflSDM()
{
//        prfl_modules("s02","prfl");
prfl_modules("s22","prfl","");
}

function menuPrflAfiliasi()
{
//        prfl_modules("s03","prfl");
prfl_modules("s23","prfl","");
}

function menuPrflProduk()
{
//        prfl_modules("s04","prfl");
prfl_modules("s24","prfl","");
}

function menuPrflLayanan()
{
//        prfl_modules("s05","prfl");
prfl_modules("s25","prfl","");
}

function menuPrflRencKerja()
{
//        prfl_modules("s06","prfl");
prfl_modules("s26","prfl","");
}


//-------------------- modul bursa (Ajax) -------------------------------------------------------------------------------------

function prfl_modules (svr,idreg,nametitle) {	
var fopts ="";
var showsfilters="";
var judul = nametitle; 
//var judul =getJudul(idreg);
fopts = { id: "prfl" };			
		  var url  = "modules/";	
		  var pctgr = function() {
			$("#prflPerusahaan").bind("click",prflService);
			$("#prflSDM").bind("click",prflService);
			$("#prflAfiliasi").bind("click",prflService);
			$("#prflProduk").bind("click",prflService);
			$("#prflLayanan").bind("click",prflService);
			$("#prflRencKerja").bind("click",prflService);
		  }

		  var options = {title : judul,url: "modules/",filterOptions : fopts, id : idreg , postCtgr : pctgr, showfilter: false};
		  var pars = {id: idreg, svr: svr};
		  Container.displayOnView(options,pars,function( ) {
			$("#prflPerusahaan").bind("click",prflService);
			$("#prflSDM").bind("click",prflService);
			$("#prflAfiliasi").bind("click",prflService);
			$("#prflProduk").bind("click",prflService);
			$("#prflLayanan").bind("click",prflService);
			$("#prflRencKerja").bind("click",prflService);
			$("a[@class=windowOpen1]").bind("click",prflImg);
	});
profileTop();
}

function prflService (event) {
	var svr = $(this).attr("svr");
	var idreg = $(this).attr("idreg");
	var nametitle = $(this).attr("nametitle");

	prfl_modules(svr,idreg,nametitle);	
}

function profileTop () {
	var svr ="s400";
	var idreg ="prfl";
	var url = 'modules/?';
	var pars = 'id='+idreg+'&svr='+svr ;
	$.get(url,pars, function (data) {
		$("#cont-submenu").css("display","none");
		//$("#cont-filter").html(data);
	    $("#cont-submenu").html(data);
		$("#cont-submenu").show();
		$("#prflPerusahaan").bind("click",prflService);
		$("#prflSDM").bind("click",prflService);
		$("#prflAfiliasi").bind("click",prflService);
		$("#prflProduk").bind("click",prflService);
		$("#prflLayanan").bind("click",prflService);
		$("#prflRencKerja").bind("click",prflService);
});		
}

function prflImg (event) {
	
	var svr = $(this).attr("svr");
	var idreg = $(this).attr("idreg");
	var idimg = $(this).attr("idimg");

	var url = 'modules/';
	swin = window.open(url+"?id="+idreg+"&idreg="+idreg+"&svr="+svr+"&idimg="+idimg,'win','scrollbars,width=900,height=700,top=100,left=75');
	swin.focus();
}

function reportError(request)	{
	alert('Sorry. There was an error.');
}