
var requiredMajorVersion = 10;
var requiredMinorVersion = 0;
var requiredRevision = 0;


function iniciar() {
animatedcollapse.addDiv('news1','fade=1,hide=1');
animatedcollapse.addDiv('webs1','fade=1,hide=1');
animatedcollapse.addDiv('wiki1','fade=1,hide=1');
animatedcollapse.addDiv('images1','fade=1,hide=1');
animatedcollapse.addDiv('videos1','fade=1,hide=1');
animatedcollapse.addDiv('ebays1','fade=1,hide=1');
animatedcollapse.addDiv('amazons1','fade=1,hide=1');
animatedcollapse.addDiv('blogs1','fade=1,hide=0');
animatedcollapse.addDiv('news2','fade=1,hide=1');
animatedcollapse.addDiv('webs2','fade=1,hide=1');
animatedcollapse.addDiv('wiki2','fade=1,hide=1');
animatedcollapse.addDiv('images2','fade=1,hide=1');
animatedcollapse.addDiv('videos2','fade=1,hide=1');
animatedcollapse.addDiv('ebays2','fade=1,hide=1');
animatedcollapse.addDiv('amazons2','fade=1,hide=1');
animatedcollapse.addDiv('blogs2','fade=1,hide=1');
animatedcollapse.addDiv('blogs3','fade=1,hide=1');
animatedcollapse.addDiv('news3','fade=1,hide=1');
animatedcollapse.addDiv('webs3','fade=1,hide=1');
animatedcollapse.addDiv('wiki3','fade=1,hide=1');
animatedcollapse.addDiv('images3','fade=1,hide=1');
animatedcollapse.addDiv('videos3','fade=1,hide=1');
animatedcollapse.addDiv('ebays3','fade=1,hide=1');
animatedcollapse.addDiv('amazons3','fade=1,hide=1');
animatedcollapse.addDiv('news4','fade=1,hide=1');
animatedcollapse.addDiv('webs4','fade=1,hide=1');
animatedcollapse.addDiv('wiki4','fade=1,hide=1');
animatedcollapse.addDiv('images4','fade=1,hide=1');
animatedcollapse.addDiv('videos4','fade=1,hide=1');
animatedcollapse.addDiv('ebays4','fade=1,hide=1');
animatedcollapse.addDiv('amazons4','fade=1,hide=1');
animatedcollapse.addDiv('blogs4','fade=1,hide=1');
animatedcollapse.addDiv('news5','fade=1,hide=1');
animatedcollapse.addDiv('webs5','fade=1,hide=1');
animatedcollapse.addDiv('wiki5','fade=1,hide=1');
animatedcollapse.addDiv('images5','fade=1,hide=1');
animatedcollapse.addDiv('videos5','fade=1,hide=1');
animatedcollapse.addDiv('ebays5','fade=1,hide=1');
animatedcollapse.addDiv('amazons5','fade=1,hide=1');
animatedcollapse.addDiv('blogs5','fade=1,hide=1');
animatedcollapse.addDiv('news6','fade=1,hide=1');
animatedcollapse.addDiv('webs6','fade=1,hide=1');
animatedcollapse.addDiv('wiki6','fade=1,hide=1');
animatedcollapse.addDiv('images6','fade=1,hide=1');
animatedcollapse.addDiv('videos6','fade=1,hide=1');
animatedcollapse.addDiv('ebays6','fade=1,hide=1');
animatedcollapse.addDiv('amazons6','fade=1,hide=1');
animatedcollapse.addDiv('blogs6','fade=1,hide=1');
animatedcollapse.addDiv('blogs7','fade=1,hide=1');
animatedcollapse.addDiv('news7','fade=1,hide=1');
animatedcollapse.addDiv('webs7','fade=1,hide=1');
animatedcollapse.addDiv('wiki7','fade=1,hide=1');
animatedcollapse.addDiv('images7','fade=1,hide=1');
animatedcollapse.addDiv('videos7','fade=1,hide=1');
animatedcollapse.addDiv('ebays7','fade=1,hide=1');
animatedcollapse.addDiv('amazons7','fade=1,hide=1');
animatedcollapse.addDiv('news8','fade=1,hide=1');
animatedcollapse.addDiv('webs8','fade=1,hide=1');
animatedcollapse.addDiv('wiki8','fade=1,hide=1');
animatedcollapse.addDiv('images8','fade=1,hide=1');
animatedcollapse.addDiv('videos8','fade=1,hide=1');
animatedcollapse.addDiv('ebays8','fade=1,hide=1');
animatedcollapse.addDiv('amazons8','fade=1,hide=1');
animatedcollapse.addDiv('blogs8','fade=1,hide=1');
animatedcollapse.addDiv('blogs9','fade=1,hide=1');
animatedcollapse.addDiv('news9','fade=1,hide=1');
animatedcollapse.addDiv('webs9','fade=1,hide=1');
animatedcollapse.addDiv('wiki9','fade=1,hide=1');
animatedcollapse.addDiv('images9','fade=1,hide=1');
animatedcollapse.addDiv('videos9','fade=1,hide=1');
animatedcollapse.addDiv('ebays9','fade=1,hide=1');
animatedcollapse.addDiv('amazons9','fade=1,hide=1');
animatedcollapse.addDiv('blogs0','fade=1,hide=1');
animatedcollapse.addDiv('news0','fade=1,hide=1');
animatedcollapse.addDiv('webs0','fade=1,hide=1');
animatedcollapse.addDiv('wiki0','fade=1,hide=1');
animatedcollapse.addDiv('images0','fade=1,hide=1');
animatedcollapse.addDiv('videos0','fade=1,hide=1');
animatedcollapse.addDiv('ebays0','fade=1,hide=1');
animatedcollapse.addDiv('amazons0','fade=1,hide=1');
animatedcollapse.addDiv('blogs10','fade=1,hide=1');
animatedcollapse.addDiv('news10','fade=1,hide=1');
animatedcollapse.addDiv('webs10','fade=	1,hide=1');
animatedcollapse.addDiv('wiki10','fade=1,hide=1');
animatedcollapse.addDiv('images10','fade=1,hide=1');
animatedcollapse.addDiv('videos10','fade=1,hide=1');
animatedcollapse.addDiv('ebays10','fade=1,hide=1');
animatedcollapse.addDiv('amazons10','fade=1,hide=1');
animatedcollapse.addDiv('blogs10','fade=1,hide=1');
}
function webs() {
animatedcollapse.hide(['videos1', 'wiki1', 'wiki2', 'wiki3', 'wiki4', 'wiki5', 'wiki6', 'wiki7', 'wiki8', 'wiki9', 'wiki0','videos2', 'videos3', 'videos4', 'videos5', 'videos6', 'videos7', 'videos8', 'videos9', 'videos0','ebays1', 'ebays2', 'ebays3', 'ebays4', 'ebays5', 'ebays6', 'ebays7', 'ebays8', 'ebays9', 'ebays0','images1', 'images2', 'images3', 'images4', 'images5', 'images6', 'images7', 'images8', 'images9', 'images0','amazons1', 'amazons2', 'amazons3', 'amazons4', 'amazons5', 'amazons6', 'amazons7', 'amazons8', 'amazons9', 'amazons0','blogs1', 'blogs2', 'blogs3', 'blogs4', 'blogs5', 'blogs6', 'blogs7', 'blogs8', 'blogs9', 'blogs0','news1', 'news2', 'news3', 'news4', 'news5', 'news6', 'news7', 'news8', 'news9', 'news0','webs1', 'webs2', 'webs3', 'webs4', 'webs5', 'webs6', 'webs7', 'webs8', 'webs9', 'webs0','flashcontent']);
animatedcollapse.show(['webs1', 'webs2', 'webs3', 'webs4', 'webs5', 'webs6', 'webs7', 'webs8', 'webs9', 'webs0']); 
}
function wiki() {
animatedcollapse.hide(['videos1', 'videos2', 'videos3', 'videos4', 'videos5', 'videos6', 'videos7', 'videos8', 'videos9', 'videos0','ebays1', 'ebays2', 'ebays3', 'ebays4', 'ebays5', 'ebays6', 'ebays7', 'ebays8', 'ebays9', 'ebays0','images1', 'images2', 'images3', 'images4', 'images5', 'images6', 'images7', 'images8', 'images9', 'images0','amazons1', 'amazons2', 'amazons3', 'amazons4', 'amazons5', 'amazons6', 'amazons7', 'amazons8', 'amazons9', 'amazons0','blogs1', 'blogs2', 'blogs3', 'blogs4', 'blogs5', 'blogs6', 'blogs7', 'blogs8', 'blogs9', 'blogs0','news1', 'news2', 'news3', 'news4', 'news5', 'news6', 'news7', 'news8', 'news9', 'news0','webs1', 'webs2', 'webs3', 'webs4', 'webs5', 'webs6', 'webs7', 'webs8', 'webs9', 'webs0','wiki1', 'wiki2', 'wiki3', 'wiki4', 'wiki5', 'wiki6', 'wiki7', 'wiki8', 'wiki9', 'wiki0','flashcontent']);
animatedcollapse.show(['wiki1', 'wiki2', 'wiki3', 'wiki4', 'wiki5', 'wiki6', 'wiki7', 'wiki8', 'wiki9', 'wiki0'])
}
function videos() {
animatedcollapse.hide(['videos1', 'videos2', 'videos3', 'videos4', 'videos5', 'videos6', 'videos7', 'videos8', 'videos9', 'videos0','ebays1', 'ebays2', 'ebays3', 'ebays4', 'ebays5', 'ebays6', 'ebays7', 'ebays8', 'ebays9', 'ebays0','images1', 'images2', 'images3', 'images4', 'images5', 'images6', 'images7', 'images8', 'images9', 'images0','amazons1', 'amazons2', 'amazons3', 'amazons4', 'amazons5', 'amazons6', 'amazons7', 'amazons8', 'amazons9', 'amazons0','blogs1', 'blogs2', 'blogs3', 'blogs4', 'blogs5', 'blogs6', 'blogs7', 'blogs8', 'blogs9', 'blogs0','news1', 'news2', 'news3', 'news4', 'news5', 'news6', 'news7', 'news8', 'news9', 'news0','webs1', 'webs2', 'webs3', 'webs4', 'webs5', 'webs6', 'webs7', 'webs8', 'webs9', 'webs0','wiki1', 'wiki2', 'wiki3', 'wiki4', 'wiki5', 'wiki6', 'wiki7', 'wiki8', 'wiki9', 'wiki0','flashcontent']);
animatedcollapse.show(['videos1', 'videos2', 'videos3', 'videos4', 'videos5', 'videos6', 'videos7', 'videos8', 'videos9', 'videos0'])
}
function images() {
animatedcollapse.hide(['videos1', 'videos2', 'videos3', 'videos4', 'videos5', 'videos6', 'videos7', 'videos8', 'videos9', 'videos0','ebays1', 'ebays2', 'ebays3', 'ebays4', 'ebays5', 'ebays6', 'ebays7', 'ebays8', 'ebays9', 'ebays0','images1', 'images2', 'images3', 'images4', 'images5', 'images6', 'images7', 'images8', 'images9', 'images0','amazons1', 'amazons2', 'amazons3', 'amazons4', 'amazons5', 'amazons6', 'amazons7', 'amazons8', 'amazons9', 'amazons0','blogs1', 'blogs2', 'blogs3', 'blogs4', 'blogs5', 'blogs6', 'blogs7', 'blogs8', 'blogs9', 'blogs0','news1', 'news2', 'news3', 'news4', 'news5', 'news6', 'news7', 'news8', 'news9', 'news0','webs1', 'webs2', 'webs3', 'webs4', 'webs5', 'webs6', 'webs7', 'webs8', 'webs9', 'webs0','wiki1', 'wiki2', 'wiki3', 'wiki4', 'wiki5', 'wiki6', 'wiki7', 'wiki8', 'wiki9', 'wiki0','flashcontent']);
animatedcollapse.show(['images1', 'images2', 'images3', 'images4', 'images5', 'images6', 'images7', 'images8', 'images9', 'images0'])}
function blogs() {
animatedcollapse.hide(['videos1', 'videos2', 'videos3', 'videos4', 'videos5', 'videos6', 'videos7', 'videos8', 'videos9', 'videos0','ebays1', 'ebays2', 'ebays3', 'ebays4', 'ebays5', 'ebays6', 'ebays7', 'ebays8', 'ebays9', 'ebays0','images1', 'images2', 'images3', 'images4', 'images5', 'images6', 'images7', 'images8', 'images9', 'images0','amazons1', 'amazons2', 'amazons3', 'amazons4', 'amazons5', 'amazons6', 'amazons7', 'amazons8', 'amazons9', 'amazons0','blogs1', 'blogs2', 'blogs3', 'blogs4', 'blogs5', 'blogs6', 'blogs7', 'blogs8', 'blogs9', 'blogs0','news1', 'news2', 'news3', 'news4', 'news5', 'news6', 'news7', 'news8', 'news9', 'news0','webs1', 'webs2', 'webs3', 'webs4', 'webs5', 'webs6', 'webs7', 'webs8', 'webs9', 'webs0','wiki1', 'wiki2', 'wiki3', 'wiki4', 'wiki5', 'wiki6', 'wiki7', 'wiki8', 'wiki9', 'wiki0','flashcontent']);
animatedcollapse.show(['blogs1', 'blogs2', 'blogs3', 'blogs4', 'blogs5', 'blogs6', 'blogs7', 'blogs8', 'blogs9', 'blogs0'])
}
function auctions() {
animatedcollapse.hide(['videos1', 'videos2', 'videos3', 'videos4', 'videos5', 'videos6', 'videos7', 'videos8', 'videos9', 'videos0','ebays1', 'ebays2', 'ebays3', 'ebays4', 'ebays5', 'ebays6', 'ebays7', 'ebays8', 'ebays9', 'ebays0','images1', 'images2', 'images3', 'images4', 'images5', 'images6', 'images7', 'images8', 'images9', 'images0','amazons1', 'amazons2', 'amazons3', 'amazons4', 'amazons5', 'amazons6', 'amazons7', 'amazons8', 'amazons9', 'amazons0','blogs1', 'blogs2', 'blogs3', 'blogs4', 'blogs5', 'blogs6', 'blogs7', 'blogs8', 'blogs9', 'blogs0','news1', 'news2', 'news3', 'news4', 'news5', 'news6', 'news7', 'news8', 'news9', 'news0','webs1', 'webs2', 'webs3', 'webs4', 'webs5', 'webs6', 'webs7', 'webs8', 'webs9', 'webs0','wiki1', 'wiki2', 'wiki3', 'wiki4', 'wiki5', 'wiki6', 'wiki7', 'wiki8', 'wiki9', 'wiki0','flashcontent']);animatedcollapse.show(['ebays1', 'ebays2', 'ebays3', 'ebays4', 'ebays5', 'ebays6', 'ebays7', 'ebays8', 'ebays9', 'ebays0'])
}
function books() {
animatedcollapse.hide(['videos1', 'videos2', 'videos3', 'videos4', 'videos5', 'videos6', 'videos7', 'videos8', 'videos9', 'videos0','ebays1', 'ebays2', 'ebays3', 'ebays4', 'ebays5', 'ebays6', 'ebays7', 'ebays8', 'ebays9', 'ebays0','images1', 'images2', 'images3', 'images4', 'images5', 'images6', 'images7', 'images8', 'images9', 'images0','amazons1', 'amazons2', 'amazons3', 'amazons4', 'amazons5', 'amazons6', 'amazons7', 'amazons8', 'amazons9', 'amazons0','blogs1', 'blogs2', 'blogs3', 'blogs4', 'blogs5', 'blogs6', 'blogs7', 'blogs8', 'blogs9', 'blogs0','news1', 'news2', 'news3', 'news4', 'news5', 'news6', 'news7', 'news8', 'news9', 'news0','webs1', 'webs2', 'webs3', 'webs4', 'webs5', 'webs6', 'webs7', 'webs8', 'webs9', 'webs0','wiki1', 'wiki2', 'wiki3', 'wiki4', 'wiki5', 'wiki6', 'wiki7', 'wiki8', 'wiki9', 'wiki0','flashcontent']);animatedcollapse.show(['amazons1', 'amazons2', 'amazons3', 'amazons4', 'amazons5', 'amazons6', 'amazons7', 'amazons8', 'amazons9', 'amazons0'])
}
function news() {
animatedcollapse.hide(['videos1', 'videos2', 'videos3', 'videos4', 'videos5', 'videos6', 'videos7', 'videos8', 'videos9', 'videos0','ebays1', 'ebays2', 'ebays3', 'ebays4', 'ebays5', 'ebays6', 'ebays7', 'ebays8', 'ebays9', 'ebays0','images1', 'images2', 'images3', 'images4', 'images5', 'images6', 'images7', 'images8', 'images9', 'images0','amazons1', 'amazons2', 'amazons3', 'amazons4', 'amazons5', 'amazons6', 'amazons7', 'amazons8', 'amazons9', 'amazons0','blogs1', 'blogs2', 'blogs3', 'blogs4', 'blogs5', 'blogs6', 'blogs7', 'blogs8', 'blogs9', 'blogs0','news1', 'news2', 'news3', 'news4', 'news5', 'news6', 'news7', 'news8', 'news9', 'news0','webs1', 'webs2', 'webs3', 'webs4', 'webs5', 'webs6', 'webs7', 'webs8', 'webs9', 'webs0','wiki1', 'wiki2', 'wiki3', 'wiki4', 'wiki5', 'wiki6', 'wiki7', 'wiki8', 'wiki9', 'wiki0','flashcontent']);animatedcollapse.show(['news1', 'news2', 'news3', 'news4', 'news5', 'news6', 'news7', 'news8', 'news9', 'news0']);

}


