92 lines
1.7 KiB
JavaScript
92 lines
1.7 KiB
JavaScript
// JavaScript Document
|
|
|
|
var filesadded="" //list of files already added
|
|
|
|
function checkloadjscssfile(filename, filetype){
|
|
if (filesadded.indexOf("["+filename+"]")==-1){
|
|
|
|
if(filetype=="js")
|
|
{
|
|
loadjsfile(filename);
|
|
}
|
|
if(filetype=="css")
|
|
{
|
|
loadCSS(filename);
|
|
}
|
|
|
|
filesadded+="["+filename+"]" ;//List of files added in the form "[filename1],[filename2],etc"
|
|
}
|
|
else
|
|
{
|
|
// alert("file already added!" + filename)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function loadcssfile(href)
|
|
{
|
|
|
|
$.ajax({
|
|
url: href,
|
|
cache: false,
|
|
async: true,
|
|
dataType: 'text',
|
|
success: function(data) {
|
|
$('<style type="text/css">\n' + data + '</style>').appendTo("head");
|
|
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function showhome()
|
|
{
|
|
$('#s1').css('display','none');
|
|
$('#s2').css('display','none');
|
|
$('#s3').css('display','none');
|
|
$('#content').css('display','block');
|
|
}
|
|
function loadsection(url,section,css){
|
|
if(typeof url == 'undefined') { url = '';}
|
|
if(typeof css == 'undefined') { css = '';}
|
|
thesection=section + "d";
|
|
$.ajax({
|
|
url: url,
|
|
type: 'GET',
|
|
data:{},
|
|
cache: false,
|
|
async: true,
|
|
success: function(data) {
|
|
|
|
$('#content').css('display','none');
|
|
var sectionpad=(menuheight+0)+"px";
|
|
if(css=="")
|
|
{
|
|
}
|
|
else
|
|
{
|
|
checkloadjscssfile(css,'css');
|
|
}
|
|
$('#'+thesection+'').html(data);
|
|
$('#s1').css('display','none');
|
|
$('#s2').css('display','none');
|
|
$('#s3').css('display','none');
|
|
$('#'+section).css('display','block');
|
|
// Setter
|
|
$( ".info" ).tooltip({tooltipClass: "custom-tooltip-styling"});
|
|
$('.initial').focus();
|
|
|
|
|
|
|
|
|
|
},
|
|
error: function(resp, textStatus, errorThrown){
|
|
//alert(resp);
|
|
}
|
|
});
|
|
}
|
|
|