function BGNew(obj, new_style) { 
	obj.className = new_style; 
}
function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span");
		if(el.style.display != "block"){
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu")
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

/***********************************************
* DD Tab Menu II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

//Set tab to intially be selected when page loads:
//[which tab (1=first tab), ID of tab content to display]:
var initialtab=[1, "sc1"]

//Turn menu into single level image tabs (completely hides 2nd level)?
var turntosingle=0 //0 for no (default), 1 for yes

//Disable hyperlinks in 1st level tab images?
var disabletablinks=0 //0 for no (default), 1 for yes


////////Stop editting////////////////

var previoustab=""

if (turntosingle==1)
document.write('<style type="text/css">\n#tabcontentcontainer{display: none;}\n</style>')

function toggleLogin(id){
	if (document.getElementById(id).style.display=='none')
		document.getElementById(id).style.display = ''
	else
		document.getElementById(id).style.display = 'none'
}
function showlogin(frm,id){
	toggleLogin(id);
	frm.uname.focus();
}
function hidelogin(elem){
	if (document.activeElement.className!=elem.className){
		toggleLogin(elem.form.parentElement.id);
	}
	else 
	if (document.activeElement.form.name!=elem.form.name){
			toggleLogin(elem.form.parentElement.id)
	}
}

function noTab(){
	disabletablinks=1
}
function linkTab(cid,name){
	expandcontent(cid, document.getElementById(name));
}
function showTxtInput(name){
	document.getElementById(name).style.display = '';
}

function upload(field){
	window.open("fileupload.asp?field="+field, "Upload", "width=400,height=250,scrollbars=yes,toolbar=no,status=no,menubar=no")
}

function uploadTape(field){
	window.open("fileuploadT.asp?field="+field, "Upload", "width=400,height=250,scrollbars=yes,toolbar=no,status=no,menubar=no")
}
function uploadVoice(field){
	window.open("fileuploadV.asp?field="+field, "Upload", "width=400,height=250,scrollbars=yes,toolbar=no,status=no,menubar=no")
}
function exportTalent(obj){
	window.open("talentexport.asp", "Export", "width=400,height=250,scrollbars=yes,toolbar=no,status=no,menubar=no")
}

function loadMedia(url) {
	var load = window.open(url,'','scrollbars=no,menubar=no,height=200,width=200,resizable=yes,toolbar=no,location=no,status=no'); 
}

function playVideo(fname){
	var val;
	var playrObj;
	val = fname.replace(/^\s*|\s*$/g,"");
	if (val.length>0){
		document.getElementById("mediaPic").style.display = 'none'
		document.getElementById("mediaPlayer").style.display = ''
		playrObj = document.getElementById("WinMedia");
		playrObj.Play(); 

/*		loadMedia("/theDiamondAgency/talents/tapes/"+val)
*/
	}
}

function playTape(field){
	var val;
	var fname;
	fname = field.value;
	val = fname.replace(/^\s*|\s*$/g,"");
	if (val.length>0){
		loadMedia("/theDiamondAgency/talents/tapes/"+val)
	}
}

function hearVoice(fname){
	var val;
	val = fname.replace(/^\s*|\s*$/g,"");
	if (val.length>0){
		document.getElementById("BGSOUND_ID").src="/theDiamondAgency/talents/voices/"+val;
	}
}
function stopVoice(){
	document.getElementById("BGSOUND_ID").src="";
}


function submitForm(sel){
	if (sel.value != 0){ 
		document.form.onchg.value=true;
		document.form.submit();
	}
}

function displayResults(idx,cid,ind){
	if (ind=="True")
		initialtab=[idx, cid]
}

function expandcontent(cid, aobject){
	if (disabletablinks==1)
		aobject.onclick=new Function("return false")
	if (document.getElementById && turntosingle==0){
		highlighttab(aobject)
		if (previoustab!="")
			document.getElementById(previoustab).style.display="none"
		document.getElementById(cid).style.display="block"
		previoustab=cid
	}
}


function highlighttab(aobject){
if (typeof tabobjlinks=="undefined")
collectddimagetabs()
for (i=0; i<tabobjlinks.length; i++)
tabobjlinks[i].className=""
aobject.className="current"
}

function collectddimagetabs(){
var tabobj=document.getElementById("ddimagetabs")
tabobjlinks=tabobj.getElementsByTagName("A")
}

function do_onload(){
	if (disabletablinks==0){
		collectddimagetabs()
		expandcontent(initialtab[1], tabobjlinks[initialtab[0]-1])
	}
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

