if ( typeof barge == "undefined" ) barge = true;
if ( typeof delay == "undefined" ) delay = 20;
if ( typeof myChatID == "undefined" ) myChatID = "ChatButton";
if ( typeof myChatButton == "undefined" ) myChatButton = "button_live.gif";
if ( typeof myLocation == "undefined" ) myLocation = "";

function loadChatButton() {
	var statusurl = "http://chat.universityalliance.com/media/VisitorChat/chatstatus.asp";
	//var statusurl = "http://talismaqa/media/VisitorChat/chatstatus.asp";
	var program = "Bisk";
	var department = "Sales";
	var school = "CPA";
	var team = "108";

	document.write('<div id="' + myChatID + '"><a href="javascript:void(0)" onclick="gotoPreChat()"><img src="' + myLocation + 'images/' + myChatButton + '"></a></div>');
	var so = new SWFObject( myLocation + "_includes/chatbutton.swf", "flashChatButton", "100%", "100%", "8" );
	so.addParam( "menu", false );
	so.addParam( "scale", "noborder" );
	so.addParam( "salign", "BR" );
	so.addParam( "allowScriptAccess", "always" ); 
	so.addParam( "wmode", "transparent" ); 
	
	so.addVariable( "statusurl", statusurl );
	so.addVariable( "program", program );
	so.addVariable( "department", department );
	so.addVariable( "school", school );
	so.addVariable( "team", team );
	so.addVariable( "barge", barge );
	so.addVariable( "delay", delay );
		
	so.write( myChatID );
}

function gotoPreChat() {
	CheckBrowser(false);
}

function gotoChat() {
	CheckBrowser(false);
}

function gotoForm() {
	document.location = myLocation + "chatunavailable.asp?CurURL=" + document.location.href;
}

function clickChat() {
	if (document.flashChatButton) {
		if (typeof document.flashChatButton.asCheckStatus == "function") {
			document.flashChatButton.asCheckStatus();
		} else if (typeof document.flashChatButton.SetVariable == "function") {
			document.flashChatButton.SetVariable("clickButton", true);
		} else {
			gotoPreChat();
		}
	} else {
		gotoPreChat();
	}
}

loadChatButton();