/*function slideSwitch() {
    var $active = $('#slideshow IMG.active');

    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');

    // use this to pull the images in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // uncomment the 3 lines below to pull the images in random order
    
    // var $sibs  = $active.siblings();
    // var rndNum = Math.floor(Math.random() * $sibs.length );
    // var $next  = $( $sibs[ rndNum ] );


    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 8000 );
});
*/

function switchSelected( formatType ){
	
	document.getElementById(formatType + "_radio").checked = true;
	//alert("insType: " + insType);
	switch (formatType)
	{
	    case "topalign":
	        document.getElementById(formatType + "_link").className = formatType + "_link_selected";
	        break;
	    case "leftalign":
	        document.getElementById(formatType + "_link").className = formatType + "_link_selected";
	        break;
		case "none":
	        document.getElementById(formatType + "_link").className = formatType + "_link_selected";
	        break;
	    default:
	        document.getElementById(formatType + "_link").className = formatType;
	        break;
	}
	
/*	if(error_condition){
	    ClearErrors();
		if(ValidateForm()){
			document.forms[0].submit();
		}
	}
	else {
	    document.forms[0].zip.focus();
	}
	document.forms[0].zip.focus();
	
*/
	//return false;
}

function resetSelected(formatType) {
	var radioGrp = document.forms[0].layout;
	var type = '';
	for( var i=0;i<radioGrp.length; i++){
		if( radioGrp[i].checked ){
			type = radioGrp[i].value;
		}
	}
	
	switch (formatType)
	{
	    case "topalign":
            document.getElementById("topalign_link").className = "topalign_link_selected";
	        document.getElementById("leftalign_link").className = "leftalign";
			document.getElementById("none_link").className = "none";
	        break;
	    case "leftalign":
            document.getElementById("topalign_link").className = "topalign";
	        document.getElementById("leftalign_link").className = "leftalign_link_selected";
			document.getElementById("none_link").className = "none";
			break
		case "none":
            document.getElementById("topalign_link").className = "topalign";
	        document.getElementById("leftalign_link").className = "leftalign";
			document.getElementById("none_link").className = "none_link_selected";
			break

		default:
	        document.getElementById("topalign_link").className = "topalign";
	        document.getElementById("leftalign_link").className = "leftalign";
			document.getElementById("none_link").className = "none";
	        break;
	}
}

function itemCheck(theElement)
{
	var theForm = theElement.form, z = 0;
	for(z=0; z<theForm.length;z++)
	{
		if(theForm[z].type == 'checkbox' && (theForm[z].id == 'chkArticle[]' || theForm[z].id == 'chkGallery[]' || theForm[z].id == 'chkPressRelease[]'))
		{
			theForm[z].checked = theElement.checked;
		}
	}
}

function display(obj)
{
  	var i = document.getElementById(obj);

  	if(i)
  	{
   	 	if(i.style.display == "none")
		{
      		i.style.display = "";
		}
   	 	else
      	{
			i.style.display = "none";
		}
  	}
}

function SelectClass(obj) {
	var c = obj.selectedIndex;
	window.location.href("driver_profiles.php?class=" + (c+1));
}
