var atlasonload = function () { atlas_load();  }
//window.onload = atlasonload;

setTimeout('atlas_control()',3000);
//setTimeout('atlas_load()',3000);

function atlas_control() {
	if (window.onload != atlasonload) {
		atlas_load();
	}
}

var atlasonrun = new Object();
var atlascache = new Object();

var atlasmem = new Object();

var atlas = new Object();
atlas.url = function (id) {
	var url;
	if (atlasmem[id].type == 'thumb') {
		if (atlasmem[id].id == 'drag0') {
			url = pathroot+'/newxml/user_resource.php';
		}
		else {
			if(navigator.appVersion.indexOf("MSIE 6")<0){
			url = pathroot+'/newxml/index.php?'+'caseid='+atlasmem[id].id+'&start='+atlasmem[id].start+'&show='+atlasmem[id].show;
			}else{
				url = pathroot+'/newxml/index.php?'+'caseid='+atlasmem[id].id+'&start='+atlasmem[id].start+'&show=1000';
			}

		}
	}
	else {
		url = pathroot+'/lib/xml/atlas.php?'+'imageid='+atlasmem[id].id;
	}

	return url;
}
atlas.width = 0;
atlas.height = 0;
atlas.images = new Object();
atlas.images.thumb = new Object();
atlas.images.thumb.width = Number(130 + 2);
atlas.images.thumb.height = Number(82 + 2);

function atlas_load() {
	var divs = document.getElementsByTagName('div');
	var i;
	for (i in divs) {
		var div = divs[i];
		if ( div ) {
			if ( div.getAttribute ) {
				var regex = new RegExp(/^atlas_(thumb)_(\w+)_(\w+)$/gi);
				var result = regex.exec(div.getAttribute('id'));
				if (result) {
					var type = result[1];
					var id = String(result[2]);
					var scroll = result[3];

					var obj = document.getElementById('atlas_'+type+'_'+id+'_'+scroll);

					var numpx = new RegExp(/^([0-9]+)px$/gi);
					var result = numpx.exec(obj.style.width);
					atlas.width = Number(result[1]);
					var numpx = new RegExp(/^([0-9]+)px$/gi);
					var result = numpx.exec(obj.style.height);
					atlas.height = Number(result[1]);

					var show;
					if (scroll == 'leftright') {
						show = Math.floor( atlas.width / Number(atlas.images[type].width) );
					}
					else if (scroll == 'topbottom') {
						show = Math.floor( atlas.height / Number(atlas.images[type].height) );
					}

					atlasmem[id] = new Object();
					atlasmem[id].id = id;
					atlasmem[id].show = show * 2;
					atlasmem[id].visible = show;
					atlasmem[id].type = type;
					atlasmem[id].scroll = scroll;
					atlasmem[id].start = 1;
					atlasmem[id].oo = new Object();

					atlas_case(id,scroll,false);
				}
			}
		}
	}
}

var altas_clase_resource_related_num = Number(0);
function altas_clase_resource_related() {
	var inputs = document.getElementsByTagName('input');
	var i;
	for (i in inputs) {
		var input = inputs[i];
		if ( input ) {
			if ( input.getAttribute ) {
				var regex = new RegExp(/^resource/gi);
				var result = regex.exec(input.getAttribute('name'));
				if (result) {
					if (!isNaN(input.value)) {
						if (input.value > altas_clase_resource_related_num)
							altas_clase_resource_related_num = Number(input.value);
					}
				}
			}
		}
	}

	if (altas_clase_resource_related_num > 0)
		altas_clase_resource_related_num++;

}

function atlas_yui_run() {
	if (typeof(main) == 'object') {
		onloadobj.load();
		main.process_resources();
	}
}
function atlas_yui_add(id) {
	if (typeof(main) == 'object') {
		var test = new Array('b',id,'0');
		main.portal.resources.push(test);
	}
}

