SPolygon = function(id,ctype,subtype,name,color,polycenter,overlay,lng,continent,territory,region,place,count,lat){ eval(defaults(arguments, 0, 0,"", "","","","","","","","","","","")); this.id = id; this.ctype = ctype; this.subtype = subtype; this.name = name; this.color = color; this.polycenter = polycenter; this.overlay = overlay; this.lng = lng; this.continent = continent; this.territory = territory; this.region = region; this.place = place; this.count = count; this.lat = lat; } SPolygon.prototype.getID= function(){ return this.id; } SPolygon.prototype.getCuurentType= function(){ return this.ctype; } SPolygon.prototype.getSubscripType= function(){ return this.subtype; } SPolygon.prototype.getName= function(){ return this.name; } SPolygon.prototype.getColor= function(){ return this.color; } SPolygon.prototype.getPolygonCenter= function(){ return this.polycenter; } SPolygon.prototype.getOverlay= function(){ return this.overlay; } SPolygon.prototype.getLng= function(){ return this.lng; } SPolygon.prototype.getContinent= function(){ return this.continent; } SPolygon.prototype.getTerritory= function(){ return this.territory; } SPolygon.prototype.getRegion= function(){ return this.region; } SPolygon.prototype.getPlace= function(){ return this.place; } SPolygon.prototype.getCount= function(){ return this.count; } SPolygon.prototype.getLat= function(){ return this.lat; } function defaults(passed) { var pattern = /function[^(]*\(([^)]*)\)/; var args = passed.callee.toString().match(pattern)[1].split(/\s*,\s*/); var str = "", i = 1; for ( ; i < arguments.length; i++) { if (typeof passed[i-1] == "undefined") { str += args[i-1] + "=" + fix(arguments[i]) + ";"; } } return str; function fix(x) { if (typeof x == "string") return "'" + x.replace(/\'/g, "\\'") + "'"; return x; } }