
/*
	$© Copyright 2005-2006 Ecode Lanka Software. All rights reserved.	$
*/


//**********************************************************************//;
//												//;
//		BEGIN PART A: FUNCTIONS USED ON BODY LOAD				//;
//												//;
//**********************************************************************//;

//****************************************************//;	
//			BEGIN	ON BODY LOAD			//;
//****************************************************//;	

function aligning(){

	//************** Center Body ******************//;	
	var obj = document.getElementById('target');	//the body of the document;
	var objTable = document.getElementById('main'); //the main table containing all content;
	var addWidth = (screen.width - 980)/2;
	obj.style.left = addWidth + 'px';
	var browserName=navigator.appName; 
	if (browserName=="Microsoft Internet Explorer"){
	document.getElementById('main').setAttribute('align','center');
	}
	//document.getElementById('main').align = "center";
	document.getElementById('target').style.display='block';	

	//************** Highligh Menu ****************//;	
	var fullPath = document.location.href;
	var pageArray = fullPath.split('/');
	var i = pageArray.length-1;
	
	//for user menu
	if(pageArray[i].split('_')[2] != null){
		var pageName = pageArray[i].split('_')[2].split('.')[0];
		var initPage = "_ctl0__ctl3_"+pageName.substring(0,3);
		if(document.getElementById(initPage)!==null){
			document.getElementById(initPage).className = 'leftNavOver';
		}
	}

	//for admin menu
	if(pageArray[i].split('_')[1] != null && pageArray[i].split('_')[2] == null){
		var pageName = pageArray[i].split('_')[1].split('.')[0];
		var initPage = "_ctl0__ctl3_"+pageName.substring(0,3);
		if(document.getElementById(initPage)!== null){
			document.getElementById(initPage).className = 'leftNavOver';
			if(pageName=="Artifact"){
				if(selectedID=="_ctl0__ctl3_Gen"){
					if(document.getElementById('_ctl0__ctl3_Art')!=null){
						document.getElementById('_ctl0__ctl3_Art').className = 'leftNavOut';
					}
				}
			}
		}
	}

	//************** Resize Decoration Picture ****************//;	
	//get picture sized properly;
	//this may be removed once the decorating pictures are sized ok;
	imageResize();

	//************** Preload Information Picture ****************//;	
	preloadInfoPics();

	//************** RCheck Cookies, Popup Blocker and Language ****************//;	
	//check if cookies can be set, check if popup is blocked and set languages in Login.aspx page;
	//the function doAfterLoad is only available at the Login page;	
	if(location.href.indexOf("Login.aspx")!=-1){doAfterLoad()};

	//************** Initialize Artiftacts Category and Use ****************//;	
	//initialize categories in artifacts pages, if loaded;
	//the function init_cat is only available in the Art_General and Art_GenView pages;	
	if(document.getElementById("arrCat1")){init_cat();};

	//************** Initialize Structures ****************//;	
	//initialize categories in structure pages, if loaded;
	//the function init_cat is only available in the Str_General and Str_GenView pages;	
	if((document.getElementById("arrStCat1"))||(document.getElementById("_ctl0_StrucGeneralView_strCatID"))){init_cat();};

	//************** Initialize Translations ****************//;	
	//translation may only be done in View or List mode.;
	if((location.href.indexOf("View.")!==-1)||(location.href.indexOf("List.")!==-1)){init_lanText();};

	//************** Cleanup Administration pages ****************//;
	//remove label "general" where there is only one subject to show in the dec picture administration.;
	//this function may be removed once this is done by .NET;
	if(location.href.indexOf("LC_Chart_Admin")!==-1){removeGeneral("_ctl0_ChartAdmin_Chart_DecPicture1_lblGeneral")};
	if(location.href.indexOf("LC_Drawing_Admin")!==-1){removeGeneral("_ctl0_DrawingAdmin_Drawing_DecPicture1_lblGeneral")};
	if(location.href.indexOf("CM_AttachmentAdmin")!==-1){removeGeneral("_ctl0_AttachmentAdmin_AttachmentDec_Pictures1_lblGeneral")};

	//************** Cleanup Decorating pictures ****************//;	
	//if it is standard deco picture: don't show copyr and comments and don't make it clickable-like;
	// add copyright mark and : to the copyright content;
	// do not show the comment box if there is nothing in it.;
	comment_decPic();

	//************** Bypass NewWindowMax and NewWindow ****************//	;
	//bypass the existing functions NewWindowMax and NewWindow and reprogram these;
	//this allows window to be resized and prevents window from being hidden below the window browser at the bottom;
	//and allows window opening to be the same for the whole application;
	deleteWindowOpeners();

	//************** Show status and role of users ****************//	;
	//show active/inactive and user/admin instead of values 1 and 2;
	//this function may be removed once the control User_List.ascx is properly made;
	if(location.href.indexOf("UserList")!==-1){showStatusUser()};

	//************** autodetect menu ****************//	;
	//this function was added to let the main menu button highlight;
	//it can also be used to change the banner, according to the selected object
	highLightMenu()
}