function atlas_case (id,scroll,load) {

	var html = '';
	var main = document.getElementById('atlas_' + atlasmem[id].type + '_' + id + '_' + scroll);
	var get = new Object();
	var type = atlasmem[id].type;

	get.url = atlas.url(id);
	get.onrun = function(oldxml) {
		if (type == 'thumb') {
			var mdpixx;

			if (oldxml) {
				mdpixx = oldxml;
			}
			else {
				cache_Xml2Array(get.url,get.xml.mdpixx,'add');
				mdpixx = get.xml.mdpixx;
			}
			if (mdpixx && mdpixx.Case_resource_tag && mdpixx.Case_resource_total > 0){
			if (1==1) {
				//alert(mdpixx.Case_resource_tag)
				var resources = mdpixx.Case_resource_tag;
				if (resources.length > 0) {

					if (isNaN(id))
						altas_clase_resource_related();

					if (document.getElementById('atlas_totalresources_'+id))
						document.getElementById('atlas_totalresources_'+id).innerHTML = mdpixx.Case_resource_total + ' ' + mdpixx.resources_lang;

					if (document.getElementById('atlas_additional_' + id)){
						document.getElementById('imgloader1' + id).style.display = 'none';
						if(document.getElementById('imgloader2' + id)){
							document.getElementById('imgloader2' + id).style.display = 'none';
						}
						document.getElementById('atlas_additional_' + id).style.visibility = 'visible';
						}

					var styles = new Object();

					if (scroll == 'leftright') {
						main.style.position = 'relative';
						main.style.overflow = 'hidden';
						main.style.cssFloat = 'left';

						atlasmem[id].maxwidth = atlas.images[type].width * mdpixx.Case_resource_total;
						styles.ul = 'list-style-type: none; overflow: hidden; position: relative; margin: 0px; padding: 0px; width: '+atlasmem[id].maxwidth+'px; left: 0px; top: 0px;';
						styles.li = 'margin: 0px; display: inline; padding-left: 1px; padding-right: 1px;';
					}
					else if (scroll == 'topbottom') {
						document.getElementById('imgloader1' + id).style.display = 'none';
					if(navigator.appVersion.indexOf("MSIE 6") < 0){
					//if(navigator.appName.indexOf("Microsoft") !=-1 && navigator.appVersion.indexOf("MSIE 6")!=-1){
						main.style.position = 'relative';
						main.style.overflow = 'hidden';
						}else{
							main.style.overflow = 'auto';

						}

						main.style.cssFloat = 'none';
						main.style.textAlign = 'center';

						atlasmem[id].maxheight = atlas.images[type].height * mdpixx.Case_resource_total;
						//styles.ul = 'list-style-type: none; overflow: hidden; position: relative; margin: 0px; padding: 0px; height: '+atlasmem[id].maxheight+'px; left: 0px; top: 0px;';

						//if(navigator.appVersion.indexOf("MSIE 6") < 0){
							styles.ul = 'height: '+atlasmem[id].maxheight+'px; position: relative;'

						if(navigator.appVersion.indexOf("MSIE 6") < 0){
						styles.ul = 'height: '+atlasmem[id].maxheight+'px; position: relative;';

						}else{
							styles.ul = 'height: auto;';
						}
						//styles.li = 'align: center; margin: 0px; padding-top: 1px; padding-bottom: 1px;';
						styles.li = '';
					}

					if (load == false) {
						atlasmem[id].total = Number(mdpixx.Case_resource_total);

						var i;
						html += '<ul id="atlas_thumb_'+id+'_list" class="lateralcarrousel" style="'+styles.ul+'">';

						for (i in resources) {

							if (typeof(resources[i]) != 'function') {

								var counter = resources[i]['counter'];

								html += '<li id="resource-'+resources[i].resource_id+'" style="'+styles.li+'">';
									if (!isNaN(id)) {
										html += '<a id="atlas_thumb_'+id+'_'+counter+'_link" href="'+mdpixx.Case_resource_url+'/atlas/view.php?id='+resources[i].resource_id+'">';
									}
									html += '<img id="atlas_thumb_'+id+'_'+counter+'_img" src="'+resources[i][type+'_path']+'" style="margin: 0px; padding: 0px;" />';
									if (!isNaN(id)) {
										html += '</a>';
									}
									else {
										html += '<input type="hidden" name="resource[]" value="'+resources[i].resource_id+'" />';//(altas_clase_resource_related_num++)+'" />';
									}

									html += '</li>';
								atlas_yui_add('resource-'+resources[i].resource_id);
							}

						}
						for (i = atlasmem[id].start + atlasmem[id].show; i <= mdpixx.Case_resource_total; i++) {
							html += '<li style="'+styles.li+'">';
								if (!isNaN(id)) {
									html += '<a id="atlas_thumb_'+id+'_'+i+'_link" href="#">';
								}
								html += '<img id="atlas_thumb_'+id+'_'+i+'_img" src="" style="margin: 0px; padding: 0px; visibility: hidden;" />';

								if (!isNaN(id)) {
									html += '</a>';
								}
								else {
									html += '<input type="hidden" name="resource[]" value="'+resources[i].resource_id+'" />';//(altas_clase_resource_related_num++)+'" />';
								}
							html += '</li>';
						}
						html += '</ul>';
						atlasonrun[id] = false;
					}
					else {
						for (i in resources) {
							if (typeof(resources[i]) != 'function') {
								var counter = resources[i]['counter'];
								var img = document.getElementById('atlas_thumb_'+id+'_'+counter+'_img');
								img.src = resources[i][type+'_path'];
								img.style.visibility = 'visible';
								if (!isNaN(id)) {
									if (document.getElementById('atlas_thumb_'+id+'_'+counter+'_link')) {
										var link = document.getElementById('atlas_thumb_'+id+'_'+counter+'_link');
										link.href = mdpixx.Case_resource_url+'/atlas/view.php?id='+resources[i].resource_id;
									}
								}
							}
						}
					}
				}
				}
			}else{
				if (scroll == 'topbottom') {
						document.getElementById('imgloader1' + id).style.display = 'none';
						}
			}
		}
		if (html.length > 2) {
			main.innerHTML = html;
			atlas_yui_run();
		}
	}


	var data = cache_Xml2Array(get.url);
	if (data) {
		get.onrun( data );
	}
	else {
		getXml2Array(get);
	}

}

