//This page is for the Services//includes the :
//Constitution
//Judicial
//
//Legal 
//Trusts
//Contracts
//JTS, Calendar, messaging?
//Registration
TikServ ={
	"Layup.Drawer.Service":{},
//	"Layup.Form.x":{},	
		"Layup.Page.NewRegistration":{"UID":"0000009", "NaME":"NewRegistration", "VName":"", 
			"Header":"", "Footer":"","RecDesc":"Null", "Nid":"S",
			"List":[],	// ["1","CR8former","Cr8ora2","","Indent","Comment","Content","Form"]
			"Content":"<input type='button' class='SFrame SFrameT' value='Load Citizenship Questionair' id='CitizLoad' onclick=\"Tik.Core.Prog.LoadJS('gtikstart.js')\"><spanblk style='height:70%;' id='Fcomment'>Loading Data - please wait</spanblk>",
			"RunIt":{
			runOnLoad:function runOnLoad(){}
			}
	},/*
	"ETI.Fees" : {
			ETITransFee : "0.00050",	//Financial Transaction Fee; The amount taken from Billed that goes to ETI
			ETIOurWorld : "0.00300",	//Delivery Service Fee; The amount taken from Billed that goes to OurWorld 
																//(includes 0.00100 for Bond Recovery fee, for the repayment of the initial issue 3yr bonds)
			ETIStorage  : "0.00150"		//Storage Service Fee; The amount taken from Billed that goes to Displacement Services
	},/**/
	"Core.Prog.ETI" :{
		CheckSums : function(org){ //checks the balances and corrects in the config pages/setup of the ETI charges
			//sort out the address of the fields in this block
			var oa = org.id.split('-');
			var op = '';
			for(var oq=0;oq<oa.length-1;oq++){
				op+=oa[oq]+'-';
			}
			var tx = Tik;
			var wa = org.attributes.TikWhereto.value.split(',');
			var wq = wa.length;
			for(var wt=1;wt<wq-1;wt++){
				tx = tx[wa[wt]];
			}
			//put data from masters into the holes
			var ETIOurWorld = Tik.ETI.Fees.ETIOurWorld; //get the new values
			var ETITransFee = Tik.ETI.Fees.ETITransFee;
			var ETIStorage  = Tik.ETI.Fees.ETIStorage;
			o(op+'ETI_OurWorld').value = ETIOurWorld;  //update the screen
			o(op+'ETI_ETITrans').value = ETITransFee;
			o(op+'ETI_Storage').value  = ETIStorage;
			tx.ETI_OurWorld = ETIOurWorld;							//update the config storage info
			tx.ETI_ETITrans = ETITransFee;
			tx.ETI_Storage = ETIStorage;
			//o(op+'ETI_Instigator').value ======= already true from config page
			ETI_I =  o(op+'ETI_Instigator').value
			var ETI_tot = ((1*ETI_I) + (1*ETIOurWorld)+(1*ETITransFee)+(1*ETIStorage))
			//take billed amount and subtract all others - put balance into OwnerAmt, or, 
			if(oa[oa.length-1] == 'ETI_Billed'){
				var v = (1*org.value - ETI_tot)
				o(op+'ETI_OwnerAmt').value = v.toFixed(5);
				o(op+'ETI_OwnerAmt').style.background = v>=0?'white':'red';
				tx.ETI_OwnerAmt = v.toFixed(5);
				
			}else if(oa[oa.length-1] == 'ETI_OwnerAmt'){
				var v = (1*org.value + ETI_tot)
				o(op+'ETI_Billed').value = v.toFixed(5);
				o(op+'ETI_Billed').style.background = v>=0?'white':'red';
				tx.ETI_Billed = v.toFixed(5);
			}
			//take (if org) OwnerAmt add all rest and put Billed amount
			
/*				"Charge" : {
						"Charged" : [false,'c','Is this WIBL charged at all \nUnticked=ignore this block, \nTicked= action this block!!'],
						"Period" : ["F",,'t','W=weekly, D=daily, H=Hourly, M=monthly, Q=quarterly, Y=yearly(annual), F=free'],
						"Use" : [false,'c','Ticked = charge per use (ignore Period)'],
		 				"Authority" :["",'t','The Authority number of the persons being charged'],
						"OwnerUID" :[Tik.User.REP,'t',"The UID of the Owner. \nWho will receive the Owner Amount."],	
						"ETI_Billed" :["0.01000",'r','The amount the customer (WIBL viewer) is expected to pay - per charge service (period,use etc)'],
						"ETI_OurWorld":["0.00030",'r','Delivery Service Fee; The amount taken from Billed that goes to OurWorld','L'],
						"ETI_ETITrans":["0.00040",'r','Financial Transaction Fee; The amount taken from Billed that goes to ETI','L'],
						"ETI_Storage":["0.00010",'r','Storage Service Fee; The amount taken from Billed that goes to Displacement Services','L'],
						"ETI_Instigator" :["0.00020",'r','Development Fee; How much the instigator is paid from the billed amount','L'],
						"ETI_OwnerAmt" :["0.00900",'r','How much the WIBL owner is to receive, from the billed amount'],
					},
*/			
			
		}
		
		
	}
	
	
	/*
	"Core.Init":{
	"Tester":{"src":''},
	"Core":{
		"Prog":{},
		"Layup":{},
		"Info":{},
		"Trtc":"<span class='rtc' title='Copyright Registered with TrustIBL \n vested to the owner'>&#174;T&#169;</span>"
		
	},
	"Now":{
		"Drawer":{
			"Qty":8,
		},
		"ViewPoint":"T01",
		"PersonalityName":"Individual",
		"Personality":"1"
	},
	"Device":{
		"LocalStorage":false,
		"SessionStorage":false,
		"DB":false,
		"LocalLoad":false,
		"NetAvail":false,
		"OnLine":'',
		"Users":[],
		"Pers":[
		//	/*Number,ETI-Balance,PosX,PosY,SizeX,SizeY
			[0,1.000000,0,0,3,3],
			[1,1.000000,3,0,3,3],
			[2,1.000000,6,0,3,3],
			[3,1.000000,0,3,3,3]
			]
	},
	"Initial":{
		"First":0
	},
	"CSS":{
		"ButOn":" -webkit-gradient(linear, 0% 0%, 0% 100%, from(lightblue), to(#4682B4))",
		"ButOff":" -webkit-gradient(linear, 0% 0%, 0% 100%, from(white), to(lightblue))"
	},
	"Mode":{},
	"Where":{
		"Net":[		//Te (to/from) , about 								,  Tik.location  , header , short
	//		["00000000000000001000","10000000000000000005","Tik.Core.Init","Starter","Tik","","",""], //This Tik startup block
			["00000000000000001000","10000000000000000010","Tik.Core.Prog","Functions","Fun","","",""],
			["00000000000000001000","10000000000000000020","Tik.Device.Users","DvUs","DUsr","","",""], //the users as registered for this device
			["00000000000000001000","10000000000000000050","Tik.Core.Layup","IAD","IAD","H","",""],
			["00000000000000001000","10000000000000000060","Tik.Core.Layup","TP","NTP","G","",""],
			["00000000000000001000","10000000000000000065","Tik.Core.Layup","Drawer","Drw","T","Name","Name"],
			["00000000000000001000","10000000000000000070","Tik.Core.Layup","Folder","Fol","U","Name","Name"],
			["00000000000000001000","10000000000000000075","Tik.Core.Layup","Sheet","Sht","V","Name","Name"],
			["00000000000000001000","10000000000000000080","Tik.Core.Layup","Form","Frm","W","Name","Name"],
			["00000000000000001000","10000000000000000085","Tik.Core.Layup","Field","Fld","Y","Name","Form"],
			["00000000000000001000","10000000000000000090","Tik.Core.Layup","Page","Pag","M","Name","Name"],
			["00000000000000001000","10000000000000000095","Tik.Core.Layup","WIBL","WIB","N","Name","Name"],
			["00000000000000001000","10000000000000000100","Tik.Core.Layup","Record","Rcd","K","",""],
			["00000000000000001000","10000000000000000105","Tik.Core.Layup","Loadup","Ldr","L","",""],					// last good copy of entire Tik
			["00000000000000001000","10000000000000000110","Tik.Core.Layup","Descriptor","Desc","D","",""],			//New ZTD
			["00000000000000001000","10000000000000000115","Tik.Core.Info","Abbrev","Abb","","","XSL"],					//XSL
			["00000000000000001000","10000000000000000120","Tik.Core.Info","Linking","Lnk","","","XLT"],				//XLT
			["00000000000000001000","10000000000000000125","Tik.Core.Info","Forms","Fom","","","ZTD"],					//ZTD
			["00000000000000001000","10000000000000000130","Tik.Core.Info","Personality","Psn","","","ZWH"],	 	//ZWH			
			["00000000000000001000","10000000000000000135","Tik.Where.Net","Places","Pla","","",""], //This Net table (master copy)
			["00000000000000001000","10000000000000000140","Tik.Vars.Page","MoTD","Mtd","","",""], //access to MoTD fields on Start page
			["00000000000000001000","10000000000000000145","Tik.CSS","CSS","Css","","",""],
			["00000000000000001000","10000000000000000150","Tik.Core.Pics","Pics","Pics","","",""],
					
			["00000000000000002000","10000000000000000250","Tik.Relate.Map","RMap","Rmp","","",""],
			["00000000000000002000","10000000000000000260","Tik.Relate.Types","RType","Rtp","","",""],	
			["00000000000000002000","10000000000000000000","Tik.Data","Data","Data","","",""],
			]},
//	"Work":{
//		"Dev":{}
//	},
	"Vars":{
		"AutoRefresh":"",
		"CallTP":[],
		"HomeDat":[],
		"D2F":[],			//Data to Form array - data waiting to be displayed in appropriate form holder
		"Form":[],
		"Forms":[],
		"Photo":{},
		"Page":{
			"Start":{
				"Motd":"No MotD - today",
				"Status":"Status Info - Network availability, Services, Operations etc.",
				"Comment":"Any General comments about OurWorld"
			}	
		},
		"Grid":{
			"Value":"",
			"Title":[],
			"Head":[],
			"Attach":""},
		"Spread":["Tik"]
	},
	"Data":{},
	"Relate":{
		"Types":{
			"Entity":{
				"AKA":"", "Name":"", "Geo-Loc":"", "Address":"", "Phone":"", "OW-Msg":"", "VOIP":"", "Email":"", "Preferred":"" 
				},
			"Service":{},
			"Project":{},
			"Event":{},
			"Enterprise":{},
			"Vehicle":{},
			"Property":{}
			
		},
		"Map":[
			{}
		]
	},
	"User":{
		"UID":"12345678901234567890",
		"Pass":"22",
		"REP":"00000000000000001023",
		"Auth":"98765432109876543210",
		"POA":"22",
		"PAN":"public-address-name",		
		"CSS":{},										//Users changes to standard CSS are in here
		"DeviceNumber":"0",					//The entities device number (each of their IADs has a number from OurWorld first=0)		
		"Personality":[],						//Floor 	-Q- The Personality options avail to the entity
		"Representation":{},				//Room 		-R- The Representative options available to the entity
		"Job":{},										//Cabinet	-S- The Job options available to the entity
		"Geo":{},
		"Position":[],
		"PersPhoto":"",
		"Config":{
			"Numbers":{
				"Seperator":",",
				"SepChars":3,
				"Decimal":"."},
			"Country":{
				"Currency":{
					"Name":"Dollar",
					"NameShort":"NZD",
					"Symbol":"$"},
				"Name":"New Zealand",
				"NameShort":"NZ",
				"Name3":"NZL",
				"Name2":"NZ",
				"Phone":"+64"},
			"Tax":{
				"Personal":{
					"Income":"NZL-PAYE",
					"Spend":"NZL-GST",
					"Profit":"NZL-Corp"},
				"Company":{
					"Income":"NZL-Corp",
					"Spend":"NZL-GST",
					"Profit":"NZL-Corp"}},
			"Styles":{}
			
		}
	},
	"ETI":{
		"Details":{
			"Cust":"",
			"Pass":"",
			"Device":"",
			"PID":""},
		"Trans":{},
		"Person":{},
		"LastK":{
			"Bal":"0.000000",
			"Trans":""}
	}
}	
	/**/

// =============================================================================
//Registration Page
}
if(!window.AddIn){window.AddIn = {}}; 