//****************************************************//;	
//			END ON BODY LOAD				//;
//****************************************************//;	



//****************************************************//;	
//			BEGIN	HIGHLIGHT MENU			//;	
//****************************************************//;	
function highLightMenu(){	
	//find parent menus
	if(document.getElementById("menuHolder")){
		var cnt, urlAr, parAr, url1, ban
		var ban
		if(document.getElementById("_ctl0__ctl0_Image1")){
			ban=document.getElementById("_ctl0__ctl0_Image1")
		}
		cnt = 0
		parAr = Array()
		for(i=0;i<MENU_ITEMS.length-1;i++){
			parAr[i]=cnt
			for(j=0;j<MENU_ITEMS[i].length;j++){
				if((MENU_ITEMS[i][j])&&(MENU_ITEMS[i][j].length==2)){
					cnt++
				}
			}
			cnt++
		}
		//highlight selected parent menu
		urlAr=Array("/WK_","/ZZZ","/ST_","/AF_","/CM_Event","/LC_","/CM_Attach","/AD_Ref","/AD_")
		banAr=Array("Images/menuImages/banner.gif","Images/menuImages/banner.gif","Images/menuImages/banner_ST.gif","Images/menuImages/banner_AF.gif","Images/menuImages/banner_EV.gif","Images/menuImages/banner_LC.gif","Images/menuImages/banner_ATT.gif","Images/menuImages/banner_REF.gif","Images/menuImages/banner.gif")
		for(i=0;i<urlAr.length;i++){
			if(location.href.indexOf(urlAr[i])!==-1){
				document.getElementById("e0_"+parAr[i]+"o").className = "m0l0oover";
				if(banAr[i]!==""){
					ban.src = banAr[i]
				}
				else{
				}
			i=urlAr.length;
			}
		}

	}
}
//****************************************************//;	
//			END HIGHLIGHT MENU			//;	
//****************************************************//;	



//****************************************************//;	
//		BEGIN	RESIZE DECORATING PICTURE		//;	
//****************************************************//;	
var interVal;
var interValInit = false;
function imageResize() {
	var img;
	if(document.getElementById("tdImgHolder")){
		img = document.getElementById("tdImgHolder").getElementsByTagName("img")[0];
		if((img.width==0)||(img.height==0)){
			if(!interValInit){
				interVal = setInterval("waitImage()",10);
				interValInit = true;
			}
		}
		else{
			interVal = null;	
			interValInit = false;
			getImage(img);
		}
	}
}

function waitImage(){imageResize();}

function getImage(img){
	var placeHolderWidth = 290;
	var placeHolderHeight = 195;
	var placeHolderRatio = (placeHolderWidth/placeHolderHeight);
	if (img!=null)
		{
		var	imageRatio = img.width/img.height;
		if((img.width>placeHolderWidth)||(img.height>placeHolderHeight)){
			if(imageRatio<placeHolderRatio){
				img.height    = placeHolderHeight;
				img.width     = imageRatio*img.height;
			}
			if(imageRatio>placeHolderRatio){
				img.width     = placeHolderWidth;
				img.height    = img.width/imageRatio;
			}
		}
	}
}
//****************************************************//;	
//		END RESIZE DECORATING PICTURE			//;	
//****************************************************//;	