var cache_Xml2Array_hash = new Object();
function cache_Xml2Array(url, data, action) {
	switch(action) {
		case 'add':
			var encode = encodeURI(url);
			cache_Xml2Array_hash[encode] = data;
			break;
		default:
			var encode = encodeURI(url);
			return cache_Xml2Array_hash[encode];
	}
}

function atlas_case_nb (id, num) {
	if (atlasonrun[id] == false) {
		var main = document.getElementById('atlas_' + atlasmem[id].type + '_' + id + '_list');
		var type = atlasmem[id].type;

		if (atlasmem[id].scroll == 'leftright') {
			var numpx = new RegExp(/^([\-0-9]+)px/ig);
			var result = numpx.exec( main.style.left );
			var n_left = Number(result[1]);

			if (atlasmem[id].total > 2) {
				if (num < 0) {
					var a_left = Math.round( n_left + Number(atlas.images[type].width) );
					if (a_left <= 0) {

						atlas_change_onrun(id);
						atlasmem[id].start = atlasmem[id].start - 2;

						atlas_case(id,atlasmem[id].scroll,true);

						atlas_scroll(id,atlasmem[id].scroll,n_left,a_left,num);
					}
				}
				else {
					var a_left = Math.round( n_left - Number(atlas.images[type].width) );
					if ( Number(a_left * -1) < Number(atlasmem[id].maxwidth) - Number(atlas.images[type].width) ) {

						atlas_change_onrun(id);
						atlasmem[id].start = atlasmem[id].start + 2;

						atlas_case(id,atlasmem[id].scroll,true);

						atlas_scroll(id,atlasmem[id].scroll,n_left,a_left,num);
					}
				}
			}
		}
		else if (atlasmem[id].scroll == 'topbottom') {
			var numpx = new RegExp(/^([\-0-9]+)px/ig);
			var n_top;
			if (main.style.top == '') {
				n_top = Number(0);
			}
			else {
				var result = numpx.exec( main.style.top );
				n_top = Number(result[1]);
			}

			if (atlasmem[id].total > 2) {
				if (num < 0) {
					var a_top = Math.round( n_top + Number(atlas.images[type].height) );
					if (a_top <= 0) {
						atlas_change_onrun(id);

						atlasmem[id].start = atlasmem[id].start - 1;
						atlas_case(id,atlasmem[id].scroll,true);

						atlas_scroll(id,atlasmem[id].scroll,n_top,a_top,num);
					}
				}
				else {
					var a_top = Math.round( n_top - Number(atlas.images[type].height) );
					if ( (a_top * -1) < atlasmem[id].maxheight - Number(atlas.images[type].height*2) ) {
						atlas_change_onrun(id);

						atlasmem[id].start = atlasmem[id].start + 1;
						atlas_case(id,atlasmem[id].scroll,true);

						atlas_scroll(id,atlasmem[id].scroll,n_top,a_top,num);
					}
				}
			}
		}

	}

}

function atlas_change_onrun(id) {
	if (atlasonrun[id] == false) {
		atlasonrun[id] = true;
	}
	else {
		atlasonrun[id] = false;
	}
}

