//obj.style.display = !show ? "none" : IE ? "inline" : "table-row";
function getDoc(id){
    if(id!=''){
        if(document.getElementById(id)){
            return document.getElementById(id);
        }
        else{
            alert("ID a seguir inválido: "+id);
            return false;
        }
    }
    else{
        alert("Id não foi informado para função getDoc");
        return false;
    }
}

function openOrClose(id){
    var status = getDoc(id).style.display;
    var resp = '';
    if(status!=''){
        resp = '';
    }
    else{
        resp = 'none';
    }
    getDoc(id).style.display = resp;
}

function openDiv(id){
    var resp = '';
    getDoc(id).style.display = resp;
}

function closeDiv(id){
    var resp = 'none';
    getDoc(id).style.display = resp;
}


function exibeFlash(swf, width, height, wmode, cache)
{
    noCache = cache || cache == undefined ? "" : "?";
    wmode = wmode || wmode == undefined ? "opaque" : "transparent";

    monta_swf = "";
    monta_swf += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\""+ width +"\" height=\""+ height +"\" title=\"\">";
    monta_swf += "<param name=\"movie\" value=\""+ swf + noCache +"\" />";
    monta_swf += "<param name=\"quality\" value=\"high\" />";
    monta_swf += "<param name=\"menu\" value=\"0\" />";

    monta_swf += "<param name=\"wmode\" value=\"transparent\" />";
    monta_swf += "<param name=\"scale\" value=\"noborder\" />";


    monta_swf += "<embed src=\""+ swf + noCache +"\" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+ width +"\" height=\""+ height +"\"></embed>";
    monta_swf += "</object>";

    document.write(monta_swf);
}

function mostra_responsavel(age){
    if(age<=18){
	openDiv("responsavel");
    }
    else{
        closeDiv("responsavel");
    }
}

function mostra_responsavel_err(){
	
	var birthyear=document.getElementById("birthdate[2]").value;
	var yearnow = new Date().getFullYear();
	var age = yearnow - birthyear;
	
	if(age != "" && age<=18){
		openDiv("responsavel");
    	}
    	else{
        	closeDiv("responsavel");
    	}
}

function mostra_estado(country){
    if(country != 10){
	openDiv("state_text");
        closeDiv("state"); 
    }
    else{
	openDiv("state");
        closeDiv("state_text");
        
    }
}

function load_account(){
	mostra_responsavel_err();
	var country=document.getElementById("country").value;
	mostra_estado(country);

}

function check_school(school){
  if(school == "other")
    openDiv("other_schools");
}