//****************************************************//;	
//		BEGIN	PRELOAD INFORMATION PICTURE		//;	
//****************************************************//;	
var imgOrigSrc, imgNew ;

function showInfo(t) {
	var imgho 	= document.getElementById("tdImgHolder").getElementsByTagName("img")[0];
	var sr 	= imgho.src.toString();
	imgNew	= new Image();
	if(sr.indexOf("info_")==-1){
		imgOrigSrc 	= sr;
		imgNew.src 	= "Images/info/" + t;
	}
	else{
	imgNew.src 	= imgOrigSrc;
	}
	resizeNew();
}

function waitNewImage(){resizeNew();}

function resizeNew() {
	if((imgNew.width==0)||(imgNew.height==0)){
		if(!interValInit){
			interVal= setInterval("waitNewImage()",10);
			interValInit = true;
		}
	}
	else{
		var img   = document.getElementById("tdImgHolder").getElementsByTagName("img")[0];
		interVal = null;	
		interValInit = false;
		img.src = imgNew.src;
		img.width = imgNew.width;
		img.height = imgNew.height;
		getImage(img);
	}
}

function preloadInfoPics(){
	//only one info picture at this moment;
	var imgArS = Array("info_depth.gif");
	var imgArV = Array();
	for(i=0;i<imgArS.length;i++){
		imgArV[i] 	  = new Image();
		imgArV[i].src = "Images/info/" + imgArS[i];
	}
}
//****************************************************//;	
//		END PRELOAD INFORMATION PICTURE		//;	
//****************************************************//;	



//****************************************************//;	
//		BEGIN INITIALIZE TRANSLATION			//;	
//****************************************************//;	
function init_lanText(){
	var txt, inpArr, tagNameArr, tagArr, c, i;

	//translate input elements
	inpArr = document.getElementsByTagName("input");
	if(inpArr.length!==0){
		for(i=0;i<inpArr.length;i++){
			txt = inpArr[i].value;
			txt = transLate(txt);
			inpArr[i].value = txt;
		}
	}

	//translate other elements
	// only in id=bodyControl, otherwise, problems with the menu
	tagNameArr = Array("span","a","td");
	for(c=0;c<tagNameArr.length;c++){
		if(document.getElementById("bodyControl")){
			tagArr = document.getElementById("bodyControl").getElementsByTagName(tagNameArr[c]);
			if(tagArr.length!==0){
				for(i=0;i<tagArr.length;i++){
					txt = tagArr[i].innerHTML;
					txt=transLate(txt);
					tagArr[i].innerHTML = txt;
				}
			}
		}
	}
}

//translate a text;
//when no language tag in text, don't change anything;
//when language tag in text, return the portion belonging to the language tag ;
function transLate(text){
	//array of 'language tags';
	var lanArr = Array("NL:","FR:","EN:","DE:");
	var lang = findLang();
	lang = lang.toUpperCase()+":";
	var txt = text;
	if((txt.indexOf(lang)>=0)&&(txt.indexOf("<")<0)){
		txt= txt.split(lang)[1];
		for(j=0;j<lanArr.length;j++){
			if(txt.indexOf(lanArr[j])>0){
				txt = txt.split(lanArr[j])[0];
			}
		}
	}
	//clear leading and trailing spaces;
	txt = txt.replace(/^\s+/g, "") ;
	txt = txt.replace(/\s+$/g, "") ;
	return txt;
}

//used to translate Assignment and Reference popups
function sortTranslations(where){
	var optArr = document.getElementById(where);
	var txt;
	var newArr = Array();
	for(i=0;i<optArr.length;i++){
		txt = optArr.options(i).text;
		txt = transLate(txt);
		newArr[i]= txt +"[]"+ optArr.options(i).value;
	}
	newArr = sortArray(newArr);
	var splitArr = Array();
	for(i=0;i<newArr.length;i++){
		splitArr = newArr[i].split("[]");
		newArr[i]=Array(splitArr[0],splitArr[1]);
	}
	var par = optArr.parentElement;
	var chi = "<select name='" + where + "' size='4' id='" + where + "' style='height:150px;width:300px;'>";
	for(i=0;i<newArr.length;i++){
		chi +="<option value='"+newArr[i][1]+"'>"+newArr[i][0]+"</option>";
	}
	chi +="</select>";
	par.innerHTML = chi;
}

