var ST_Engine=function(){this.settings=new Array();this.plugins=new Array();}
ST_Engine.prototype={init:function(settings){var fileLocation="";var listScripts=document.getElementsByTagName("script");if(listScripts.length>0){for(a in listScripts){var src=listScripts[a].src;if(typeof(src)!="undefined"&&src!=null){if(src.indexOf("ST_Engine")>-1){fileLocation=listScripts[a].src;}}}
if(fileLocation!=""){fileLocation=fileLocation.replace("ST_Engine.js","");}}
this._def("pluginPath",fileLocation+"Plugins/");this._def("basePath",fileLocation);this._def("xmlWaiting",false);this._def("applicationPath",fileLocation+"Application/");this._def("ObjectWithValues",["input"]);if(typeof(settings)!="undefined"){for(names in settings){this._def(names,settings[names]);}}},_def:function(key,val){if(typeof(key)!="undefined"&&typeof(val)!="undefined"){this.settings[key]=val;}},addPlugins:function(key,path){if(typeof(key)!="undefined"){if(typeof(path)=="undefined"){path="pluginPath";}
if(typeof(this.plugins[key])=="undefined"){this.plugins[key]=key;document.write('<sc'+'ript language="javascript" type="text/javascript" src="'+this.getSetting(path)+key+'/'+key+'.js"></script>');}}},getSetting:function(key){var value=null;if(typeof(this.settings[key])!="undefined"){value=this.settings[key];}
return value;},_getUrlParam:function(){var url=document.location.href;var param="";if(url.indexOf("#")>0){param=url.substring((url.indexOf("#")+1),url.length);}
return param;},hasValue:function(arrOrVal,val){if(this.isObject(arrOrVal)&&this.isString(val)){for(a in arrOrVal){if(this.equalsIgnoreCase(arrOrVal[a],val)){return true;}}}else if(this.isString(arrOrVal)&&this.isString(val)){if(arr.indexOf(arrOrVal)>-1){return false;}}
return false;},compare:function(val1,val2){var val=0;if(typeof(val1)=="number"&&typeof(val2)=="number"){if(val1<val2){val=-1;}else if(val1>val2){val=1;}}
return val;},equals:function(val1,val2,ignoreCase){if(typeof(ignoreCase)=="undefined"){ignoreCase=false;}
if(typeof(val1)=="string"&&typeof(val2)=="string"){if(ignoreCase){if(val1.toLowerCase()==val2.toLowerCase()){return true;}}else{if(val1==val2){return true;}}}
return false;},equalsIgnoreCase:function(val1,val2){return this.equals(val1,val2,true)},eventHandle:function(event,funct){if(this.isString(event)&&this.isString(funct)){if(this.isObject(window.attachEvent)){window.attachEvent(event,funct);}else if(window.attachEventListener){window.attachEventListener(event,funct);}else{setTimeout(funct,1000);}}},isEmpty:function(str){if(this.isString(str)){if(str.length>0){return false;}
return true;}},getAllTagWith:function(tag){if(this.isString(tag)){return document.getElementsByTagName(tag);}},isObject:function(obj){if(this.equalsIgnoreCase(typeof(obj),"object")&&obj!=null){return true;}
return false;},isString:function(str){if(this.equalsIgnoreCase(typeof(str),"string")){return true;}
return false;},switchSelectBox:function(src,dest){if(this.isObject(src)&&this.isObject(dest)){if(this.equalsIgnoreCase(src.nodeName,"select")&&this.equalsIgnoreCase(dest.nodeName,"select")){for(i=0;i<src.options.length;i++){if(src.options[i]&&src.options[i].selected){dest.options[dest.options.length]=new Option(src.options[i].text,src.options[i].value);src.remove(i);i--;var _attibuteGroupName="";if(src.id.indexOf("_from")>-1&&src.options.length==0)
{_attibuteGroupName=(src.id).split("_from")[0];document.getElementById(_attibuteGroupName+"_btr").className="button disabled";document.getElementById(_attibuteGroupName+"_btr").setAttribute('disabled','true');}
else if(src.id.indexOf("_to")>-1&&src.options.length==0)
{_attibuteGroupName=(src.id).split("_to")[0];document.getElementById(_attibuteGroupName+"_btl").className="button disabled";document.getElementById(_attibuteGroupName+"_btl").setAttribute('disabled','true');}
if(src.id.indexOf("_from")>-1)
{_attibuteGroupName=(src.id).split("_from")[0];if(document.getElementById(_attibuteGroupName+"_to").options.length>0)
{document.getElementById(_attibuteGroupName+"_btl").className="button";document.getElementById(_attibuteGroupName+"_btl").removeAttribute('disabled',0);}}
else if(src.id.indexOf("_to")>-1)
{_attibuteGroupName=(src.id).split("_to")[0];if(document.getElementById(_attibuteGroupName+"_from").options.length>0)
{document.getElementById(_attibuteGroupName+"_btr").className="button";document.getElementById(_attibuteGroupName+"_btr").removeAttribute('disabled',0);}}}}}}}}
var ST_Class=new ST_Engine();