function atlas_scroll(id,scroll,orig,dest,num) {
	var main = document.getElementById('atlas_' + atlasmem[id].type + '_' + id + '_list');
	orig = Number(orig);
	dest = Number(dest);
	var px = orig;

	if (scroll == 'leftright') {
		if (orig != dest) {
			if (orig > dest && num > 0) {
				var i = 0;
				while ( px > dest ) {
					px = px - Math.round( i * 2 );
					var time = 24 * i;
					i++;

					if (px < dest) { px = dest; }
					if (px == dest) {
						var lasttime = 24 * i;
						setTimeout('atlas_change_onrun(\''+id+'\')',lasttime);
					}
					setTimeout('atlas_scroll_eject(\''+id+'\',\'left\','+px+')',time);
				}

			}
			else {
				var i = 0;
				while ( px < dest ) {
					px = px + Math.round( i * 2 );
					var time = 24 * i;
					i++;

					if (px > dest) { px = dest; }
					if (px == dest) {
						var lasttime = 24 * i;
						setTimeout('atlas_change_onrun(\''+id+'\')',lasttime);
					}
					setTimeout('atlas_scroll_eject(\''+id+'\',\'left\','+px+')',time);
				}
			}
		}
	}
	if (scroll == 'topbottom') {
		if (orig != dest) {
			if (orig > dest && num > 0) {
				var i = 0;
				while ( px > dest ) {
					px = px - Math.round( i * 2 );
					var time = 24 * i;
					i++;

					if (px < dest) { px = dest; }
					if (px == dest) {
						var lasttime = 24 * i;
						setTimeout('atlas_change_onrun(\''+id+'\')',lasttime);
					}
					setTimeout('atlas_scroll_eject(\''+id+'\',\'top\','+px+')',time);
				}

			}
			else {
				var i = 0;
				while ( px < dest ) {
					px = px + Math.round( i * 2 );
					var time = 24 * i;
					i++;

					if (px > dest) { px = dest; }
					if (px == dest) {
						var lasttime = 24 * i;
						setTimeout('atlas_change_onrun(\''+id+'\')',lasttime);
					}
					setTimeout('atlas_scroll_eject(\''+id+'\',\'top\','+px+')',time);
				}
			}

		}
	}

}

function atlas_scroll_eject (id, scroll, px) {
	var main = document.getElementById('atlas_' + atlasmem[id].type + '_' + id + '_list');
	main.style[scroll] = px+'px';
}

/*
 * Efecto LUPA
 */

atlas.visor = new Object();
atlas.visor.active = false;
atlas.visor.image = new Object();
atlas.visor.image.id = null;
atlas.visor.image.top = 0;
atlas.visor.image.left = 0;
atlas.visor.mouse = new Object();

atlas.lupa = new Object();
atlas.image = new Object();

function atlas_oo_standar(id,url) {
	var main = document.getElementById('atlas_natural_'+id);
	var html = '';
	html += '<img src="' + url + '"/>';
	main.style.backgroundImage = 'none';
	main.style.cursor = 'default';
	main.innerHTML = html;
	if(document.getElementById('atlas_natural_'+id+'_lupa')){
		document.getElementById('atlas_natural_'+id+'_lupa').style.display = 'none';
	}
}

function atlas_oo_lupa(id,dimentions) {
	atlas.lupa.width = dimentions[0];
	atlas.lupa.height = dimentions[1];

	var lupa = document.getElementById('atlas_natural_'+id+'_lupa');
	if(lupa){
	lupa.style.display = 'none';
	lupa.style.width ='80px';
	lupa.style.height = '56px';
	lupa.style.border = '1px solid red;';
	lupa.style.backgroundRepeat = 'no-repeat';
	lupa.style.backgroundImage = 'url('+pathroot+'/themes/standard/icons/atlas_position.png)';
	/*lupa.style.top =  '363px';
	lupa.style.left = '-275px';*/

	}
}

function atlas_oo_lente(id) {
	var lente = document.getElementById('atlas_natural_'+id+'_lente');
	lente.style.width = '30px';
	lente.style.height = '30px';
	lente.style.border = '1px solid blue;';
	lente.style.background = 'blue';
}

