function deleteRecord(sLabel, sURL) {
	bConfirm = confirm('Are you sure you want to delete this ' + sLabel + '?')
	if (bConfirm) {
		if (bConfirm != null) {
			window.open(sURL,'_self');
		}
	}
	
}

function deleteRecordWAction(sFormName, sActionPath, sLabel) {

	bConfirm = confirm('Are you sure you want to delete this ' + sLabel + ' ?');
	if (bConfirm) {
		if (bConfirm != null) {
			eval('document.'+sFormName+'.sOpenerURL.value = self.location;');
			eval('document.'+sFormName+'.action = "'+sActionPath+'";');
			eval('document.'+sFormName+'.submit();');
		}
	}
}

function openwin(winURL, winName, winWidth, winHeight, winSubject) {
	windowleft = (screen.width / 2) - (winWidth / 2);
	windowtop = (screen.height / 2) - (winHeight / 2);
	winWidth = parseInt(winWidth);
	winHeight = parseInt(winHeight)+25;
	winFeatures="scrollbars=1,toolbar=0,menubar=0,status=1,width=" + winWidth + ",height=" + winHeight + ",top=" + windowtop + ",left=" + windowleft;
	if (winURL.substring(0,1) != "/") {
		winURL = getFolder(self.location)+winURL;
	}
	winURL = "/priv/common/jsp/popwindow/openwin.jsp?url_top="+winURL;
	window.open(winURL, winName, winFeatures);
	//openIT(winURL,winWidth,winHeight,windowleft,windowtop,winName,winSubject);
}

function getFolder(url_str) {
	var current_folder = "";
	var http_str = "http://";
	url_str= url_str+"";
	
	if (url_str.indexOf(http_str) > -1) {
		url_str = url_str.substring(http_str.length);
		url_str = url_str.substring(url_str.indexOf("/"));
	}
	while (url_str.indexOf("/") > -1) {
		current_folder += url_str.substring(0, url_str.indexOf("/")+1);
		url_str = url_str.substring(url_str.indexOf("/")+1);
	}
	return current_folder;
	
}

function closewin() {
	window.close();
}

function goBackToOpener() {
	parent.opener.location=parent.opener.location;
	parent.top.window.close();
}

function alertSuccessful(sMsg, sURL) {
	alert(sMsg);
	window.open(sURL, '_self');
}

