-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinc_body_script_home.php
executable file
·82 lines (71 loc) · 3.1 KB
/
inc_body_script_home.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<script src="js/jquery.min.js" async onload="startIt()"></script>
<script type="text/javascript">
function startIt(lang="None"){
$("#menu_bio").click(function() { $('html, body').animate({scrollTop: $("#opt_bio").offset().top}, 1000); });
$("#menu_cons").click(function() { $('html, body').animate({scrollTop: $("#opt_cons").offset().top}, 1000); });
$("#menu_solu").click(function() { $('html, body').animate({scrollTop: $("#opt_solu").offset().top}, 1000); });
$("#menu_cont").click(function() { $('html, body').animate({scrollTop: $("#footer_contact").offset().top}, 1000); });
$("#year").text(new Date().getFullYear());
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
myObj = JSON.parse(this.responseText);
//document.title = myObj.title;
//$("#title").text(myObj["title"]);
$("#subtitle1").text(myObj["subtitle1"]);
/*$("#subtitle2").text(myObj["subtitle2"]);*/
$("#menu_bio").text(myObj["about_title"]);
$("#menu_cons").text(myObj["services_title"]);
$("#menu_solu").text(myObj["methods_title"]);
$("#menu_cont").text(myObj["footer_contact"]);
$("#opt_bio").text(myObj["about_title"]);
$("#about_content1").text(myObj["about_content1"]);
$("#about_content2").text(myObj["about_content2"]);
$("#about_content3").text(myObj["about_content3"]);
$("#about_prof_title").text(myObj["about_prof_title"]);
$("#about_prof_content").text(myObj["about_prof_content"]);
$("#about_curr_title").text(myObj["about_curr_title"]);
$("#about_curr_content").text(myObj["about_curr_content"]);
$("#about_curr_content").attr("href", myObj["about_curr_link"]);
$("#opt_cons").text(myObj["services_title"]);
$("#serv_develop_title").text(myObj["serv_develop_title"]);
$("#serv_develop_content").text(myObj["serv_develop_content"]);
$("#serv_consult_title").text(myObj["serv_consult_title"]);
$("#serv_consult_content").text(myObj["serv_consult_content"]);
$("#serv_research_title").text(myObj["serv_research_title"]);
$("#serv_research_content").text(myObj["serv_research_content"]);
$("#footer_contact").text(myObj["footer_contact"]);
$("#footer_follow").text(myObj["footer_follow"]);
$("#footer_about").text(myObj["footer_about"]);
type(myObj["title"], 0);
}
};
if(lang == "None"){
var language = window.navigator.userLanguage || window.navigator.language;
if(language.indexOf("pt") < 0){
xmlhttp.open("GET", "lang/lang_en.txt", true);
}else{
xmlhttp.open("GET", "lang/lang_pt.txt", true);
}
}
else if(lang == "PT"){
xmlhttp.open("GET", "lang/lang_pt.txt", true);
}else{
xmlhttp.open("GET", "lang/lang_en.txt", true);
}
xmlhttp.send();
}
function loadPT(){
startIt("PT");
}
function loadEN(){
startIt("EN");
}
function type(string, index){
var val = string.substr(0, index + 1);
$("#title").text(val)
if (index < string.length) {
setTimeout(function(){ type(string, index + 1); }, Math.random() * 250);
}
}
</script>