﻿function systemTest()
{
    alert("system.js has been found");
}

function returnObjById( id ) 
{ 
    if (document.getElementById) 
        var returnVar = document.getElementById(id); 
    else if (document.all) 
        var returnVar = document.all[id]; 
    else if (document.layers) 
        var returnVar = document.layers[id]; 
    return returnVar; 
}

function changeElementVisibility(elementId, visibility) {
      var a = elementById(elementId);
      a.style.visibility = visibility;
}

//String Functions - start
String.prototype.fromCamelCase = function() 
{ 
    return this.replace(/([A-Z])(?=[^A-Z])/g," $1");
}

String.prototype.toCamelCase = function() 
{  
    return this.toString()
        .replace(/([A-Z]+)/g, function(m,l){
            return l.substr(0,1).toUpperCase() + l.toLowerCase().substr(1,l.length);
        })
        .replace(/[\-_\s](.)/g, function(m, l){
            return l.toUpperCase();
        });
};
//String Functions - end


//Array Functions - start
function isArray(obj) {
    return obj.constructor == Array;
} 
//Array Functions - end


function changeCSSClass(objectId, cssClassName)
{
    var obj = returnObjById(objectId);
    obj.className = cssClassName;
}

function getURLParameter( name )
{
      var strReturn = "";

      name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
      var regexS = "[\\?&]"+name+"=([^&#]*)";
      var regex = new RegExp( regexS );
      var results = regex.exec( window.location.href );
      if( results == null ) {
          strReturn = "";
      }
      else {
          strReturn = results[1];
      }

      //alert(unescape(strReturn));
      return unescape(strReturn);
}


function openPopUp(url, name, height, width, top, left, location, toolbar, menubar, resizable ) { // alert('height='+height+',width='+width+',top='+top+',left='+left+',location='+location+',toolbar='+toolbar+',menubar='+menubar+',resizable='+resizable);

window.open(url,name,'height='+height+',width='+width+',top='+top+',left='+left+',location='+location+',toolbar='+toolbar+',menubar='+menubar+',resizable ='+resizable);
}


function goToURL(url)
{
      window.location = url;
}