function openTwoWindows(URL1, frame1, URL2, frame2) {
	window.open(URL1,frame1);
	//window.open(URL2,frame2);
}
function chromeless(u,n,W,H,X,Y,cD,cU,cO,cL,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO){
	var c=(document.all&&navigator.userAgent.indexOf("Win")!=-1)?1:0
	var w=window.screen.width; var h=window.screen.height
	var W=W||w; W=(typeof(W)=='string'?Math.ceil(parseInt(W)*w/100):W); W+=2*c
	var H=H||h; H=(typeof(H)=='string'?Math.ceil(parseInt(H)*h/100):H); H+=23*c
	var X=X||Math.ceil((w-W)/2)
	var Y=Y||Math.ceil((h-H)/2)
	var s=",width="+W+",height="+H

	if(c){
		var cTIT='\n'+
		'<html><head><META HTTP-EQUIV="imagetoolbar" CONTENT="no">\n'+
		'<link href="/priv/common/css/corporate.css" rel="stylesheet" type="text/css">'+
		'<script>\n'+
		'var iclod=new Image();iclod.src="'+cD+'";var iclou=new Image();iclou.src="'+cU+'";var icloo=new Image();'+
		'icloo.src="'+cO+'";var iload=new Image();iload.src="'+cL+'";\n'+
		'document.onselectstart=new Function("return false;");document.ondragstart=new Function("mWIN();return false;");'+
		'document.oncontextmenu=new Function("return false;");document.onmousemove=mWIN\n'+
		'b=-1;\n'+
		'function wLoa(){if(top.loaded){bloa.style.visibility="hidden";sRes()}else setTimeout("wLoa()",500)}\n'+
		'function sRes(){bclo.style.pixelLeft=document.body.clientWidth-18;bloa.style.pixelLeft=document.body.clientWidth-38}\n'+
		'function mWIN(){\n'+
		'if(b==0){document.body.bgColor="'+wBG+'";parent.bM.document.body.bgColor="'+wB+'";parent.bT.document.body.bgColor="'+wB+'";'+
		'parent.bB.document.body.bgColor="'+wB+'";parent.bL.document.body.bgColor="'+wB+'";parent.bR.document.body.bgColor="'+wB+'";'+
		'b=-1}\n'+
		'if(b==2){px=event.screenX-ofx-1;py=event.screenY-ofy-1;top.window.moveTo(px,py);}\n'+
		'if(b==1){document.body.bgColor="'+wBGs+'";parent.bM.document.body.bgColor="'+wBs+'";'+
		'parent.bT.document.body.bgColor="'+wBs+'";parent.bB.document.body.bgColor="'+wBs+'";'+
		'parent.bL.document.body.bgColor="'+wBs+'";parent.bR.document.body.bgColor="'+wBs+'";'+
		'ofx=event.x;ofy=event.y;b=2}\n'+
		'}</script></head>\n'+
		'<body onresize="sRes()" bgcolor='+wBG+' class="tableHeader">\n'+
		'<div style="position:absolute;left:0px;top:4px">'+tH+'</div>\n'+
		'<img id=bclo style="position:absolute;top:4px;left:'+(W-20)+'px;" src="'+cU+'" border=0 width=11 height=11 '+
		'onmouseover="this.src=icloo.src" onmouseout="this.src=iclou.src" onmouseup="this.src=iclou.src" '+
		'onmousedown="this.src=iclod.src" onclick="top.window.close()">\n'+
		'<img id=bloa style="position:absolute;top:4px;left:'+(W-40)+'px;" src="'+cL+'" border=0 width=11 height=11>\n'+
		'<script>wLoa()</script>\n'+
		'</body>\n'+
		'</html>'
		
		cTIT=cTIT.replace(/\//g,"\\\/").replace(/\"/g,"\\\"").replace(/\n/g,"\\n")
		
		var cFRM='<TITLE>'+tW+'</TITLE>\n'+
		'<script>\n'+
		'top.loaded=false\n'+
		'function mTIT(){\n'+
		'	if(frames.length>6){\n'+
		'		fT.document.bgColor="'+wBG+'";fT.document.write("'+cTIT+'");fT.document.close()\n'+
		'		bM.document.bgColor="'+wB+'";bL.document.bgColor="'+wB+'";bR.document.bgColor="'+wB+'";'+
		'		bB.document.bgColor="'+wB+'";bT.document.bgColor="'+wB+'"\n'+
		'	} else setTimeout("mTIT()",20)\n'+
		'}\n'+
		'mTIT()\n'+
		'</script>\n'+
		'<frameset onselectstart="return false" onload="top.loaded=true" border=0 framespacing=0 frameborder=0 cols="1,100%,1">\n'+
		'	<frame name=bL src="about:blank" scrolling=no noresize>\n'+
		'	<frameset border=0 framespacing=0 frameborder=0 rows="1,20,1,100%,1">\n'+
		'		<frame name=bT src="about:blank" scrolling=no noresize>\n'+
		'		<frame name=fT src="about:blank" scrolling=no noresize>\n'+
		'		<frame name=bM src="about:blank" scrolling=no noresize>\n'+
		'		<frame name=main src="'+u+'" '+fSO+'>\n'+
		'		<frame name=bB src="about:blank" scrolling=no noresize>\n'+
		'	</frameset>\n'+
		'<frame name=bR src="about:blank" scrolling=no noresize>\n'+
		'</frameset>\n'+
		'</HTML>'
	
		var CWIN=window.open("",n,"fullscreen=1"+s)
		CWIN.moveTo(5000,0)
		CWIN.resizeTo(W,H)
		CWIN.document.write(cFRM)
		CWIN.document.close()
		CWIN.moveTo(X,Y)
	} else {
		var CWIN=window.open(u,n,wNS+s,true)
		CWIN.moveTo(X,Y)
	}
	CWIN.focus()
	CWIN.setURL=function(u) { if (this && !this.closed) { if (this.frames.main) this.frames.main.location.href=u; else this.location.href=u }}
	CWIN.closeIT=function() { if (this && !this.closed) this.close() }
	
	return CWIN
}                                                                               
                     

function openIT(u,W,H,X,Y,n,title) {
var cD ='/priv/pics/Common/close_down.gif'
var cU ='/priv/pics/Common/close_up.gif'
var cO ='/priv/pics/Common/close_over.gif'
var cL
var tH ='<strong><img src="/priv/pics/Common/dotblank.gif" width="10" height="10">'+title+'</strong>'
var tW ='axsSCM'
var wB ='#000000'
var wBs ='#666666'
var wBG ='#339966'
var wBGs='#66CC99'
var wNS ='toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0'
var fSO ='scrolling=yes noresize'
chromeless(u,n,W,H,X,Y,cD,cU,cO,cL,tH,tW,wB,wBs,wBG,wBGs,wNS,fSO)
}

function jumpTo(linklabel, linkurl) {
	if (linkurl != "") {
		frSubTitle.location='/priv/common/jsp/subtitle.jsp?stitle='+escape(linklabel);
		frSubContent.location=linkurl;
		frSubBottom.location='/priv/common/jsp/subbottom.jsp?sobj='+escape(linklabel);
	}
}

function jumpToSelf(linkurl) {
	if (linkurl != "") {
		window.open(linkurl,'_self');
	}
}

function jumpToFrame(linkframe, linkurl) {
	if (linkurl != "") {
		eval(linkframe+'.location = \''+linkurl+'\';');
	}
}

function goto(label, value) {
	if (value.substring(0,value.indexOf("|"))=="sub") {
		jumpTo(label, value.substring(value.indexOf("|")+1, value.length));
	} else if (value.substring(0,value.indexOf("|"))=="par") {
		jumpToFrame('top.frContent', value.substring(value.indexOf("|")+1, value.length));
	} else {
		jumpToSelf(value.substring(value.indexOf("|")+1, value.length));
	}
}

