function addCommas(nStr) { nStr += ''; x = nStr.split('.'); x1 = x[0]; x2 = x.length > 1 ? '.' + x[1] : ''; var rgx = /(\d+)(\d{3})/; while (rgx.test(x1)) { x1 = x1.replace(rgx, '$1' + ',' + '$2'); } return x1 + x2; } function isInteger(str) { var intRegex = /^\d+$/; return intRegex.test(str); } function getObject(id) { return document.getElementById(id); } function changeImage(a, b) { document.getElementById(b).src=a; } function playSound(soundfile) { document.getElementById("dummy").innerHTML= ""; } function goPage(url) { location.href = url; } function goPageParam(url, url2) { location.href = url + "?url='" + encodeURIComponent(url2) + "'"; } function goBack() { history.back(); } function _ajax( _type, _url, _param ) { if( typeof _param !== 'string' ) { var i = _param.length; var tt = new Date(); _param[i] = tt.toTimeString(); } return $.ajax({ type: _type, url: _url, cache: false, data: { param: _param } }).done(function( msg ) { }); } function ajaxget( _url, _param ) { return _ajax("GET", _url, _param).done(function( msg ) { }); } function ajaxpost( _url, _param ) { return _ajax("POST", _url, _param).done(function( msg ) { }); } function getHeight() { var userAgent = navigator.userAgent.toLowerCase(); var browser = { msie : /msie/.test( userAgent ) && !/opera/.test( userAgent ), safari : /webkit/.test( userAgent ), firefox : /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent ), opera : /opera/.test( userAgent ) }; var totalHeight = 0; if( browser.msie ){ //IE var scrollHeight = document.documentElement.scrollHeight; var browserHeight = document.documentElement.clientHeight; totalHeight = scrollHeight < browserHeight ? browserHeight : scrollHeight; } else if ( browser.safari ){ //Chrome || Safari totalHeight = document.body.scrollHeight; } else if ( browser.firefox ){ // Firefox || NS var bodyHeight = document.body.clientHeight; totalHeight = window.innerHeight < bodyHeight ? bodyHeight : window.innerHeight; } else if ( browser.opera ){ // Opera var bodyHeight = document.body.clientHeight; totalHeight = window.innerHeight < bodyHeight ? bodyHeight : window.innerHeight; } else { totalHeight = 768; } return totalHeight; } function clearPlaceholder(formobj) { $(formobj).find("'[placeholder]'").each(function() { var input = $(this); if (input.val() == input.attr("'placeholder'")) { input.val("''"); } }) } /* $(window).load(function() { $(window).click(function (e) { $('#loginmenu').hide(); } ); $('.menubtn').click(function (e) { //Default mouse Position $('#loginmenu').show(); } ); } ); */ /* $("'[placeholder]'").focus(function() { var input = $(this); if (input.val() == input.attr("'placeholder'")) { input.val("''"); input.removeClass("'placeholder'"); } }).blur(function() { var input = $(this); if (input.val() == "''" || input.val() == input.attr("'placeholder'")) { input.addClass("'placeholder'"); input.val(input.attr("'placeholder'")); } }).blur(); $("'[placeholder]'").parents("'form'").submit(function() { $(this).find("'[placeholder]'").each(function() { var input = $(this); if (input.val() == input.attr("'placeholder'")) { input.val("''"); } }) }); */