function atlas_oo(id,url,width,height) {

	atlas.visor.width = 658;
	atlas.visor.height = 419;

	atlas.image.width = width;
	atlas.image.height = height;

	document.onmousemove = atlas_MoveImage;

	atlas.visor.image.id = id;

	var main = document.getElementById('atlas_natural_'+id);
	main.onmousedown = function () { atlas_d_d(main); }
	main.onmouseup = function () { atlas_d_d(main,false); }
	main.onmouseout = function () { atlas_d_d(main,false); }
	main.style.width = atlas.visor.width + 'px';
	main.style.height = atlas.visor.height + 'px';
	main.innerHTML = '';

	atlas.visor.image.left = 0;
	atlas.visor.image.top = 0;

	main.style.backgroundImage = "url('"+ url +"')";
	main.style.backgroundRepeat = 'no-repeat';
	main.style.backgroundPosition = '0px 0px';
	main.style.cursor = 'move';

	var dimentions = new atlas_oo_calc(width,height);

	atlas_oo_lupa(id,dimentions);

}

function atlas_oo_calc(width,height) {
	var new_width = 80;
	var new_height = 80;
	var dimentions = new Array(0,0);
	var option = 2;

	if ( calc_percent(width,new_width) > calc_percent(height,new_height) ) {
		option = 1;
	}

        if (option == 1) {
		var d = calc_percentdiff(height, new_height);
		var p = calc_percent(width,d);

		dimentions[0] = Math.round( calc_percent( width, d ) );
		dimentions[1] = Math.round( new_height );
	}
	else if (option == 2) {
		var d = calc_percentdiff(width, new_width);
		var p = calc_percent(height,d);

		dimentions[0] = Math.round( new_width );
		dimentions[1] = Math.round( calc_percent( height, d ) );
	}

	return dimentions;
}

function calc_percentdiff(a,n) {
	var p = ( n * 100 ) / a;
	return p;
}

function calc_percent(a,p) {
	var n = (a * p) / 100;
	return n;
}

function atlas_d_d(main, active) {
	if (active == false) {
		atlas.visor.active = false;
		atlas.visor.mouse.x = false;
		atlas.visor.mouse.y = false;
	}
	else {
		if (atlas.visor.active == true) {
			atlas.visor.active = false;
			atlas.visor.mouse.x = false;
			atlas.visor.mouse.y = false;
		}
		else {
			atlas.visor.active = true;
		}
	}
}


function atlas_MoveImage(ev) {
	if (atlas.visor.active == true) {
		var main = document.getElementById('atlas_natural_'+atlas.visor.image.id);
		var ev     = ev || window.event;
		var coords = atlas_MoveImageCoords(ev);

		if (!atlas.visor.mouse.x)
			atlas.visor.mouse.x = coords.x;
		if (!atlas.visor.mouse.y)
			atlas.visor.mouse.y = coords.y;

		var x;
		var y;

		if (atlas.visor.mouse.x != coords.x) {
			x = atlas.visor.mouse.x - coords.x;
			atlas.visor.mouse.x = coords.x;
		}

		if (atlas.visor.mouse.y != coords.y) {
			y = atlas.visor.mouse.y - coords.y;
			atlas.visor.mouse.y = coords.y;
		}


		if (!isNaN(x)) {
			atlas.visor.image.left = atlas.visor.image.left - x;
		}
		if (!isNaN(y)) {
			atlas.visor.image.top = atlas.visor.image.top - y;
		}

		if (atlas.visor.image.top > 0)
			atlas.visor.image.top = 0;

		if (atlas.visor.image.left > 0)
			atlas.visor.image.left = 0;

		if (atlas.image.height < atlas.visor.height) {
			atlas.visor.image.top = 0;
		}
		else {
			if (atlas.visor.image.top < ( Number(atlas.image.height - atlas.visor.height) * -1) ) {
				atlas.visor.image.top = (atlas.image.height - atlas.visor.height) * -1;
			}
		}

		if (atlas.image.width < atlas.visor.width) {
			atlas.visor.image.left = 0;
		}
		else {
			if (atlas.visor.image.left < ( Number(atlas.image.width - atlas.visor.width) * -1) ) {
				atlas.visor.image.left = (atlas.image.width - atlas.visor.width) * -1;
			}
		}


		main.style.backgroundPosition = atlas.visor.image.left + 'px' + ' ' + atlas.visor.image.top + 'px';
		lupa_MoveImage();

	}
}

