﻿function ShowFlash(file, title){
	                var str = '<object type="application/x-shockwave-flash" data="vcastr3.swf" width="400" height="300" id="vcastr3"><param name="wmode" value="opaque" /><param name="movie" value="vcastr3.swf" /><param name="allowFullScreen" value="true" /><param name="FlashVars" value="xml=<vcastr><channel><item><source>' + file + '</source><duration></duration><title>filename tesst</title></item></channel><config><bufferTime>4</bufferTime><contralPanelAlpha>0.75</contralPanelAlpha><controlPanelBgColor>0x757d85</controlPanelBgColor><controlPanelBtnColor>0xffffff</controlPanelBtnColor><contralPanelBtnGlowColro>0x3c4045</contralPanelBtnGlowColro><controlPanelMode>float</controlPanelMode><defautVolume>1</defautVolume><isAutoPlay>true</isAutoPlay><isLoadBegin>true</isLoadBegin><isShowAbout>true</isShowAbout><scaleMode >showAll</scaleMode ></config></vcastr>" /></object>';
	                document.getElementById("flashcontent2").innerHTML = str;
	                document.getElementById("TitleAlbum").innerHTML = title;
	            }
function ShowFlashHome(file){
	                var str = '<object type="application/x-shockwave-flash" data="vcastr3.swf" width="460" height="239" id="vcastr3"><param name="wmode" value="opaque" /><param name="movie" value="vcastr3.swf" /><param name="allowFullScreen" value="true" /><param name="FlashVars" value="xml=<vcastr><channel><item><source>' + file + '</source><duration></duration><title>filename tesst</title></item></channel><config><bufferTime>4</bufferTime><contralPanelAlpha>0.75</contralPanelAlpha><controlPanelBgColor>0x757d85</controlPanelBgColor><controlPanelBtnColor>0xffffff</controlPanelBtnColor><contralPanelBtnGlowColro>0x3c4045</contralPanelBtnGlowColro><controlPanelMode>float</controlPanelMode><defautVolume>1</defautVolume><isAutoPlay>true</isAutoPlay><isloadbegin>true</isloadbegin><isShowAbout>true</isShowAbout><scaleMode >showAll</scaleMode ></config></vcastr>" /></object>';
	                document.getElementById("flashcontent").innerHTML = str;
	            }
function ShowFlashHome1(file){
	                var str = '<object type="application/x-shockwave-flash" data="vcastr3.swf" width="460" height="239" id="vcastr3"><param name="wmode" value="opaque" /><param name="movie" value="vcastr3.swf" /><param name="allowFullScreen" value="true" /><param name="FlashVars" value="xml=<vcastr><channel><item><source>' + file + '</source><duration></duration><title>filename tesst</title></item></channel><config><bufferTime>4</bufferTime><contralPanelAlpha>0.75</contralPanelAlpha><controlPanelBgColor>0x757d85</controlPanelBgColor><controlPanelBtnColor>0xffffff</controlPanelBtnColor><contralPanelBtnGlowColro>0x3c4045</contralPanelBtnGlowColro><controlPanelMode>float</controlPanelMode><defautVolume>1</defautVolume><isAutoPlay>false</isAutoPlay><isLoadBegin>true</isLoadBegin><isShowAbout>true</isShowAbout><scaleMode >showAll</scaleMode ></config></vcastr>" /></object>';
	                document.getElementById("flashcontent").innerHTML = str;
	            }	            
function OpenUrl(url){
    eduvision = window.open(url,"eduvision","menubar=no,width=530,height=600,toolbar=no,scrollbars=1");
    eduvision.focus();
}
function OpenCourse(url){
    eduvision = window.open(url,"eduvisionCourse","menubar=no,width=550,height=600,toolbar=no,scrollbars=1");
    eduvision.focus();
}
function OpenPingbox(url){
    eduvision = window.open(url,"eduvision","menubar=no,width=530,height=600,toolbar=no,scrollbars=1");
    eduvision.focus();
}
function OpenUrlEx(url,w,h){
    eduvision = window.open(url,"eduvision","menubar=no,width=" + w + ",height=" + h + ",toolbar=no,scrollbars=1");
    eduvision.focus();
}
function select_innerHTML(objeto,innerHTML){
/******
* select_innerHTML - corrige o bug do InnerHTML em selects no IE
* Veja o problema em: http://support.microsoft.com/default.aspx?scid=kb;en-us;276228
* Versão: 2.1 - 04/09/2007
* Autor: Micox - Náiron José C. Guimarães - micoxjcg@yahoo.com.br
* @objeto(tipo HTMLobject): o select a ser alterado
* @innerHTML(tipo string): o novo valor do innerHTML
*******/
    objeto.innerHTML = ""
    var selTemp = document.createElement("micoxselect")
    var opt;
    selTemp.id="micoxselect1"
    document.body.appendChild(selTemp)
    selTemp = document.getElementById("micoxselect1")
    selTemp.style.display="none"
    if(innerHTML.toLowerCase().indexOf("<option")<0){//se não é option eu converto
        innerHTML = "<option>" + innerHTML + "</option>"
    }
    innerHTML = innerHTML.replace(/<option/g,"<span").replace(/<\/option/g,"</span")
    selTemp.innerHTML = innerHTML
      
    
    for(var i=0;i<selTemp.childNodes.length;i++){
  var spantemp = selTemp.childNodes[i];
  
        if(spantemp.tagName){     
            opt = document.createElement("OPTION")
    
   if(document.all){ //IE
    objeto.add(opt)
   }else{
    objeto.appendChild(opt)
   }       
    
   //getting attributes
   for(var j=0; j<spantemp.attributes.length ; j++){
    var attrName = spantemp.attributes[j].nodeName;
    var attrVal = spantemp.attributes[j].nodeValue;
    if(attrVal){
     try{
      opt.setAttribute(attrName,attrVal);
      opt.setAttributeNode(spantemp.attributes[j].cloneNode(true));
     }catch(e){}
    }
   }
   //getting styles
   if(spantemp.style){
    for(var y in spantemp.style){
     try{opt.style[y] = spantemp.style[y];}catch(e){}
    }
   }
   //value and text
   opt.value = spantemp.getAttribute("value")
   opt.text = spantemp.innerHTML
   //IE
   opt.selected = spantemp.getAttribute('selected');
   opt.className = spantemp.className;
  } 
 }    
 document.body.removeChild(selTemp)
 selTemp = null
}

function FixHeight(){
    var mainContent = jQuery(".BottomSubBox");
    //alert(mainContent);
    if(mainContent == null){
        mainContent = jQuery(".BottomSubBox03");
        
    }
    if(mainContent != null && jQuery(".SubContent2") != null){
        var heightMain = mainContent.outerHeight();
        var heightRight = jQuery(".SubContent2").outerHeight();
        heightRight = heightRight - 35;
        if(heightMain < heightRight)
            mainContent.css("min-height", heightRight + "px");
    }
}
function failsafeImg(){
    var badImg = new Image();
    badImg.src = 'images/no-img.png';
    for(var i=0;i<document.images.length;i++){
        var cpyImg = new Image();
        cpyImg.src = document.images[i].src;
        if(!cpyImg.width){
            document.images[i].src = badImg.src;
        }
    }
}
