/*jslint browser:true */ /*global $, jQuery, alert*/ function getHomeName() { "use strict"; return 'the_page'; } function showPageName() { "use strict"; return 'show-page'; } function checkPage(page) { "use strict"; var path; path = window.location.href.split("/").pop(); return (path === "" || path === page || path === page + '#' || path.length === 2); } function whatsup1(message) { "use strict"; document.getElementById('whatsup1').innerHTML = message; } function whatsup2(message) { "use strict"; document.getElementById('whatsup2').innerHTML = message; } function getSelectValues(params) { "use strict"; var select, result = [], options, opt, i, iLen; if (params.id !== undefined && params.id !== null) { select = document.getElementById(params.id); } else if (params.name !== undefined && params.name !== null) { select = $('[name =' + params.name + ']').get()[0]; } else if (params.obj !== undefined && params.obj !== null) { select = params.obj; } options = select && select.options; if (options !== null) { for (i = 0, iLen = options.length; i < iLen; i += 1) { opt = options[i]; if (opt.selected) { if (params.ref) { result.push(opt.text || opt.value); } else { result.push(opt.value || opt.text); } } } } return result; } function showMe(params) { "use strict"; var me, test; if (params.id !== undefined && params.id !== null) { me = document.getElementById(params.id); } else if (params.name !== undefined && params.name !== null) { test = "[name=" + params.name + "]"; me = $(test).get()[0]; } else if (params.obj !== undefined && params.obj !== null) { me = params.obj; } if (me !== null && me !== undefined) { me.style.display = 'inline'; } return true; } function blockMe(params) { "use strict"; var me, test; if (params.id !== undefined && params.id !== null) { me = document.getElementById(params.id); } else if (params.name !== undefined && params.name !== null) { test = "[name=" + params.name + "]"; me = $(test).get()[0]; } else if (params.obj !== undefined && params.obj !== null) { me = params.obj; } if (me !== null && me !== undefined) { me.style.display = 'block'; } return true; } function hideMe(params) { "use strict"; var me, test; if (params.id !== undefined && params.id !== null) { me = document.getElementById(params.id); } else if (params.name !== undefined && params.name !== null) { test = "[name=" + params.name + "]"; me = $(test).get()[0]; } else if (params.obj !== undefined && params.obj !== null) { me = params.obj; } if (me !== null && me !== undefined) { me.style.display = 'none'; } return true; } function removeMe(params) { "use strict"; var me, test; if (params.id !== undefined && params.id !== null) { me = document.getElementById(params.id); } else if (params.name !== undefined && params.name !== null) { test = "[name=" + params.name + "]"; me = $(test).get()[0]; } else if (params.obj !== undefined && params.obj !== null) { me = params.obj; } if (me !== null && me !== undefined) { me.parentNode.removeChild(me); } return true; } function removeIt(obj) { "use strict"; obj.parentNode.removeChild(obj); return true; } function setMyValue(id, value) { "use strict"; document.getElementById(id).value = value; return true; } function getMyValue(id) { "use strict"; return document.getElementById(id).value.trim(); } function deleteMyData(obj) { 'use strict'; var the_keys, ref, i; the_keys = Object.keys(obj.dataset); for (i = 0; i < the_keys.length; i += 1) { ref = 'data-' + the_keys[i]; obj.removeAttribute(ref); } } function forumWait() { 'use strict'; $('#forum-box').spin({ lines: 18, // The number of lines to draw length: 14, // The length of each line width: 9, // The line thickness radius: 30, // The radius of the inner circle color: '#fff', // #rgb or #rrggbb speed: 1, // Rounds per second trail: 60, // Afterglow percentage shadow: false // Whether to render a shadow }); } function forumGo() { 'use strict'; $('#forum-box').spin(false); }