//<!--
// includes/scripts.js



function changePlusMinus(id, sMinus, sPlus)
{
	var img = document.getElementById(id);
	if (img != null)
	{
		var bExpand = img.src.indexOf(sPlus) >= 0;
		if (! bExpand)
			img.src = sPlus;
		else
			img.src = sMinus;
	}
}




function initFocus() 
{
	document.form.elements[0].focus();
}



function SubDisable(f) 
{
	if (document.getElementById)
	{
		for (var sch = 0; sch < f.length; sch++) 
		{
			if (f.elements[sch].type.toLowerCase() == "submit")
			{
				f.elements[sch].disabled = true;
			}
		}                  
	}                   
	return true;          
}            


function waitValidate(f)
{
	var ProcessingText = "Please wait...";
	f.submit.value=ProcessingText;
	//f.submit.disabled=true;
	SubDisable(f);
	f.submit();
}



function Invers()
{
        temp = document.form.elements.length;
        for (i=0; i < temp; i++)
	{
                if (document.form.elements[i].checked == 1)
		{
                        document.form.elements[i].checked = 0;
		}
                else
		{
                        document.form.elements[i].checked = 1;
		}
	}
}

function doCheckIT()
{
	temp = document.form.elements.length;
	for (i=0; i<temp; i++)
	{
		if (document.form.elements[i].checked == 1)
		{
			document.form.elements[i].checked = 1;
		}
		else
		{
			document.form.elements[i].checked = 1;
		}
	}
}


function doUnCheckIT()
{
        temp = document.form.elements.length;
        for (i=0; i<temp; i++)
        {
                if (document.form.elements[i].checked == 1)
                {
                        document.form.elements[i].checked = 0;
                }
                else
                {
                        document.form.elements[i].checked = 0;
                }
        }
}



function clearDefault(el) 
{
	if (el.defaultValue==el.value) el.value = ""
}




function clickTrack(id,ip,js,r,ur)
{
	var proto = location.protocol;
	http.open('post',''+proto+'//www.classicalsinger.com/adserv/adTrack.php',true);
	http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	http.send('id='+id+'&ip='+ip+'&js='+js+'&r='+r+'&ur='+ur);
}



function clickAudTrack(self,rec,action)
{
	var string;

	if (action == "D")
	{
		//var answer = confirm("You are deleting this listing from My Auditions area.");
		var answer = confirm("You are about to delete all tracking information you have for this Audition.  Click OK to Delete.");
		if (answer)
		{
			string = 'id='+self.id+'&rec='+rec+'&check=0';
		}
		else
		{
			string = '';
		}
	}


	if (action == 'A')
	{
		string = 'id='+self.id+'&rec='+rec+'&check=1';
	}

	if (string != "")
	{
		var proto = location.protocol;
		http.open('post',''+proto+'//www.classicalsinger.com/auditions/audTrack.php',true);
		http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		http.send(string);

		var elem1 = self.id + "-A";
		var elem2 = self.id + "-B";

		if (action == 'A')
		{
			if (document.getElementById(elem2).style.display == 'none')
			{
				document.getElementById(elem1).style.display = 'none';
				document.getElementById(elem2).style.display = '';
			}
		}

		if (action == 'D')
		{
			if (document.getElementById(elem2).style.display == '')
			{
				document.getElementById(elem1).style.display = '';
				document.getElementById(elem2).style.display = 'none';
			}
		}
	}
}



function clickCompTrack(self,rec,action)
{
        var string;

        if (action == "D")
        {
                //var answer = confirm("You are deleting this listing from My Competitions area.");
                var answer = confirm("You are about to delete all tracking information you have for this Competition.  Click OK to Delete.");
                if (answer)
                {
                        string = 'id='+self.id+'&rec='+rec+'&check=0';
                }
                else
                {
                        string = '';
                }
        }


        if (action == 'A')
        {
                string = 'id='+self.id+'&rec='+rec+'&check=1';
        }

        if (string != "")
        {
                var proto = location.protocol;
                http.open('post',''+proto+'//www.classicalsinger.com/directories/competition/compTrack.php',true);
                http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
                http.send(string);

                var elem1 = self.id + "-A";
                var elem2 = self.id + "-B";

                if (action == 'A')
                {
                        if (document.getElementById(elem2).style.display == 'none')
                        {
                                document.getElementById(elem1).style.display = 'none';
                                document.getElementById(elem2).style.display = '';
                        }
                }

                if (action == 'D')
                {
                        if (document.getElementById(elem2).style.display == '')
                        {
                                document.getElementById(elem1).style.display = '';
                                document.getElementById(elem2).style.display = 'none';
                        }
                }
        }
}




function getXHTTP()
{
        var xhttp;
        try
        {   // The following "try" blocks get the XMLHTTP object for various browsers.
                xhttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e)
        {
                try
                {
                        xhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                catch (e2)
                {
                        // This block handles Mozilla/Firefox browsers...
                        try
                        {
                                xhttp = new XMLHttpRequest();
                        }
                        catch (e3)
                        {
                                xhttp = false;
                        }
                }
        }
        return xhttp; // Return the XMLHTTP object
}

var http = getXHTTP(); // This executes when the page first loads.


// -->