function map() {
animatedcollapse.hide(['videos1', 'videos2', 'videos3', 'videos4', 'videos5', 'videos6', 'videos7', 'videos8', 'videos9', 'videos0','ebays1', 'ebays2', 'ebays3', 'ebays4', 'ebays5', 'ebays6', 'ebays7', 'ebays8', 'ebays9', 'ebays0','images1', 'images2', 'images3', 'images4', 'images5', 'images6', 'images7', 'images8', 'images9', 'images0','amazons1', 'amazons2', 'amazons3', 'amazons4', 'amazons5', 'amazons6', 'amazons7', 'amazons8', 'amazons9', 'amazons0','blogs1', 'blogs2', 'blogs3', 'blogs4', 'blogs5', 'blogs6', 'blogs7', 'blogs8', 'blogs9', 'blogs0','news1', 'news2', 'news3', 'news4', 'news5', 'news6', 'news7', 'news8', 'news9', 'news0','webs1', 'webs2', 'webs3', 'webs4', 'webs5', 'webs6', 'webs7', 'webs8', 'webs9', 'webs0','wiki1', 'wiki2', 'wiki3', 'wiki4', 'wiki5', 'wiki6', 'wiki7', 'wiki8', 'wiki9', 'wiki0']);animatedcollapse.show(['flashcontent']);
}