function sortArray(ar){
	ar.sort(function(a,b){
		return (a.toLowerCase()>b.toLowerCase())
		});
	return ar;
} 

//****************************************************//;	
//		END INITIALIZE TRANSLATION			//;	
//****************************************************//;	



//****************************************************//;	
//		BEGIN CLEANUP ADMIN PAGES			//;	
//****************************************************//;	
//remove the general label when there is only one decorating picture
function removeGeneral(m){
var tdDel, newTR;
if(document.getElementById(m)){
	tdDel = document.getElementById(m);
	newTR = tdDel.offsetParent.offsetParent.getElementsByTagName("tr")[0];
	newTR.getElementsByTagName("td")[2].style.paddingRight="45";
	tdDel.offsetParent.style.display="none";
	}
}
//****************************************************//;	
//			END CLEANUP ADMIN PAGES			//;	
//****************************************************//;	



//****************************************************//;	
//		BEGIN DECORATING PIC CLEANUP			//;	
//****************************************************//;	
function comment_decPic(){
	if(document.getElementById("tdImgHolder")){
		var imgHolder 	= document.getElementById("tdImgHolder")	; //the image holder	;
		var imgCopyR 	= document.getElementById("comCopy")	; //the copyright box	;
		var imgComment 	= document.getElementById("comParent")	; //the comment box	;
		var imgPic 		= imgHolder.getElementsByTagName("img")[0]; //the decoration image;
		//if it is standard deco picture: don't show copyr and comments and don't make it clickable-like;
		if(imgPic.src.indexOf("testWreck")>=0){
			imgCopyR.style.display	 = "none"	;
			imgComment.style.display = "none"	;
			imgPic.style.curosr	 = "default";
		}
		else{
			// add copyright mark and : to the copyright content if not empty
			if(imgCopyR){
				if(imgCopyR.innerHTML!==""){imgCopyR.innerHTML = "&copy;&nbsp;"+ imgCopyR.innerHTML +":";}
			}
			// do not show the comment box if there is nothing in it.
			if(imgComment){
				if(imgComment.getElementsByTagName("span")[0].innerHTML==""){imgComment.style.display="none";}
				//preload the large version as well, for opening the large window.;
				imageLPreLoad();	 //this function resides in Image.ascx;
			}
		}
	}
}
//****************************************************//;	
//		END DECORATING PIC CLEANUP			//;	
//****************************************************//;	



//****************************************************//;	
//	BEGIN NEWWINDOWMAX and NEWWINDOW BYPASS		//;	
//****************************************************//;	

//the deletion of NewWindowMax and NewWindow maybe deleted, once in every page
//the javascript function NewWindowMax and NewWindow are removed;
//function to delete WindowMax and make a new
var NewWindow, NewWindowMax
function deleteWindowOpeners(){
	//only in admin pages, otherwise chart, drawing and zone pages do not open full window.
	if((NewWindowMax)&&(location.href.indexOf("Admin")!==-1)){
		NewWindowMax = null;
		NewWindowMax = function(mypage) {var scroll='yes'; var myname =''; var w = 1040; var h =screen.height; var winl=(screen.width-w)/2; var wint=0; var settings='height='+h+','; settings +='width='+w+','; settings +='top='+wint+','; settings +='left='+winl+','; settings +='scrollbars='+scroll+','; settings +='resizable=yes'; win1=window.open(mypage,myname,settings);};
	}
	if((NewWindow)&&(location.href.indexOf("Status")<0)){
	//do not apply in status pages, otherwise status popups do not open in correct window.
		NewWindow = null;
		NewWindow = function(mypage) {var scroll='no';var myname ='';var w=330; var h=450; var winl=(screen.width-w)/2;var wint=(screen.height-h)/2;var settings ='height='+h+',';settings +='width='+w+',';settings +='top='+wint+',';settings +='left='+winl+',';settings +='scrollbars= '+scroll+',';settings+= 'resizable=yes';win=window.open(mypage,myname,settings);};
	}
}
//****************************************************//;	
//	END NEWWINDOWMAX and NEWWINDOW BYPASS		//;	
//****************************************************//;	