function lupa_MoveImage() {
	var lente = document.getElementById('atlas_natural_'+atlas.visor.image.id+'_lupa');

	var x = Number( atlas.visor.image.left * -1 );
	var y = Number( atlas.visor.image.top * -1 );

	x = (x * atlas.lupa.width / atlas.image.width) ;
	y = (y * atlas.lupa.height / atlas.image.height) ;
if(lente){
	lente.style.backgroundPosition = x + 'px' + ' ' + y + 'px';
	}
}

function atlas_MoveImageCoords(ev){
	if (atlas.visor.active == true) {
		var ev     = ev || window.event;
		var target = ev.target || ev.srcElement;

		if(ev.pageX || ev.pageY) {
			return {x:ev.pageX, y:ev.pageY};
		}
		return {
			x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
			y:ev.clientY + document.body.scrollTop  - document.body.clientTop
		};
	}
}

/*
 * OnMouseOver for the atlas
 */

var resources = new Object();

function resource_info_over(id, linkurl) {
	if (linkurl){
		resources[id] = setTimeout('resource_info_eject(\''+id+'\', \''+linkurl+'\')',1000);
	}else{
		resources[id] = setTimeout('resource_info_eject(\''+id+'\')',1000);
	}
}

function resource_info_out (id) {
	clearTimeout(resources[id]);
}

function resource_info_eject(id, linkurl) {

	var html = '';
	var main = document.getElementById('atlas_info');
	var get = new Object();

	get.url = '../newxml/detail.php?resourceid='+id;
	get.onrun = function() {
		atlascache[get.url] = get.xml;

		if (get.xml.mdpixx.resource) {
			var strtags = '';
			var strscore= new String();
			var term = new String();
	//		var strscore2 = new String();
			strscore = get.xml.mdpixx.resource[0].rate;
	//		strscore2 = strscore.replace(/##/g,'<');
	//		strscore2 = strscore2.replace(/@@/g,'>');
			var h = get.xml.mdpixx.resource.length;
			for(i=0;i<h;i++){
				if(get.xml.mdpixx.resource[i].tag){
					if (linkurl) {
						term = get.xml.mdpixx.resource[i].tag
						term = term.replace("%20", " ");
						strtags += '; <a href="'+linkurl+'/atlas/index.php?query=@description_keyword='+term+'">' + get.xml.mdpixx.resource[i].tag + '</a>';
					}else{
						strtags += '; ' + get.xml.mdpixx.resource[i].tag;
					}
				}
			}
		
			if(strtags.length >= 2){
				strtags = strtags.substr(2,(strtags.length-1))
			}else{
				strtags = '';
			}
			main.innerHTML = get.xml.mdpixx.resource[0].info + strtags + '<br/>'+ strscore;
			//main.innerHTML = get.xml.mdpixx.resource[0].info + '<br/>' + strtags + '<br/>'+ strscore;
		}
	}

	if (atlascache[get.url]) {
		get.xml = atlascache[get.url];
		get.onrun();
	}
	else {
		getXml2Array(get);
	}
}

//added by yogini for the admin section
function resource_info_over_admin(id) {
	resources[id] = setTimeout('resource_info_eject_admin(\''+id+'\')',1000);
}
function resource_info_out_admin(id) {
	clearTimeout(resources[id]);
}
function resource_info_eject_admin(id) {

	var html = '';
	var main = document.getElementById('atlas_info');
	var get = new Object();

	get.url = '../../newxml/detail.php?resourceid='+id;
	get.onrun = function() {
		atlascache[get.url] = get.xml;

		if (get.xml.mdpixx.resource) {
			var strtags = '';
			var strscore= new String();
			//var strscore2 = new String();
			strscore = get.xml.mdpixx.resource[0].rate;
			//strscore2 = strscore.replace(/##/g,'<');
			//strscore2 = strscore2.replace(/@@/g,'>');
			var h = get.xml.mdpixx.resource.length;
			for(i=0;i<h;i++){
				if(get.xml.mdpixx.resource[i].tag){
					strtags += '; ' + get.xml.mdpixx.resource[i].tag;
				}
			}
			if(strtags.length >= 2){
				strtags = strtags.substr(2,(strtags.length-1))
			}else{
				strtags = '';
			}
			//main.innerHTML = get.xml.mdpixx.resource[0].info + '<br/>' + strtags + '<br/>'+ strscore2;
			main.innerHTML = get.xml.mdpixx.resource[0].info + strtags + '<br/>'+ strscore;
		}
	}

	if (atlascache[get.url]) {
		get.xml = atlascache[get.url];
		get.onrun();
	}
	else {
		getXml2Array(get);
	}
}
