4d87479d59b739856a7573c2de5d3b1d7bdd954225880b26ad4b17f0741a730a
Source Code:
var IE = document.all ? true : false;
var main = {
page: '',
errMsg: '',
loadPage: function(targetPage, args, div) {
if (targetPage.length > 0) {
this.page = (targetPage.search('.php') > -1) ? targetPage : targetPage+'.php';
}
$.ajax(
{
type: "POST",
url: main.page,
data: 'req=1&'+args,
success: function(html) {
$("#"+div).html(html);
},
error: function() {
$("#"+div).html(main.errMsg);
}
}
);
},
}
//
// Home page carosel
//
$(document).ready(
function() {
// Selection objects for carosel display
if (window.location.pathname.search(/\/$|\/index\.php$/) > -1) {
$("#prev").hide();
}
}
);
var home = {
oldTime: 0,
selectorPostition: 0,
currLocation: window.location.href,
urlPattern: /\?/,
selectFirst: function(mouse) {
$("#selector").css({left:"0px"});
$("#slide-1").css({left:"0px"});
$("#slide-2").css({left:"965px"});
$("#slide-3").css({left:"1930px"});
$("#next").show();
$("#prev").hide();
if (mouse) {
this.selectorPostition += mouse;
} else {
this.selectorPostition = 0;
}
},
selectSecond: function(mouse) {
$("#selector").css({left:"322px"});
$("#slide-1").css({left:"-965px"});
$("#slide-2").css({left:"0px"});
$("#slide-3").css({left:"965px"});
$("#next").show();
$("#prev").show();
if (mouse) {
this.selectorPostition += mouse;
} else {
this.selectorPostition = 1;
}
},
selectThird: function(mouse) {
$("#selector").css({left:"644px"});
$("#slide-1").css({left:"-1930px"});
$("#slide-2").css({left:"-965px"});
$("#slide-3").css({left:"0px"});
$("#next").hide();
$("#prev").show();
if (mouse) {
this.selectorPostition += mouse;
} else {
this.selectorPostition = 2;
}
},
mouseSelectRight: function() {
switch (this.selectorPostition)
{
case 0:
this.selectSecond(1);
break;
case 1:
this.selectThird(1);
break;
}
},
mouseSelectLeft: function() {
switch (this.selectorPostition)
{
case 2:
this.selectSecond(-1);
break;
case 1:
this.selectFirst(-1);
break;
}
},
}
$(document).keydown(
function(event) {
if (home.oldTime === 0) {
home.oldTime = event.timeStamp;
}
if (event.timeStamp - home.oldTime > 100 || event.timeStamp - home.oldTime === 0) { // check to see if key was pressed within 1 second -- prevents size from going too small
home.oldTime = event.timeStamp;
switch (event.which) {
case 37:
if ($("#selector").position().left > 10) {
home.mouseSelectLeft();
}
break;
case 39:
if ($("#selector").position().left < 1000) {
home.mouseSelectRight();
}
break;
case 13:
switch (parseInt($("#selector").css("left"))) {
case 0:
window.location.assign($("#learn_focused").attr("href"));
break;
case 322:
window.location.assign($("#learn_agile").attr("href"));
break;
case 644:
window.location.assign($("#learn_multifaceted").attr("href"));
break;
}
break;
}
}
}
);
// for IE8
if(!document.getElementsByClassName) {
document.getElementsByClassName = function(className) {
return this.querySelectorAll("." + className);
};
Element.prototype.getElementsByClassName = document.getElementsByClassName;
}
//
// Knowledgebase filter object
//
var choices = {
choices: {'version': '', 'platform': '', 'keyword': ''},
selectedItems: {},
majorversion: 0,
platform: '',
ev: '',
tClass: '',
tID: '',
altChecked: 0,
setChoice: function(event) {
this.ev = event;
if (event.target.className == '') {
this.tClass = event.target.parentNode.className;
this.tID = event.target.parentNode.id;
} else {
this.tClass = event.target.className;
this.tID = event.target.id;
}
$('.selected.'+this.tClass).removeClass('selected');
$('#'+this.tID).addClass('selected');
this.getChoices();
},
getChoices: function() {
this.selectedItems = $('.selected[class*="Choice"]');
for (var i = 0; i < this.selectedItems.length; i++) {
var val = (this.selectedItems[i].value != '') ? this.selectedItems[i].value : this.selectedItems[i].id;
this.choices[this.selectedItems[i].className.replace(/Choice/, '').replace(/selected/, '').trim()] = encodeURI(val);
}
this.getVersion()
this.getPlatform()
this.choices['keyword'] = $(':input[name=keyword]').val();
this.post();
$(":input[name=keyword]").focus();
},
search: function(submit) {
this.choices['keyword'] = $(':input[name=keyword]').val();
if (submit) {
this.getChoices();
// this.post();
}
},
checkAlt: function(event) {
if (parseInt(event.target.value) == 1) {
if ($("#"+event.target.id)[0].checked) {
this.altChecked ++;
} else {
this.altChecked --;
}
}
if (this.altChecked > 0) {
$("#altMsg").show();
} else {
$("#altMsg").hide();
}
},
getVersion: function() {
this.majorversion = $(':input[name="selectedversion"]').val();
if (this.majorversion != null && this.majorversion.length > 0 && this.choices['version'].length == 0) {
this.choices['version'] = this.majorversion;
}
},
getPlatform: function() {
this.platform = $(':input[name="selectedplatform"]').val();
if (this.platform != null && this.platform.length > 0 && this.choices['platform'].length == 0) {
this.choices['platform'] = this.platform;
}
},
download: function() {
var formats = '';
this.getVersion()
this.getPlatform()
var selection = $(':input:checkbox:checked');
if (selection.length == 0) {
var a = "You must select at least one format";
alert(a);
} else {
for (var i = 0; i < selection.length; i++) {
formats += selection[i].name + ((i < selection.length - 1) ? ',' : '');
}
this.choices['formats'] = formats;
window.location = formatsPath+'?download='+formats+'&platform='+this.choices['platform']+'&version='+this.choices['version'];
}
},
post: function() {
args = [];
for (choice in this.choices) {
args.push([choice, this.choices[choice]].join('='))
}
if (window.location.href.search(/moreformats/) > -1) {
page = formatsPath;
target = 'formats';
} else if (window.location.pathname.search(/download/) > -1) {
page = langPath+'/dl4.php';
target = 'content';
} else if (window.location.pathname.search(/support/) > -1) {
page = langPath+'/support_main.php';
target = 'content';
} else {
page = window.location.pathname;
target = 'content';
}
main.loadPage(page, args.join('&'), target);
}
}
//
// Shop selection
//
function select(event) {
if (typeof event.target != 'undefined') {
var target = event.target;
} else {
var target = event.srcElement;
}
try {
var targetID = target.id;
}
catch (err) {
var targetID = target;
}
try {
var parent = target.parentNode;
}
catch (err) {
var parent = target;
}
var forms = document.forms;
for (var form = forms.length - 1; form >= 0; form--) {
for (var element = forms[form].length - 1; element >= 0; element--) {
if (targetID.length > 0 && forms[form][element].value == targetID) {
var selects = document.getElementsByClassName(target.className);
for (var i = selects.length - 1; i >= 0; i--) {
selects[i].className = selects[i].className.replace("selected", "");
}
target.className += ' selected';
forms[form][element].checked = true;
break;
} else if (parent.id.length > 0 && forms[form][element].value == parent.id) {
var selects = document.getElementsByClassName(parent.className);
for (var i = selects.length - 1; i >= 0; i--) {
selects[i].className = selects[i].className.replace("selected", "");
}
parent.className += ' selected';
forms[form][element].checked = true;
}
}
}
forms[0].submit();
}