//****************************************************//;	
//		  BEGIN USER STATUS AND ROLE			//;	
//****************************************************//;	

function showStatusUser(){
	var trAr, tdAr, mail
	var tdAr = Array()
	var mc = "2"
	var rc = "3"
	var sc = "4"
	trAr = document.getElementById("userlist").getElementsByTagName("tr")
	for(i=0;i<trAr.length;i++){
		//alert(trAr[i].innerHTML)
		tdAr = trAr[i].getElementsByTagName("td")
		if(tdAr[mc]){
			mail =  tdAr[mc].innerHTML
			if ((mail.indexOf("@")!==-1)&&(mail.indexOf(".")!==-1)){
				tdAr[mc].innerHTML = "<a href='mailto:" + mail + "'>" + mail + "</a>";
			}
		}
		if(tdAr[rc]){
			if (tdAr[rc].innerHTML == "1"){
				tdAr[rc].innerHTML ="user";
			}
			if (tdAr[rc].innerHTML == "2"){
				tdAr[rc].innerHTML ="<span style='color:#FF0000;'>admin</span>";
			}
		}
		if(tdAr[sc]){
			if (tdAr[sc].innerHTML == "1"){
				tdAr[sc].innerHTML ="active";
			}
			if (tdAr[sc].innerHTML == "2"){
				tdAr[sc].innerHTML ="<span style='color:#FF0000;'>inactive</span>";
			}
		}

	}
	tdAr = document.getElementById("userlist").getElementsByTagName("td")
	for(i=0;i<tdAr.length;i++){
		if (tdAr[i].colSpan=="10"){
			tdAr[i].innerHTML = "<span style='color:#333399;font-weight:bold;'><u>Page</u>:</span> " + tdAr[i].innerHTML +"<br />&nbsp;"
		//colSpanalert(tdAr[i].innerHTML)
		}
	}
}

//****************************************************//;	
//		  END USER STATUS AND ROLE			//;	
//****************************************************//;	


//**********************************************************************//;
//												//;
//		   END PART A: FUNCTIONS USED ON BODY LOAD			//;
//												//;
//**********************************************************************//;





//**********************************************************************//;
//												//;
//		   BEGIN PART B:	FUNCTIONS COMMONLY USED				//;
//												//;
//**********************************************************************//;

//****************************************************//;	
//			BEGIN FIND LANGUAGE			//;	
//****************************************************//;	
//retrieves the user's language from cookie;
//used by translation, copyright scripts and help menu;
function findLang(){
	//get user language
	var currentLang = "nl";
	if(document.cookie!=''){
		var arrCookie = document.cookie.split(";");
		for(var i=0;i<arrCookie.length;i++){
			if(arrCookie[i].indexOf("USER_LANGUAGE")!=-1){
				currentLang=arrCookie[i].split("=")[1];
			}
		}
	}
	return currentLang;
}
//****************************************************//;	
//			END FIND LANGUAGE				//;	
//****************************************************//;	



//****************************************************//;	
//			BEGIN SHOW COPYRIGHT			//;	
//****************************************************//;	
//used by all pages with decoration pictures in Image.ascx

var comOldHTML;
var selectedLang = 'nl';

function showCopyRight(s){
	if(document.getElementById(s).src.indexOf("testWreck.gif")<0){
		var comArray = Array("<p><span style='color:#993333;'>Klik op het beeld om de <u>grotere</u> versie te zien.<br />U mag dit downloaden, maar respecteer en vermeld wel de <u>copyright</u>.</span></p>","<p><span style='color:#333333;'>Click the image to have a <u>larger</u> version.<br />You may download this picture, but please, always respect and mention the <u>copyright</u>.</span></p>","<p><span style='color:#333333;'>Cliquez sur l'image pour une version plus <u>grande</u>.<br />Vous pouvez la t&#233;l&#233;charger, mais veuillez respecter et mentionner le <u>copyright</u>.</span></p>","<p><span style='color:#333333;'>TBA DE [Click to <u>enlarge</u> this picture.<br />You may download this picture, but please, always mention the <u>copyright</u>.</span></p>");
		var lanArr = Array("NL","EN","FR","DE");
		var comLan = comArray[1];
		var com = document.getElementById("comParent");
		selectedLang = findLang();
		for (j=0;j<lanArr.length;j++){
			if(selectedLang.toUpperCase()==lanArr[j]){comLan=comArray[j];}
		} 
		com.style.backgroundColor="#FFEEEE";
		comOldHTML = com.innerHTML;
		com.innerHTML = comLan;
	}
}

