PageSourceSearch

https://www.socialmotus.com/scripts/main.js

js socialmotus.com collected 2026-10-04 21:14:14 UTC 4,193 bytes, 164 lines download raw bytes

1/*!
2 * Copyright (c) 2012, socialmotus
3 * 
4 */
5
6$(document).ready(function () {
7	var loc = window.location.href;
8    var iPos = loc.indexOf("cid=");
9   if (iPos > 10 && loc.length > 15) {
10	  var id=loc.substring(loc.indexOf("cid=")+4,loc.length);
11	   if (!isNaN(id)) {
12			// $("#accountid").val(id);   
13			document.forms["submitform"]["accountid"].value = id;
14	   }
15    }
16	
17	// --- set white label redirection to login page
18	if (loc.indexOf("socialmotus.com") == -1) {
19		window.location.href = loc + "login";
20	}
21	
22})
23	
24	
25 function SetRef(loc) {
26   var iPos = loc.indexOf("sid=");
27   if (iPos > 10 && loc.length > 15) {
28	  var id=loc.substring(loc.indexOf("sid=")+4,loc.length);
29	   if (!isNaN(id)) {
30			SetCookie("refagent",id,60);   
31	   }
32   }
33  }
34 
35function SetCookie(cookieName,cookieValue,nDays) {
36	 var today = new Date();
37	 var expire = new Date();
38	 if (nDays==null || nDays==0) nDays=30;
39	 expire.setTime(today.getTime() + 3600000*24*nDays);
40	 document.cookie = cookieName+"="+escape(cookieValue)
41					 + ";expires="+expire.toGMTString();
42}
43
44
45function getCookie(Name) 
46	 {
47		 var search = Name + "="
48		 if (document.cookie.length > 0) { 
49			 // if there are any cookies
50			 offset = document.cookie.indexOf(search)
51			 if (offset != -1) { 
52				 // if cookie exists
53				 offset += search.length
54
55				 // set index of beginning of value
56				 end = document.cookie.indexOf(";", offset)
57
58				 // set index of end of cookie value
59				 if (end == -1)
60					 end = document.cookie.length
61
62				 return unescape(document.cookie.substring(offset, end))
63			 }
64		 }
65	 }
66
67function ValidateForm(){
68        var oForm = document.forms[0];	                
69		var mainmessage=' and then press the Submit button.';
70
71		var x=document.forms["submitform"]["name"].value;
72		if ((x==null)||(x==""))
73		{
74   		   alert('Please enter your name' + mainmessage)
75		   document.forms["submitform"]["name"].focus()
76		   return false;
77		}
78		
79		x=document.forms["submitform"]["email"].value;
80		if ((x==null)||(x==""))
81		{
82   		   alert('Please enter your e-mail address' + mainmessage)
83		   document.forms["submitform"]["email"].focus()
84  		   return false;
85		}
86		if (echeck(x)==false)
87		{
88		   document.forms["submitform"]["email"].focus()
89		   return false;
90		}
91		// if ((oForm.Telephone.value==null)||(oForm.Telephone.value==""))
92		// {
93   		//    alert('Please enter your Phone number' + mainmessage)
94		//    oForm.Telephone.focus()
95		//   return false;
96		// }
97		
98		// if ((oForm.State.value==null)||(oForm.State.value==""))
99		// {
100   		//    alert('Please enter State where you live' + mainmessage)
101		//    oForm.State.focus()
102		//    return false;
103		// }
104		
105		x=document.forms["submitform"]["message"].value;		
106		if ((x==null)||(x==""))
107		{
108   		   alert('Please enter your message' + mainmessage)
109		   document.forms["submitform"]["message"].focus()
110		   return false;
111		}
112		return true;	
113}
114
115function echeck(str) {
116        // Function to validate e-mail address to the following format:
117		// [email protected]
118		var at="@"
119		var dot="."
120		var lat=str.indexOf(at)
121		var lstr=str.length
122		var ldot=str.indexOf(dot)
123		var message='Invalid Email address. \n\nPlease enter a valid E-mail address then click the Submit button';
124		if (str.indexOf(at)==-1){
125		   alert(message)
126		   return false
127		}
128		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
129		   alert(message)
130		   return false
131		}
132		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
133		    alert(message)
134		    return false
135		}
136      	    if (str.indexOf(at,(lat+1))!=-1){
137		    alert(message)
138		    return false
139		}
140      	    if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
141		    alert(message)
142		    return false
143		}
144 	        if (str.indexOf(dot,(lat+2))==-1){
145		    alert(message)
146		    return false
147 	        } 
148		if (str.indexOf(" ")!=-1){
149		    alert(message)
150		    return false
151		}
152		return true					
153	}
154	
155$(document).ready(function(){
156	var loc = window.location.href;
157    var iPos = loc.indexOf("cid=");
158    if (iPos > 10 && loc.length > 15) {
159	  var id=loc.substring(loc.indexOf("cid=")+4,loc.length);
160	   if (!isNaN(id)) {
161			$("#accountid").val(id);   
162	   }
163    }
164});

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.