doc  = document;
if (document.all)
{
    doc = document.all;
}

function changeImages() 
{
   if (document.images) 
   {
        for (var i=0; i<changeImages.arguments.length; i+=2) 
        {
           doc[changeImages.arguments[i]].src = changeImages.arguments[i+1];
        }
   }
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function linkMenu(selObj){    
  if(selObj.options[selObj.selectedIndex].value)
	  window.open (selObj.options[selObj.selectedIndex].value);
  selObj.selectedIndex=0;
  return false;
}

function switchStyles(action){
    if (action == 'on'){
        document.getElementById('s1').style.color='#CC0000';
        document.getElementById('s2').style.color='#FFF';
    }else{
        document.getElementById('s1').style.color='#FFF';
        document.getElementById('s2').style.color='#CC0000';
    }
}

function switchStyles2(action){
    if (action == 'on'){
        document.getElementById('t1').style.color='#FFF';
        document.getElementById('t2').style.color='#CC0000';
    }else{
        document.getElementById('t1').style.color='#0099FF';
        document.getElementById('t2').style.color='#CCC';
    }
}

function switchStyles3(action){
    if (action == 'on'){
        document.getElementById('b1').style.color='#FFF';
        document.getElementById('b2').style.color='#CC0000';
    }else{
        document.getElementById('b1').style.color='#0099FF';
        document.getElementById('b2').style.color='#CCC';
    }
}

function clickClear(thisfield, defaulttext){
   // alert('hiya');
    if (thisfield.value == defaulttext) {
		thisfield.value = "";
	}
}

function clickReplace(thisfield, defaulttext){
    //alert('hiya2');
    if (thisfield.value == "") {
		thisfield.value = defaulttext;
	}
}

// popup class
var popper =
{
	width:Number,
	height:Number,
	url:String,
	wName:String,
	hresize:Boolean,
	hscroll:Boolean,
	x:Number,
	y:Number,
	hfocus:Boolean,
	
	show:function()
	{
		var hscroll = popper.hscroll === true ? 'yes' : 'no';
		var hresize = popper.hresize === true ? 'yes' : 'no';
		
		if (popper.x < 0)
		{
			if (window.screen)
			{
				if ((navigator.appVersion.indexOf("Mac") != -1) && ((navigator.appName === "Netscape") && !(navigator.userAgent.indexOf('Safari') != -1)))
				{
					popper.x = (screen.width - popper.width) / 2;
				} else {
					popper.x = (screen.availWidth - popper.width) / 2;
				}
			} else {
				popper.x = 0;
			}
		}
		
		if (popper.y < 0)
		{
			if (window.screen)
			{
				if ((navigator.appVersion.indexOf("Mac") != -1) && ((navigator.appName == "Netscape") && !(navigator.userAgent.indexOf('Safari')!= -1)))
				{
					popper.y = (screen.height - popper.height) / 2;
				} else {
					popper.y = (screen.availHeight - popper.height) / 2;
				}
			} else {
				popper.y = 0;
			}
		}
		
		var wnd = open(popper.url, popper.wName, 'width=' + popper.width
							  + ',height='+ popper.height
							  + ',screenX=' + popper.x
							  + ',screenY=' + popper.y
							  + ',top=' + popper.y
							  + ',left=' + popper.x
							  + ',resizable=' + hresize
							  + ',scrollbars=' + hscroll);
		if (this.hfocus)
		{
			wnd.focus();
		}
		
		return wnd;
	}
}

function updatePop()
{
    popper.width = 710;
    popper.height = 544;

    popper.url = '/updateform_talent.aspx';
	popper.wName = 'update1';
	popper.hresize = false;
	popper.hscroll = true;
	popper.x = -1;
	popper.y = -1;

    popper.show();
}

function updatePop2()
{
    popper.width = 674;
    popper.height = 444;

    popper.url = '/updateform_other.aspx';
	popper.wName = 'update2';
	popper.hresize = false;
	popper.hscroll = true;
	popper.x = -1;
	popper.y = -1;

    popper.show();
}

function confirmPop() 
{
    var winwidth=400
    var winheight=290
    if (window.screen) 
    {
        if ((navigator.appVersion.indexOf("Mac") != -1) && ((navigator.appName == "Netscape") && !(navigator.userAgent.indexOf('Safari')!= -1))) 
        {
			window.innerWidth = winwidth
			window.innerHeight = winheight
			window.screenX = (screen.availWidth-winwidth)/2;
			window.screenY = (screen.availHeight-winheight)/2;
			window.name='confirmwin';
        } else {
			var ww = (screen.availWidth - winwidth)/2;
			var wh = (screen.availHeight - winheight)/2;
			window.moveTo(ww, wh);
			window.resizeTo(winwidth, winheight);
			window.name='confirmwin';
        }
    } else {
		window.resizeTo(winwidth, winheight);
		window.name='confirmwin';
    }
}

function videoPop(id)
{
	popper.width = 360;
    popper.height = 436;

    popper.url = '../Pages/talent_video.aspx?id=' + id;
	popper.wName = 'talent_video';
	popper.hresize = false;
	popper.hscroll = false;
	popper.x = -1;
	popper.y = -1;

    popper.show();
}

function audioPop(id)
{
	popper.width = 360;
    popper.height = 200;

    popper.url = '../Pages/talent_audio.aspx?id=' + id;
	popper.wName = 'talent_audio';
	popper.hresize = false;
	popper.hscroll = false;
	popper.x = -1;
	popper.y = -1;

    popper.show();
}

function linkPop(id) {
    popper.width = 900;
    popper.height = 500;

    popper.url = '../Pages/talent_link.aspx?id=' + id; 

    popper.wName = 'sbv_link';
    popper.hresize = false;
    popper.hscroll = true;
    popper.x = -1;
    popper.y = -1;

    popper.show();
}


///////////////////

    function doClick(buttonName,e)
    {
//the purpose of this function is to allow the enter key to 
//point to the correct button to click.
        var key;

         if(window.event)
              key = window.event.keyCode;     //IE
         else
              key = e.which;     //firefox
    
        if (key == 13)
        {
            //Get the button the user wants to have clicked
            var btn = document.getElementById(buttonName);
            if (btn != null)
            { //If we find the button click it
                btn.click();
                event.keyCode = 0
            }
        }
   }