function hideCopyRight(s){
	if(document.getElementById(s).src.indexOf("testWreck.gif")<0){
		var com = document.getElementById("comParent");
		com.style.backgroundColor="#FFFFFF";
		com.innerHTML = comOldHTML; 
	}
}
//****************************************************//;	
//			END SHOW COPYRIGHT			//;	
//****************************************************//;	



//****************************************************//;	
//		BEGIN MENU RELATED FUNCTIONS			//;	
//****************************************************//;	
var selectedId = 'home';
function menuOver(id){
	var targetObj = document.getElementById(id);
	targetObj.className = 'navigationTab1';
}

function menuOut(id){
	var targetObj = document.getElementById(id);
	if(selectedId!=id){
		targetObj.className = 'navigationTab';
	}
}

function menuClick(id){
	selectedId = id;
}

function navMain(id,menuId){
	var targetObj = document.getElementById(id);
	for(var i=1;i<7;i++){
		document.getElementById('menu'+i).style.display = 'none';
	}
	if(menuId=='database'){
		__doPostBack('_ctl0$_ctl0$lbDataBk','');
	}
	targetObj.style.display = 'block';
	document.getElementById('home').className 	= 'navigationTab';
	document.getElementById('contact').className 	= 'navigationTab';
	document.getElementById('mfa').className 		= 'navigationTab';
	document.getElementById('partners').className 	= 'navigationTab';
	document.getElementById('news').className 	= 'navigationTab';
	document.getElementById('database').className 	= 'navigationTab';
	document.getElementById('subscribe').className 	= 'navigationTab';
	document.getElementById(menuId).className 	= 'navigationTab1';
	selectedId = menuId;
}

function langMneuOver(lang){
	var targetObj = document.getElementById(lang);
}
//****************************************************//;	
//		END MENU RELATED FUNCTIONS			//;	
//****************************************************//;	



//****************************************************//;	
//	  BEGIN ERROR MESSAGE RELATED FUNCTIONS		//;	
//****************************************************//;	
function displayError(message){
	if(navigator.appName=="Netscape"){
		displayErrorNets(message);
	}
	else{
		displayErrorIE(message);
	}
}

function displayErrorIE(message){
	
	//drawAlertBox();
	var MSG_BOX_WIDTH = 290;
	var MSG_BOX_HEIGHT = 110;
	var windowWidth = document.body.offsetWidth;
	var windowHeight = document.body.offsetHeight;
	var alertBox = document.getElementById("errorMsgBox");
	var errorMsg = document.frames.iframM2.document.getElementById("msg");
	var x =  (windowWidth-MSG_BOX_WIDTH)/2;
	var y =  (windowHeight-MSG_BOX_HEIGHT)/2;
	alertBox.style.display = 'block';
	alertBox.style.position = 'absolute';
	alertBox.style.top = y + 'px';
	alertBox.style.left = x + 'px';
	errorMsg.innerHTML = message;
}

function displayErrorNets(message){
	
	//drawAlertBox();
	var MSG_BOX_WIDTH = 290;
	var MSG_BOX_HEIGHT = 110;
	var windowWidth = document.body.offsetWidth;
	var windowHeight = document.body.offsetHeight;
	var alertBox = document.getElementById("errorMsgBoxNets");
	var errorMsg = document.getElementById("msg");
	var x =  (windowWidth-MSG_BOX_WIDTH-300)/2;
	var y =  (windowHeight-MSG_BOX_HEIGHT)/2;
	alertBox.style.display = 'block';
	alertBox.style.position = 'absolute';
	alertBox.style.top = y + 'px';
	alertBox.style.left = x + 'px';
	errorMsg.innerHTML = message;
}