sfHover = function() {
	var language = document.getElementById("language");
	if (!language) return;
	var sfEls = language.getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


		convey_url      = document.location.href;
		convey_source   = "English";
		convey_user     = "andresm";

		convey_type     = 1;
addthis_pub  = 'andresm';

function flashea(texto) { 
if (document.body && document.body.offsetWidth) {
 winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
if (document.compatMode=='CSS1Compat' &&
    document.documentElement &&
    document.documentElement.offsetWidth ) {
 winW = document.documentElement.offsetWidth;
winH = document.body.offsetHeight;

}
if (window.innerWidth && window.innerHeight) {
 winW = window.innerWidth;
winH = document.body.offsetHeight;
}
winH=winH-355-100;
winW=winW-360;

var hasProductInstall = DetectFlashVer(6, 0, 65);

var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

if ( hasProductInstall && !hasRequestedVersion ) {
	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
	var MMredirectURL = window.location;
    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
    var MMdoctitle = document.title;

	AC_FL_RunContent(
		"src", "playerProductInstall",
		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
		"width", 0,
		"height", 0,
		"align", "middle",
		"id", "Main",
		"quality", "high",
		"bgcolor", "#ffffff",
		"name", "Main",
		"allowScriptAccess","sameDomain",
		"type", "application/x-shockwave-flash",
		"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);
} else if (hasRequestedVersion) {

	AC_FL_RunContent(
			"src", "http://cloud1.goldenmap.com/server/Main",
			"width", "100%",
			"height", winH,
			"align", "middle",
			"id", "Main",
			"quality", "high",
			"bgcolor", "#ffffff",
			"name", "Main",
			"allowScriptAccess","sameDomain",
			"type", "application/x-shockwave-flash",
			"pluginspage", "http://www.adobe.com/go/getflashplayer",
			"flashvars", "input=/stylesheets/get.php?Topic="+texto
	);
  } else {  
    var alternateContent = 'Alternate HTML content should be placed here. '
  	+ 'This content requires the Adobe Flash Player. '
   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
    document.write(alternateContent);  
  }
}

			


				
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(3($){$.31.1o({12:3(b,d){5 c=Y b=="1w";d=$.1o({},$.D.1L,{11:c?b:14,w:c?14:b,1D:c?$.D.1L.1D:10,Z:d&&!d.1x?10:3U},d);d.1t=d.1t||3(a){6 a};d.1q=d.1q||d.1K;6 I.K(3(){1E $.D(I,d)})},M:3(a){6 I.X("M",a)},1y:3(a){6 I.15("1y",[a])},20:3(){6 I.15("20")},1Y:3(a){6 I.15("1Y",[a])},1X:3(){6 I.15("1X")}});$.D=3(o,r){5 t={2N:38,2I:40,2D:46,2x:9,2v:13,2q:27,2d:3x,2j:33,2o:34,2e:8};5 u=$(o).3f("12","3c").P(r.24);5 p;5 m="";5 n=$.D.2W(r);5 s=0;5 k;5 h={1z:B};5 l=$.D.2Q(r,o,1U,h);5 j;$.1T.2L&&$(o.2K).X("3S.12",3(){4(j){j=B;6 B}});u.X(($.1T.2L?"3Q":"3N")+".12",3(a){k=a.2F;3L(a.2F){Q t.2N:a.1d();4(l.L()){l.2y()}A{W(0,C)}N;Q t.2I:a.1d();4(l.L()){l.2u()}A{W(0,C)}N;Q t.2j:a.1d();4(l.L()){l.2t()}A{W(0,C)}N;Q t.2o:a.1d();4(l.L()){l.2s()}A{W(0,C)}N;Q r.19&&$.1p(r.R)==","&&t.2d:Q t.2x:Q t.2v:4(1U()){a.1d();j=C;6 B}N;Q t.2q:l.U();N;3A:1I(p);p=1H(W,r.1D);N}}).1G(3(){s++}).3v(3(){s=0;4(!h.1z){2k()}}).2i(3(){4(s++>1&&!l.L()){W(0,C)}}).X("1y",3(){5 c=(1n.7>1)?1n[1]:14;3 23(q,a){5 b;4(a&&a.7){16(5 i=0;i<a.7;i++){4(a[i].M.O()==q.O()){b=a[i];N}}}4(Y c=="3")c(b);A u.15("M",b&&[b.w,b.H])}$.K(1g(u.J()),3(i,a){1R(a,23,23)})}).X("20",3(){n.18()}).X("1Y",3(){$.1o(r,1n[1]);4("w"2G 1n[1])n.1f()}).X("1X",3(){l.1u();u.1u();$(o.2K).1u(".12")});3 1U(){5 b=l.26();4(!b)6 B;5 v=b.M;m=v;4(r.19){5 a=1g(u.J());4(a.7>1){v=a.17(0,a.7-1).2Z(r.R)+r.R+v}v+=r.R}u.J(v);1l();u.15("M",[b.w,b.H]);6 C}3 W(b,c){4(k==t.2D){l.U();6}5 a=u.J();4(!c&&a==m)6;m=a;a=1k(a);4(a.7>=r.22){u.P(r.21);4(!r.1C)a=a.O();1R(a,2V,1l)}A{1B();l.U()}};3 1g(b){4(!b){6[""]}5 d=b.1Z(r.R);5 c=[];$.K(d,3(i,a){4($.1p(a))c[i]=$.1p(a)});6 c}3 1k(a){4(!r.19)6 a;5 b=1g(a);6 b[b.7-1]}3 1A(q,a){4(r.1A&&(1k(u.J()).O()==q.O())&&k!=t.2e){u.J(u.J()+a.48(1k(m).7));$.D.1N(o,m.7,m.7+a.7)}};3 2k(){1I(p);p=1H(1l,47)};3 1l(){5 c=l.L();l.U();1I(p);1B();4(r.2U){u.1y(3(a){4(!a){4(r.19){5 b=1g(u.J()).17(0,-1);u.J(b.2Z(r.R)+(b.7?r.R:""))}A u.J("")}})}4(c)$.D.1N(o,o.H.7,o.H.7)};3 2V(q,a){4(a&&a.7&&s){1B();l.2T(a,q);1A(q,a[0].H);l.1W()}A{1l()}};3 1R(f,d,g){4(!r.1C)f=f.O();5 e=n.2S(f);4(e&&e.7){d(f,e)}A 4((Y r.11=="1w")&&(r.11.7>0)){5 c={45:+1E 44()};$.K(r.2R,3(a,b){c[a]=Y b=="3"?b():b});$.43({42:"41",3Z:"12"+o.3Y,2M:r.2M,11:r.11,w:$.1o({q:1k(f),3X:r.Z},c),3W:3(a){5 b=r.1r&&r.1r(a)||1r(a);n.1h(f,b);d(f,b)}})}A{l.2J();g(f)}};3 1r(c){5 d=[];5 b=c.1Z("\\n");16(5 i=0;i<b.7;i++){5 a=$.1p(b[i]);4(a){a=a.1Z("|");d[d.7]={w:a,H:a[0],M:r.1v&&r.1v(a,a[0])||a[0]}}}6 d};3 1B(){u.1e(r.21)}};$.D.1L={24:"3R",2H:"3P",21:"3O",22:1,1D:3M,1C:B,1a:C,1V:B,1j:10,Z:3K,2U:B,2R:{},1S:C,1K:3(a){6 a[0]},1q:14,1A:B,E:0,19:B,R:", ",1t:3(b,a){6 b.2C(1E 3J("(?![^&;]+;)(?!<[^<>]*)("+a.2C(/([\\^\\$\\(\\)\\[\\]\\{\\}\\*\\.\\+\\?\\|\\\\])/2A,"\\\\$1")+")(?![^<>]*>)(?![^&;]+;)","2A"),"<2z>$1</2z>")},1x:C,1s:3I};$.D.2W=3(g){5 h={};5 j=0;3 1a(s,a){4(!g.1C)s=s.O();5 i=s.3H(a);4(i==-1)6 B;6 i==0||g.1V};3 1h(q,a){4(j>g.1j){18()}4(!h[q]){j++}h[q]=a}3 1f(){4(!g.w)6 B;5 f={},2w=0;4(!g.11)g.1j=1;f[""]=[];16(5 i=0,30=g.w.7;i<30;i++){5 c=g.w[i];c=(Y c=="1w")?[c]:c;5 d=g.1q(c,i+1,g.w.7);4(d===B)1P;5 e=d.3G(0).O();4(!f[e])f[e]=[];5 b={H:d,w:c,M:g.1v&&g.1v(c)||d};f[e].1O(b);4(2w++<g.Z){f[""].1O(b)}};$.K(f,3(i,a){g.1j++;1h(i,a)})}1H(1f,25);3 18(){h={};j=0}6{18:18,1h:1h,1f:1f,2S:3(q){4(!g.1j||!j)6 14;4(!g.11&&g.1V){5 a=[];16(5 k 2G h){4(k.7>0){5 c=h[k];$.K(c,3(i,x){4(1a(x.H,q)){a.1O(x)}})}}6 a}A 4(h[q]){6 h[q]}A 4(g.1a){16(5 i=q.7-1;i>=g.22;i--){5 c=h[q.3F(0,i)];4(c){5 a=[];$.K(c,3(i,x){4(1a(x.H,q)){a[a.7]=x}});6 a}}}6 14}}};$.D.2Q=3(e,g,f,k){5 h={G:"3E"};5 j,y=-1,w,1m="",1M=C,F,z;3 2r(){4(!1M)6;F=$("<3D/>").U().P(e.2H).T("3C","3B").1J(2p.2n);z=$("<3z/>").1J(F).3y(3(a){4(V(a).2m&&V(a).2m.3w()==\'2l\'){y=$("1F",z).1e(h.G).3u(V(a));$(V(a)).P(h.G)}}).2i(3(a){$(V(a)).P(h.G);f();g.1G();6 B}).3t(3(){k.1z=C}).3s(3(){k.1z=B});4(e.E>0)F.T("E",e.E);1M=B}3 V(a){5 b=a.V;3r(b&&b.3q!="2l")b=b.3p;4(!b)6[];6 b}3 S(b){j.17(y,y+1).1e(h.G);2h(b);5 a=j.17(y,y+1).P(h.G);4(e.1x){5 c=0;j.17(0,y).K(3(){c+=I.1i});4((c+a[0].1i-z.1c())>z[0].3o){z.1c(c+a[0].1i-z.3n())}A 4(c<z.1c()){z.1c(c)}}};3 2h(a){y+=a;4(y<0){y=j.1b()-1}A 4(y>=j.1b()){y=0}}3 2g(a){6 e.Z&&e.Z<a?e.Z:a}3 2f(){z.2B();5 b=2g(w.7);16(5 i=0;i<b;i++){4(!w[i])1P;5 a=e.1K(w[i].w,i+1,b,w[i].H,1m);4(a===B)1P;5 c=$("<1F/>").3m(e.1t(a,1m)).P(i%2==0?"3l":"3k").1J(z)[0];$.w(c,"2c",w[i])}j=z.3j("1F");4(e.1S){j.17(0,1).P(h.G);y=0}4($.31.2b)z.2b()}6{2T:3(d,q){2r();w=d;1m=q;2f()},2u:3(){S(1)},2y:3(){S(-1)},2t:3(){4(y!=0&&y-8<0){S(-y)}A{S(-8)}},2s:3(){4(y!=j.1b()-1&&y+8>j.1b()){S(j.1b()-1-y)}A{S(8)}},U:3(){F&&F.U();j&&j.1e(h.G);y=-1},L:3(){6 F&&F.3i(":L")},3h:3(){6 I.L()&&(j.2a("."+h.G)[0]||e.1S&&j[0])},1W:3(){5 a=$(g).3g();F.T({E:Y e.E=="1w"||e.E>0?e.E:$(g).E(),2E:a.2E+g.1i,1Q:a.1Q}).1W();4(e.1x){z.1c(0);z.T({29:e.1s,3e:\'3d\'});4($.1T.3b&&Y 2p.2n.3T.29==="3a"){5 c=0;j.K(3(){c+=I.1i});5 b=c>e.1s;z.T(\'3V\',b?e.1s:c);4(!b){j.E(z.E()-28(j.T("32-1Q"))-28(j.T("32-39")))}}}},26:3(){5 a=j&&j.2a("."+h.G).1e(h.G);6 a&&a.7&&$.w(a[0],"2c")},2J:3(){z&&z.2B()},1u:3(){F&&F.37()}}};$.D.1N=3(b,a,c){4(b.2O){5 d=b.2O();d.36(C);d.35("2P",a);d.4c("2P",c);d.4b()}A 4(b.2Y){b.2Y(a,c)}A{4(b.2X){b.2X=a;b.4a=c}}b.1G()}})(49);',62,261,'|||function|if|var|return|length|||||||||||||||||||||||||data||active|list|else|false|true|Autocompleter|width|element|ACTIVE|value|this|val|each|visible|result|break|toLowerCase|addClass|case|multipleSeparator|moveSelect|css|hide|target|onChange|bind|typeof|max||url|autocomplete||null|trigger|for|slice|flush|multiple|matchSubset|size|scrollTop|preventDefault|removeClass|populate|trimWords|add|offsetHeight|cacheLength|lastWord|hideResultsNow|term|arguments|extend|trim|formatMatch|parse|scrollHeight|highlight|unbind|formatResult|string|scroll|search|mouseDownOnSelect|autoFill|stopLoading|matchCase|delay|new|li|focus|setTimeout|clearTimeout|appendTo|formatItem|defaults|needsInit|Selection|push|continue|left|request|selectFirst|browser|selectCurrent|matchContains|show|unautocomplete|setOptions|split|flushCache|loadingClass|minChars|findValueCallback|inputClass||selected||parseInt|maxHeight|filter|bgiframe|ac_data|COMMA|BACKSPACE|fillList|limitNumberOfItems|movePosition|click|PAGEUP|hideResults|LI|nodeName|body|PAGEDOWN|document|ESC|init|pageDown|pageUp|next|RETURN|nullData|TAB|prev|strong|gi|empty|replace|DEL|top|keyCode|in|resultsClass|DOWN|emptyList|form|opera|dataType|UP|createTextRange|character|Select|extraParams|load|display|mustMatch|receiveData|Cache|selectionStart|setSelectionRange|join|ol|fn|padding|||moveStart|collapse|remove||right|undefined|msie|off|auto|overflow|attr|offset|current|is|find|ac_odd|ac_even|html|innerHeight|clientHeight|parentNode|tagName|while|mouseup|mousedown|index|blur|toUpperCase|188|mouseover|ul|default|absolute|position|div|ac_over|substr|charAt|indexOf|180|RegExp|100|switch|400|keydown|ac_loading|ac_results|keypress|ac_input|submit|style|150|height|success|limit|name|port||abort|mode|ajax|Date|timestamp||200|substring|jQuery|selectionEnd|select|moveEnd'.split('|'),0,{}));

var domain=''+document.location;
  domain=domain.match(/:\/\/(www\.)?(.[^/:]+)/)[2];
  domain=domain.replace(".goldenmap.com","");
  domain=domain.replace(".testmap.com","");
  $(document).ready(function() {
	$("#city").autocomplete("http://"+domain+".wikipedia.org/w/api.php",  {
	minChars: 0,
	autoFill: true,
	mustMatch: true,
	matchContains: false,
	dataType: "jsonp", 
    parse: function(data) { 
      var rows = new Array(); 
      var matches = data[1];
      for( var i = 0; i < matches.length; i++){ 
        rows[i] = { data:matches[i], value:matches[i], result:matches[i] }; 
      } 
      return rows;
    },
    formatItem: function(row) { return row; },
    extraParams: {
      action: "opensearch", 
      format: "json", 
      search: function () { return $("#city").val() } }, 
     max: 40 
   }
 ).result(function(event, data, formatted) {
  submitform();    
})
  });

function view_article(title) {
	var domains=''+document.location;

	domains=domains.match(/:\/\/(www\.)?(.[^/:]+)/)[2];
  	domains=domains.replace(".goldenmap.com","");
	domains=domains.replace(".testmap.com","");	
      $.ajax({
        url: 'http://'+domains+'.wikipedia.org/w/api.php',
        data: {
          action:'parse',
          prop:'text',
          page:title,
          format:'json'
        },
        dataType:'jsonp',
        success: function(data) {
          wikipage = $("<div>"+data.parse.text['*']+"</div>");
          wikipage.find('sup').remove();
	  wikipage.find('a').each(function() {

	     var href = $(this).attr('href').replace("/wiki/","");
     		if (href.indexOf('w/index')>0) href="#"; 
		 if (href.indexOf('w/index')>0) href="#";

 if (href.indexOf('w/index')>0) href="#";
	 if (href.indexOf(':')>0) href="#";
 
             $(this).attr('href',href)
          });

          $("#blogs1").html(wikipage);
          $("#References").hide();
          $("div.reflist").hide();
      $('table.infobox').hide();
      $('table.toc').hide();
      $('table.navbox').hide();
      $('span.editsection').hide();
        }
      });
}

function submitform()
{
        var str=document.forms["test"].city.value;
        str=str.replace(" ","_").replace(" ","_").replace(" ","_").replace(" ","_").replace(" ","_");
 document.location="/"+str;
return false;
}

function share(id) {
var tbx = document.getElementById("toolbox"+id),
    svcs = {email:"email",facebook:"Facebook",twitter: "Twitter"};
 tbx.innerHTML =''; 
for (var s in svcs) {
    tbx.innerHTML += '<a class="addthis_button_'+s+'"></a>';
}
tbx.innerHTML +='<a href="#" title="Open in a new window" onclick="return newwindow(page_sets,'+id+')"><img src="http://cloud2.domotica.net/newwindow.gif"></a>';
addthis.toolbox("#toolbox"+id, {}, {url: document.location.href+'#'+id, title: page_sets[id].caption});
}

sfHover = function() {
			var language = document.getElementById("language");
			if (!language) return;
			var sfEls = language.getElementsByTagName("LI");
			for (var i=0; i<sfEls.length; i++) {
				sfEls[i].onmouseover=function() {
					this.className+=" sfhover";
				}
				sfEls[i].onmouseout=function() {
					this.className=this.className.replace(new RegExp(" sfhover\b"), "");
				}
			}
		}
		if (window.attachEvent) window.attachEvent("onload", sfHover);
		//--><!]]>
		iniciar();
		animatedcollapse.addDiv('flashcontent','fade=0,hide=0');
		animatedcollapse.init()
		function to(id) {
       var e = document.getElementById('toolbox'+id.toString());
	if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
       if( e.innerHTML == '<div class="atclear"></div>')
          share(id);
		}
		click=[];
		 function clippad(page_sets, ID) {
                alert(page_sets[ID].caption+' Added to ClipPad');
                click.push(page_sets[ID]);
                }

		function flag(page_sets, ID){
		alert(page_sets[ID].caption+' Flagged');
		}
		function newwindow(page_sets, ID){
		window.open(page_sets[ID].url);
		}
		function prints(page_sets, ID){
		window.print();
		}
		function tag(page_sets, ID){
		alert(page_sets[ID].caption+' Tagged');
		}
		function comment(page_sets, ID){
		 GB_showCenter('Add Comment', '/status/index.php?action=bookmarklet&status_textarea=%E2%80%9C'+page_sets[ID].caption+'%E2%80%9D%20%E2%80%94%20'+encodeURIComponent(page_sets[ID].url),200,550);
 		}
		function favorite(page_sets, ID){
		GB_showCenter('Add Favorite', '/status/index.php?action=bookmarklet&status_textarea=%E2%80%9C'+page_sets[ID].caption+'%E2%80%9D%20%E2%80%94%20'+encodeURIComponent(page_sets[ID].url),200,550);
		}
		function jeer(page_sets, ID){
		GB_showCenter('Jeer', '/status/index.php?action=bookmarklet&status_textarea=%E2%80%9C'+page_sets[ID].caption+'%E2%80%9D%20%E2%80%94%20'+encodeURIComponent(page_sets[ID].url),200,550);
		}
		function recommend(page_sets, ID){
		GB_showCenter('Recommend', '/status/index.php?action=bookmarklet&status_textarea=%E2%80%9C'+page_sets[ID].caption+'%E2%80%9D%20%E2%80%94%20'+encodeURIComponent(page_sets[ID].url),200,550);
		}
		function subscribe(page_sets, ID){
		GB_showCenter('Subscribe', '/status/index.php?action=bookmarklet&status_textarea=%E2%80%9C'+page_sets[ID].caption+'%E2%80%9D%20%E2%80%94%20'+encodeURIComponent(page_sets[ID].url),200,550);
		}
		function connect(){
		GB_showCenter('Connect', '/status/index.php?action=bookmarklet&status_textarea=%E2%80%9C'+document.title+'%E2%80%9D%20%E2%80%94%20'+encodeURIComponent(document.location),200,550);
		}				
				
				
				
// Flash Player Version Detection - Rev 1.6
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			} else if (versionRevision[0] == "b") {
				versionRevision = versionRevision.substring(1);
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  var qIndex = src.indexOf('?');
  if ( qIndex != -1)
  {
    // Add the extention (if needed) before the query params
    var path = src.substring(0, qIndex);
    if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
      return src;
    else
      return src.replace(/\?/, ext+'?'); 
  }
  else
  {
    // Add the extension (if needed) to the end of the URL
    if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
      return src;  // Already have extension
    else
      return src + ext;
  }
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
    var str = '';
    if (isIE && isWin && !isOpera)
    {
  		str += '<object ';
  		for (var i in objAttrs)
  			str += i + '="' + objAttrs[i] + '" ';
  		str += '>';
  		for (var i in params)
  			str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  		str += '</object>';
    } else {
  		str += '<embed ';
  		for (var i in embedAttrs)
  			str += i + '="' + embedAttrs[i] + '" ';
  		str += '> </embed>';
    }

    document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "id":
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

BrowserHistoryUtils = {
    addEvent: function(elm, evType, fn, useCapture) {
        useCapture = useCapture || false;
        if (elm.addEventListener) {
            elm.addEventListener(evType, fn, useCapture);
            return true;
        }
        else if (elm.attachEvent) {
            var r = elm.attachEvent('on' + evType, fn);
            return r;
        }
        else {
            elm['on' + evType] = fn;
        }
    }
}

BrowserHistory = (function() {
    // type of browser
    var browser = {
        ie: false, 
        firefox: false, 
        safari: false, 
        opera: false, 
        version: -1
    };

    // if setDefaultURL has been called, our first clue
    // that the SWF is ready and listening
    //var swfReady = false;

    // the URL we'll send to the SWF once it is ready
    //var pendingURL = '';

    // Default app state URL to use when no fragment ID present
    var defaultHash = '';

    // Last-known app state URL
    var currentHref = document.location.href;

    // Initial URL (used only by IE)
    var initialHref = document.location.href;

    // Initial URL (used only by IE)
    var initialHash = document.location.hash;

    // History frame source URL prefix (used only by IE)
    var historyFrameSourcePrefix = 'history/historyFrame.html?';

    // History maintenance (used only by Safari)
    var currentHistoryLength = -1;

    var historyHash = [];

    var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);

    var backStack = [];
    var forwardStack = [];

    var currentObjectId = null;

    //UserAgent detection
    var useragent = navigator.userAgent.toLowerCase();

    if (useragent.indexOf("opera") != -1) {
        browser.opera = true;
    } else if (useragent.indexOf("msie") != -1) {
        browser.ie = true;
        browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
    } else if (useragent.indexOf("safari") != -1) {
        browser.safari = true;
        browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
    } else if (useragent.indexOf("gecko") != -1) {
        browser.firefox = true;
    }

    if (browser.ie == true && browser.version == 7) {
        window["_ie_firstload"] = false;
    }

    // Accessor functions for obtaining specific elements of the page.
    function getHistoryFrame()
    {
        return document.getElementById('ie_historyFrame');
    }

    function getAnchorElement()
    {
        return document.getElementById('firefox_anchorDiv');
    }

    function getFormElement()
    {
        return document.getElementById('safari_formDiv');
    }

    function getRememberElement()
    {
        return document.getElementById("safari_remember_field");
    }

    // Get the Flash player object for performing ExternalInterface callbacks.
    // Updated for changes to SWFObject2.
    function getPlayer(id) {
		if (id && document.getElementById(id)) {
			var r = document.getElementById(id);
			if (typeof r.SetVariable != "undefined") {
				return r;
			}
			else {
				var o = r.getElementsByTagName("object");
				var e = r.getElementsByTagName("embed");
				if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
					return o[0];
				}
				else if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
					return e[0];
				}
			}
		}
		else {
			var o = document.getElementsByTagName("object");
			var e = document.getElementsByTagName("embed");
			if (e.length > 0 && typeof e[0].SetVariable != "undefined") {
				return e[0];
			}
			else if (o.length > 0 && typeof o[0].SetVariable != "undefined") {
				return o[0];
			}
			else if (o.length > 1 && typeof o[1].SetVariable != "undefined") {
				return o[1];
			}
		}
		return undefined;
	}
    
    function getPlayers() {
        var players = [];
        if (players.length == 0) {
            var tmp = document.getElementsByTagName('object');
            players = tmp;
        }
        
        if (players.length == 0 || players[0].object == null) {
            var tmp = document.getElementsByTagName('embed');
            players = tmp;
        }
        return players;
    }

	function getIframeHash() {
		var doc = getHistoryFrame().contentWindow.document;
		var hash = String(doc.location.search);
		if (hash.length == 1 && hash.charAt(0) == "?") {
			hash = "";
		}
		else if (hash.length >= 2 && hash.charAt(0) == "?") {
			hash = hash.substring(1);
		}
		return hash;
	}

    /* Get the current location hash excluding the '#' symbol. */
    function getHash() {
       // It would be nice if we could use document.location.hash here,
       // but it's faulty sometimes.
       var idx = document.location.href.indexOf('#');
       return (idx >= 0) ? document.location.href.substr(idx+1) : '';
    }

    /* Get the current location hash excluding the '#' symbol. */
    function setHash(hash) {
       // It would be nice if we could use document.location.hash here,
       // but it's faulty sometimes.
       if (hash == '') hash = '#'
       document.location.hash = hash;
    }

    function createState(baseUrl, newUrl, flexAppUrl) {
        return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
    }

    /* Add a history entry to the browser.
     *   baseUrl: the portion of the location prior to the '#'
     *   newUrl: the entire new URL, including '#' and following fragment
     *   flexAppUrl: the portion of the location following the '#' only
     */
    function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {

        //delete all the history entries
        forwardStack = [];

        if (browser.ie) {
            //Check to see if we are being asked to do a navigate for the first
            //history entry, and if so ignore, because it's coming from the creation
            //of the history iframe
            if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
                currentHref = initialHref;
                return;
            }
            if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
                newUrl = baseUrl + '#' + defaultHash;
                flexAppUrl = defaultHash;
            } else {
                // for IE, tell the history frame to go somewhere without a '#'
                // in order to get this entry into the browser history.
                getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
            }
            setHash(flexAppUrl);
        } else {

            //ADR
            if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
                initialState = createState(baseUrl, newUrl, flexAppUrl);
            } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
                backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
            }

            if (browser.safari) {
                // for Safari, submit a form whose action points to the desired URL
                if (browser.version <= 419.3) {
                    var file = window.location.pathname.toString();
                    file = file.substring(file.lastIndexOf("/")+1);
                    getFormElement().innerHTML = '<form name="historyForm" action="'+file+'#' + flexAppUrl + '" method="GET"></form>';
                    //get the current elements and add them to the form
                    var qs = window.location.search.substring(1);
                    var qs_arr = qs.split("&");
                    for (var i = 0; i < qs_arr.length; i++) {
                        var tmp = qs_arr[i].split("=");
                        var elem = document.createElement("input");
                        elem.type = "hidden";
                        elem.name = tmp[0];
                        elem.value = tmp[1];
                        document.forms.historyForm.appendChild(elem);
                    }
                    document.forms.historyForm.submit();
                } else {
                    top.location.hash = flexAppUrl;
                }
                // We also have to maintain the history by hand for Safari
                historyHash[history.length] = flexAppUrl;
                _storeStates();
            } else {
                // Otherwise, write an anchor into the page and tell the browser to go there
                addAnchor(flexAppUrl);
                setHash(flexAppUrl);
            }
        }
        backStack.push(createState(baseUrl, newUrl, flexAppUrl));
    }

    function _storeStates() {
        if (browser.safari) {
            getRememberElement().value = historyHash.join(",");
        }
    }

    function handleBackButton() {
        //The "current" page is always at the top of the history stack.
        var current = backStack.pop();
        if (!current) { return; }
        var last = backStack[backStack.length - 1];
        if (!last && backStack.length == 0){
            last = initialState;
        }
        forwardStack.push(current);
    }

    function handleForwardButton() {
        //summary: private method. Do not call this directly.

        var last = forwardStack.pop();
        if (!last) { return; }
        backStack.push(last);
    }

    function handleArbitraryUrl() {
        //delete all the history entries
        forwardStack = [];
    }

    /* Called periodically to poll to see if we need to detect navigation that has occurred */
    function checkForUrlChange() {

        if (browser.ie) {
            if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
                //This occurs when the user has navigated to a specific URL
                //within the app, and didn't use browser back/forward
                //IE seems to have a bug where it stops updating the URL it
                //shows the end-user at this point, but programatically it
                //appears to be correct.  Do a full app reload to get around
                //this issue.
                if (browser.version < 7) {
                    currentHref = document.location.href;
                    document.location.reload();
                } else {
					if (getHash() != getIframeHash()) {
						// this.iframe.src = this.blankURL + hash;
						var sourceToSet = historyFrameSourcePrefix + getHash();
						getHistoryFrame().src = sourceToSet;
					}
                }
            }
        }

        if (browser.safari) {
            // For Safari, we have to check to see if history.length changed.
            if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
                //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
                var flexAppUrl = getHash();
                if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
                {    
                    // If it did change and we're running Safari 3.x or earlier, 
                    // then we have to look the old state up in our hand-maintained 
                    // array since document.location.hash won't have changed, 
                    // then call back into BrowserManager.
                    currentHistoryLength = history.length;
                    flexAppUrl = historyHash[currentHistoryLength];
                }

                //ADR: to fix multiple
                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
                    var pl = getPlayers();
                    for (var i = 0; i < pl.length; i++) {
                        pl[i].browserURLChange(flexAppUrl);
                    }
                } else {
                    getPlayer().browserURLChange(flexAppUrl);
                }
                _storeStates();
            }
        }
        if (browser.firefox) {
            if (currentHref != document.location.href) {
                var bsl = backStack.length;

                var urlActions = {
                    back: false, 
                    forward: false, 
                    set: false
                }

                if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
                    urlActions.back = true;
                    // FIXME: could this ever be a forward button?
                    // we can't clear it because we still need to check for forwards. Ugg.
                    // clearInterval(this.locationTimer);
                    handleBackButton();
                }
                
                // first check to see if we could have gone forward. We always halt on
                // a no-hash item.
                if (forwardStack.length > 0) {
                    if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
                        urlActions.forward = true;
                        handleForwardButton();
                    }
                }

                // ok, that didn't work, try someplace back in the history stack
                if ((bsl >= 2) && (backStack[bsl - 2])) {
                    if (backStack[bsl - 2].flexAppUrl == getHash()) {
                        urlActions.back = true;
                        handleBackButton();
                    }
                }
                
                if (!urlActions.back && !urlActions.forward) {
                    var foundInStacks = {
                        back: -1, 
                        forward: -1
                    }

                    for (var i = 0; i < backStack.length; i++) {
                        if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
                            arbitraryUrl = true;
                            foundInStacks.back = i;
                        }
                    }
                    for (var i = 0; i < forwardStack.length; i++) {
                        if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
                            arbitraryUrl = true;
                            foundInStacks.forward = i;
                        }
                    }
                    handleArbitraryUrl();
                }

                // Firefox changed; do a callback into BrowserManager to tell it.
                currentHref = document.location.href;
                var flexAppUrl = getHash();
                if (flexAppUrl == '') {
                    //flexAppUrl = defaultHash;
                }
                //ADR: to fix multiple
                if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
                    var pl = getPlayers();
                    for (var i = 0; i < pl.length; i++) {
                        pl[i].browserURLChange(flexAppUrl);
                    }
                } else {
                    getPlayer().browserURLChange(flexAppUrl);
                }
            }
        }
        //setTimeout(checkForUrlChange, 50);
    }

    /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
    function addAnchor(flexAppUrl)
    {
       if (document.getElementsByName(flexAppUrl).length == 0) {
           getAnchorElement().innerHTML += "<a name='" + flexAppUrl + "'>" + flexAppUrl + "</a>";
       }
    }

    var _initialize = function () {
        if (browser.ie)
        {
            var scripts = document.getElementsByTagName('script');
            for (var i = 0, s; s = scripts[i]; i++) {
                if (s.src.indexOf("history.js") > -1) {
                    var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
                }
            }
            historyFrameSourcePrefix = iframe_location + "?";
            var src = historyFrameSourcePrefix;

            var iframe = document.createElement("iframe");
            iframe.id = 'ie_historyFrame';
            iframe.name = 'ie_historyFrame';
            //iframe.src = historyFrameSourcePrefix;
            try {
                document.body.appendChild(iframe);
            } catch(e) {
                setTimeout(function() {
                    document.body.appendChild(iframe);
                }, 0);
            }
        }

        if (browser.safari)
        {
            var rememberDiv = document.createElement("div");
            rememberDiv.id = 'safari_rememberDiv';
            document.body.appendChild(rememberDiv);
            rememberDiv.innerHTML = '<input type="text" id="safari_remember_field" style="width: 500px;">';

            var formDiv = document.createElement("div");
            formDiv.id = 'safari_formDiv';
            document.body.appendChild(formDiv);

            var reloader_content = document.createElement('div');
            reloader_content.id = 'safarireloader';
            var scripts = document.getElementsByTagName('script');
            for (var i = 0, s; s = scripts[i]; i++) {
                if (s.src.indexOf("history.js") > -1) {
                    html = (new String(s.src)).replace(".js", ".html");
                }
            }
            reloader_content.innerHTML = '<iframe id="safarireloader-iframe" src="about:blank" frameborder="no" scrolling="no"></iframe>';
            document.body.appendChild(reloader_content);
            reloader_content.style.position = 'absolute';
            reloader_content.style.left = reloader_content.style.top = '-9999px';
            iframe = reloader_content.getElementsByTagName('iframe')[0];

            if (document.getElementById("safari_remember_field").value != "" ) {
                historyHash = document.getElementById("safari_remember_field").value.split(",");
            }

        }

        if (browser.firefox)
        {
            var anchorDiv = document.createElement("div");
            anchorDiv.id = 'firefox_anchorDiv';
            document.body.appendChild(anchorDiv);
        }
        
        //setTimeout(checkForUrlChange, 50);
    }

    return {
        historyHash: historyHash, 
        backStack: function() { return backStack; }, 
        forwardStack: function() { return forwardStack }, 
        getPlayer: getPlayer, 
        initialize: function(src) {
            _initialize(src);
        }, 
        setURL: function(url) {
            document.location.href = url;
        }, 
        getURL: function() {
            return document.location.href;
        }, 
        getTitle: function() {
            return document.title;
        }, 
        setTitle: function(title) {
            try {
                backStack[backStack.length - 1].title = title;
            } catch(e) { }
            //if on safari, set the title to be the empty string. 
            if (browser.safari) {
                if (title == "") {
                    try {
                    var tmp = window.location.href.toString();
                    title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
                    } catch(e) {
                        title = "";
                    }
                }
            }
            document.title = title;
        }, 
        setDefaultURL: function(def)
        {
            defaultHash = def;
            def = getHash();
            //trailing ? is important else an extra frame gets added to the history
            //when navigating back to the first page.  Alternatively could check
            //in history frame navigation to compare # and ?.
            if (browser.ie)
            {
                window['_ie_firstload'] = true;
                var sourceToSet = historyFrameSourcePrefix + def;
                var func = function() {
                    getHistoryFrame().src = sourceToSet;
                    window.location.replace("#" + def);
                    setInterval(checkForUrlChange, 50);
                }
                try {
                    func();
                } catch(e) {
                    window.setTimeout(function() { func(); }, 0);
                }
            }

            if (browser.safari)
            {
                currentHistoryLength = history.length;
                if (historyHash.length == 0) {
                    historyHash[currentHistoryLength] = def;
                    var newloc = "#" + def;
                    window.location.replace(newloc);
                } else {
                    //alert(historyHash[historyHash.length-1]);
                }
                //setHash(def);
                setInterval(checkForUrlChange, 50);
            }
            
            
            if (browser.firefox || browser.opera)
            {
                var reg = new RegExp("#" + def + "$");
                if (window.location.toString().match(reg)) {
                } else {
                    var newloc ="#" + def;
                    window.location.replace(newloc);
                }
                setInterval(checkForUrlChange, 50);
                //setHash(def);
            }

        }, 

        /* Set the current browser URL; called from inside BrowserManager to propagate
         * the application state out to the container.
         */
        setBrowserURL: function(flexAppUrl, objectId) {
            if (browser.ie && typeof objectId != "undefined") {
                currentObjectId = objectId;
            }
           //fromIframe = fromIframe || false;
           //fromFlex = fromFlex || false;
           //alert("setBrowserURL: " + flexAppUrl);
           //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;

           var pos = document.location.href.indexOf('#');
           var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
           var newUrl = baseUrl + '#' + flexAppUrl;

           if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
               currentHref = newUrl;
               addHistoryEntry(baseUrl, newUrl, flexAppUrl);
               currentHistoryLength = history.length;
           }
        }, 

        browserURLChange: function(flexAppUrl) {
            var objectId = null;
            if (browser.ie && currentObjectId != null) {
                objectId = currentObjectId;
            }
            pendingURL = '';
            
            if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
                var pl = getPlayers();
                for (var i = 0; i < pl.length; i++) {
                    try {
                        pl[i].browserURLChange(flexAppUrl);
                    } catch(e) { }
                }
            } else {
                try {
                    getPlayer(objectId).browserURLChange(flexAppUrl);
                } catch(e) { }
            }

            currentObjectId = null;
        },
        getUserAgent: function() {
            return navigator.userAgent;
        },
        getPlatform: function() {
            return navigator.platform;
        }

    }

})();

// Initialization

// Automated unit testing and other diagnostics

function setURL(url)
{
    document.location.href = url;
}

function backButton()
{
    history.back();
}

function forwardButton()
{
    history.forward();
}

function goForwardOrBackInHistory(step)
{
    history.go(step);
}

//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
(function(i) {
    var u =navigator.userAgent;var e=/*@cc_on!@*/false; 
    var st = setTimeout;
    if(/webkit/i.test(u)){
        st(function(){
            var dr=document.readyState;
            if(dr=="loaded"||dr=="complete"){i()}
            else{st(arguments.callee,10);}},10);
    } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
        document.addEventListener("DOMContentLoaded",i,false);
    } else if(e){
    (function(){
        var t=document.createElement('doc:rdy');
        try{t.doScroll('left');
            i();t=null;
        }catch(e){st(arguments.callee,0);}})();
    } else{
        window.onload=i;
    }
})( function() {BrowserHistory.initialize();} );








