PageSourceSearch

http://www.activa.com.au/js/functions.js

js activa.com.au collected 2026-10-06 13:15:16 UTC 3,173 bytes, 144 lines download raw bytes

1// JavaScript Document
2
3function hideuserdialog()
4{
5	$( "#dialogLoading" ).dialog( "close" );
6}
7
8function displayMessage(id,type,title,msg)
9{
10	
11	var outherClass="ui-state-highlight";
12	var iconClass="ui-icon-info";
13	
14	if(type=="error")
15	{
16		outherClass="ui-state-error";
17		iconClass="ui-icon-alert";
18	}
19
20	var temp='<div class="'+outherClass+' ui-corner-all" style="margin-top: 0px; padding: 0pt 0.7em;"> ';
21		temp+='				<p><span class="ui-icon '+iconClass+'" style="float: left; margin-right: 0.3em;"></span>';
22		temp+='						<strong>'+title+'</strong> '+msg+'</p>		';	
23		temp+='	</div>';
24							
25	$("#"+id).html(temp); 
26	
27}
28
29
30function showuserdialog()
31{
32	
33	$( ".ui-dialog-titlebar" ).each(function(){
34
35			if( $(this).parent().html().indexOf('loading') >0)
36			{
37				$(this).remove();	
38			}
39      });
40	$( "#dialogLoading" ).dialog( "open" ); 
41	
42}
43
44function userdialog(boxtitle,msg,button,functionname)
45	 {
46		 try{
47		 
48		 	$( "#dialog" ).dialog( "option", "title", boxtitle );
49			$( "#dialog" ).dialog( "option", "zIndex", 999999 );
50			$( "#dialog" ).dialog( "option", "position", ['','100'] );
51			$( "#dialog" ).dialog( "open" );
52			document.getElementById('dialog_msg').innerHTML=msg;
53			 
54			var buttons = $( ".selector" ).dialog( "option", "buttons" );
55		
56		//setter
57			$( "#dialog" ).dialog( "option", "buttons", [
58				{
59					text: "Ok",
60					click: function() {
61						if (button==100)
62						{
63							 functionname(); 
64						}
65						$(this).dialog("close"); }
66				}
67			] );
68			
69			if (button==1)
70			{
71				$( "#dialog" ).dialog( "option", "buttons", [
72					{
73						text: "Yes",
74						click: function() { functionname(); $(this).dialog("close"); return true; }
75					},
76					{
77						text: "No",
78						click: function() { $(this).dialog("close");return false; }
79					}
80				] )
81			}
82			
83		 }catch(Err)
84		 {
85			alert(msg,"",boxtitle);
86		}
87				//$( "#dialog" ).dialog( "option", "position", [0,100] );
88			// $( "#dialog" ).notify("This dialog will stay");
89			
90			return false;
91 	}
92	
93	
94
95function trim(str, chars) {
96	return ltrim(rtrim(str, chars), chars);
97}
98 
99function ltrim(str, chars) {
100	chars = chars || "\\s";
101	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
102}
103 
104function rtrim(str, chars) {
105	chars = chars || "\\s";
106	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
107}
108
109function dateComparisontmp(date_from,date_to){
110	   
111	   try{
112	    var str1 = date_from.split("/");
113		var str2 = date_to.split("/");
114		
115		//alert(str1[1].charAt(0));
116		if(str1[1].charAt(0)=="0"){
117			str1[1] = str1[1].substring(1,2);
118		}
119		//alert(str1[1]);
120		var dt1  = parseInt(str1[1]); 
121		var mon1 = parseInt(str1[0]-1);
122		var yr1  = parseInt(str1[2]); 
123		
124		if(str2[1].charAt(0)=="0"){
125			str2[1] = str2[1].substring(1,2);
126		}
127		var dt2  = parseInt(str2[1]); 
128		var mon2 = parseInt(str2[0]-1); 
129		var yr2  = parseInt(str2[2]); 
130		
131		var date1 = new Date(yr1, mon1, dt1); 
132		var date2 = new Date(yr2, mon2, dt2); 
133		
134		//alert(date1);
135		
136		if(date2 < date1){
137			return false;
138		}else{
139			return true;	
140		}
141	
142	   }catch (ERR)
143	   {}
144}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.