function closeError(){
	if(navigator.appName=="Netscape"){
		var alertBox = document.getElementById("errorMsgBoxNets");
		alertBox.style.display = 'none';
	}
	else{
		var alertBox = document.getElementById("errorMsgBox");
		alertBox.style.display = 'none';
	}
}

//****************************************************//;	
//	  END ERROR MESSAGE RELATED FUNCTIONS		//;	
//****************************************************//;	


//****************************************************//;	
//	  	BEGIN OPEN FULLY MAXIMIZED WINDOW		//;	
//****************************************************//;	
var win= null;
function NewWindowMax(mypage){
	var scroll = 'yes'
	var myname = '';
	var w = parseInt(screen.width);
	var h = parseInt(screen.height);
  	var settings  ='height='+h+',';
      settings +='width='+w+',';
      settings +='top=0px,';
      settings +='left=0px,';
      settings +='scrollbars='+scroll+',';
      settings +='resizable=yes';
	win=window.open(mypage,myname,settings);
}
//****************************************************//;	
//	  	END OPEN FULLY MAXIMIZED WINDOW		//;	
//****************************************************//;	


//****************************************************//;	
//	  	BEGIN	SEVERAL OTHER FUNCTIONS			//;	
//****************************************************//;	
function Suggest_Click(masterTable,value){
	RS.Execute("Suggestion.aspx", "InsertSuggetion", masterTable, value);
}


//this enables the label of any disabled radio/checkbox list
function makeEnable(ID){
	var mainTable = document.getElementById(ID);
	var spns = mainTable.getElementsByTagName("span");
	mainTable.removeAttribute("disabled");
	for(var i = spns.length;i--;){
		spns[i].removeAttribute("disabled"); 
	}
}

function getUniqueNo(){
	var time = new Date();
	return time.getTime();
}

//***********************************************************************
// This code is needed to avoid 'click to activate and use this control'
// and is used by orientation, slope, inclination htm files in VIOE 
// directory.
//***********************************************************************
function docW(whatflash){
setVal(); //this code is inside htm docs as described above and is needed for NS to refresh.
var dw = "<OBJECT classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase= 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0' WIDTH='300' HEIGHT='340' ALIGN='' > <PARAM NAME=movie VALUE='Swf/" + whatflash + ".swf?initValue="+myVal+"'><PARAM NAME=FlashVars VALUE=&pageMode="+mode+"&><PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src='Swf/"+whatflash+".swf?initValue="+myVal+"'  WIDTH='300' HEIGHT='340' ALIGN='' quality=high bgcolor=#FFFFFF TYPE='application/x-shockwave-flash' PLUGINSPAGE='http://www.macromedia.com/go/getflashplayer'></EMBED></OBJECT>"
document.write(dw)
}

function chartW(whatflash){
	//alert(whatflash)
	//document.write(whatflash)
	//document.getElementById("Swf/chart003").outerHTML = whatflash
	document.getElementById("tdFlashContainer").innerHTML = whatflash
	
}

//***********************************************************************
// This code is needed to open the HELP Window
//***********************************************************************
function openHelp(m){
m = m + "?" + findLang()
var w = window.screen.width
w = parseInt(w*2/3)
var l = parseInt(w/2-15) 
var h = window.screen.height
h = parseInt(h*2/3)
var help = window.open(m,"help","menu=no,toolbars=no,status=no,width="+w + ",height=" + h +",left=" + l)
help.focus()
}


//***********************************************************************
// This code is needed to handle SP2 Issue on Flash popup windows
//***********************************************************************
function writeFlashForCharts(ob)
{
  document.write(ob);
  var container = document.getElementById("tdFlashContainer");
  container.height = screen.height;
  container.width = screen.width;

}


//****************************************************//;	
//	  	END SEVERAL OTHER FUNCTIONS			//;	
//****************************************************//;	


//**********************************************************************//;
//												//;
//		   END PART B:	FUNCTIONS COMMONLY USED				//;
//												//;
//**********************************************************************//;
