/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
PAGING AND SORTING
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
function chgSort(p){
	with(document.vform){
		//If clicking on the same Column, Switch Direction
		if(ord.value == p){
			dir.value = (dir.value == 0)? 1:0;
		}else{ //Change Column and reset to Asc
			ord.value = p;
			dir.value = 0;
		}//if
		submit();
	}//for
	return false;
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function chgPaging(p){
	document.vform.cpage.value = p;
	document.vform.submit();
	return false;
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
FRAME CONTROLS
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
function gTopFrame(f,v){
	parent.frames[f].rows = (parent.frames[f].rows != "0,*")?"0,*":v+",*";
}//function

function gLeftFrame(f,v){
	parent.frames[f].cols = (parent.frames[f].cols != "0,*")?"0,*":v+",*";
}//function

/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
TABBING
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
function getAddress(url){
	var href = document.location.href;
	if(url.substring(0,1) != "/") return href.substring(0,href.lastIndexOf("/")+1) + url;
	else return url;
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function gOpenTab(n,title,url){
	top.Tab_Open(n,title,getAddress(url));
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function gLoadTab(n,url){
	top.Tab_Open(n,"Loading...",getAddress(url));
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function gMainTab(title,url){
	top.Tab_Update(0,title,getAddress(url));
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function gRenameThisTab(title){
	if(! top.Tab_UpdateTitleByName) return;
	var n = this.name;
	if(n.substr(0,6) != "frame_") n = parent.name;
	
	n = n.substring(n.indexOf("_")+1,n.length);
	top.Tab_UpdateTitleByName(n,title);
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function gCloseThisTab(){
	if(! top.Tab_CloseByName) return;
	var n = this.name;
	if(n.substr(0,6) != "frame_") n = parent.name;
	
	n = n.substring(n.indexOf("_")+1,n.length);
	top.Tab_CloseByName(n);
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
	
function gStatus(txt){
	if(! top.Stat_Update) return;
	top.Stat_Update(txt);
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function gDefaultStatus(){
	if(! top.Stat_Default) return;
	top.Stat_Default();
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
POPUP WINDOWS
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
//Open a Popup Window
function popWindow(href,w,h,wcont){
	if(w == undefined) w = 800; //Default Settings
	if(h == undefined) h = 630;
	var rest = (!wcont)? "toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,fullscreen=no":"toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=yes,location=yes,fullscreen=no";
	window.open(href,"_blank","width="+ w + ",height=" + h + ",top=25,left=25," + rest);
	return false;
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

//Open a Popup Window
function popWindowCenter(href,w,h,wcont,wName){
	if(w == undefined) w = 800; //Default Settings
	if(h == undefined) h = 630;
	if(wName == undefined) wName = "_blank";
	
	var l = (screen.width - w)/2
	var t = (screen.height - h)/2
	var rest = (!wcont)? "toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,fullscreen=no":"toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=yes,location=yes,fullscreen=no";
	window.open(href,wName,"width="+ w + ",height=" + h + ",top=" + t + ",left=" + l + "," + rest);
	return false;
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

//Open a Popup Window with Custom Attributes
function popWindowCustom(href,w,h,wcont,wName){
	if(w == undefined) w = 800; //Default Settings
	if(h == undefined) h = 630;
	if(wName == undefined) wName = "_blank";
	var l = (screen.width - w)/2
	var t = (screen.height - h)/2
	
	var rest = (!wcont)? "toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=yes,location=yes,fullscreen=no":wcont;
	window.open(href,wName,"width="+ w + ",height=" + h + ",top=" + t + ",left=" + l + "," + rest);
	return false;
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


//Open a Popup Window, For Flash Use only
function popWindowSwf(href,w,h,wcont){
	if(w == undefined) w = 800; //Default Settings
	if(h == undefined) h = 630;
	var rest = (!wcont)? "toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,fullscreen=no":"toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,directories=yes,location=yes,fullscreen=no";
	window.open(href,"_blank","width="+ w + ",height=" + h + ",top=25,left=25," + rest);
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
IMAGE ROLL OVERS
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
//Change the Image source of an Image
function RollImg(imgname,img){
	document.images[imgname].src = img.src;
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

//Convert Array into an Image Array;
function LoadImageAry(imgAry){
   for(x=0;x < imgAry.length;x++){
	   temp = imgAry[x]; //Save FileName
	   imgAry[x] = new Image(); //Create Image in its place
	   imgAry[x].src = temp; //Load the Image
   }//next
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

/*:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
MISC
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/
//Change Row Style
function RowOver(obj,state){
	if(obj.tmpCls == undefined) obj.tmpCls = obj.className;
	obj.className = (state == 1)? "tblRow_Sel" : obj.tmpCls;
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

//Toggle Display
function togDisplay(id){
	var obj = document.getElementById(id);
	if(obj != undefined) obj.style.display = (obj.style.display == "")?"none":"";
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function pageReload(){
	document.location.reload();
	return false;
}//func \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\