var flag=0;
function nochange(mes) {
	if (mes==1) flag=1;
	else flag=0;
}
function changeMap(flaCauntry, OnOff) {	
	if (flag==0) {
		if (OnOff=="1") window.document.mapubc.TGotoFrame("_flash0/allmap/"+flaCauntry, 2);
		if (OnOff=="2")window.document.mapubc.TGotoFrame("_flash0/allmap/"+flaCauntry, 0);
		if (OnOff=="3") {
			flag=1;
			window.document.mapubc.TPlay("_flash0/allmap/"+flaCauntry+"_movie");
			window.document.mapubc.TGotoFrame("_flash0/allmap/"+flaCauntry, 0);
			window.document.mapubc.TPlay("_flash0/allmap");
		}
	}	
}

function vote(b,v){
	src='voice.php'
	plus='?'+b+'::'+v;
	window.open(src+plus,'win','resizable,width=1,height=1,screenX=0,screenY=0,top=0,left=0');
}

function openme(url,w,h,more){
	text='width='+ w +',height='+ h +','+more;
	window.open(url,'DETAILED',text);
}

function imgWin(img){
	var scr='images/photo.html'
	var wn=window.open(scr+'?'+escape(img),'win','resizable,width=1,height=1,screenX=0,screenY=0,top=0,left=0')
	wn.focus()
	return false
}

function mClk(src,name) {
    if(event.srcElement.tagName=='TD'){	  
      src.children.tags('A')[0].click();
    }
} 
  
function mOvr(src) {
    if (!src.contains(event.fromElement)) {
      src.style.cursor = 'hand';      
    }
}
function mOut(src) {
    if (!src.contains(event.toElement)) {
      src.style.cursor = 'default';      
    }
}

function save() {
	this.document.execCommand("SaveAs")
}

function question(text,go_link) {
	if (confirm(text)) document.location=go_link;
}

function insert_text() {
	var myQuery = document.sqlform.sql_query;
    var myListBox = document.sqlform.tables;

    if(myListBox.options.length > 0) {
        var chaineAj = "";
        var NbSelect = 0;
        for(var i=0; i<myListBox.options.length; i++) {
            if (myListBox.options[i].selected){
                NbSelect++;
                if (NbSelect > 1)
                    chaineAj += ", ";
                chaineAj += myListBox.options[i].value;
            }
        }

        //IE support
        if (document.selection) {
            myQuery.focus();
            sel = document.selection.createRange();
            sel.text = chaineAj;
            document.sqlform.insert.focus();
        }
        //MOZILLA/NETSCAPE support
        else if (document.sqlform.sql_query.selectionStart || document.sqlform.sql_query.selectionStart == "0") {
            var startPos = document.sqlform.sql_query.selectionStart;
            var endPos = document.sqlform.sql_query.selectionEnd;
            var chaineSql = document.sqlform.sql_query.value;

            myQuery.value = chaineSql.substring(0, startPos) + chaineAj + chaineSql.substring(endPos, chaineSql.length);
        } else {
            myQuery.value += chaineAj;
        }
    }
}

function unsetcolor(theRow,color) {
	theRow.style.backgroundColor=color;
	theRow.style.color='#000000';
	theRow.style.cursor='default';
}

function setcolor(theRow,color) {
	theRow.style.backgroundColor=color;
	theRow.style.color='#ffffff';
	theRow.style.cursor = 'hand'; 
}

function load_mp3(id) {
		document.location="rating.php?rating=load_mp3&id="+id;
}

function uprating(elem) {
	elem.disabled=true;	
}