


//var url = 'http://staging.micromedic.com/carolinadining/beta/'
var url = ""
var currID = ""
var menuState = ""

////////////////////////////////////////////////
// Description: Changes image on mouseover to the imgName_on variable
///////////////////////////////////////////////
function act(imgName) {
  //if (document.images) 
    document.images[imgName].src = eval(imgName + "_on.src");

}
////////////////////////////////////////////////
// Description: Changes image on mouseover to the imgName variable
///////////////////////////////////////////////
function inact(imgName) {
  //if (document.images)
    document.images[imgName].src = eval(imgName + ".src");
}

////////////////////////////////////////////////
// Description: Renders links for our dropdown menus if user has IE 5 and up on home page
///////////////////////////////////////////////
function renderLink(href, imgName, src, width, height) {
	var menu = '<a href="' + href + '"><img name="' + imgName + '" id="' + imgName + '" onmouseover="showMenu(event)" onmouseout="hideMenu(event)" src="' + src + '" width="' + width + '" height="' + height + '" border="0" alt="" /></a>'
	var nonmenu = '<a href="' + href + '"><img src="' + src + '" width="' + width + '" height="' + height + '" border="0" alt="" /></a>'
	var flashVersion = getFlashVersion();
	if ((flashVersion >= 5) && (is_ie5up)) {
		document.write(menu);
	} else {
		document.write(nonmenu);
	}
}
////////////////////////////////////////////////
// Description: XHTML standard way of rendering links for external targets.  Use 
//	syntax - <a href="" rel="external">Link</a> and call on the onload statement
///////////////////////////////////////////////
function externalLinks() { 
 if (!document.getElementsByTagName) return; 
 var anchors = document.getElementsByTagName("a"); 
 for (var i=0; i<anchors.length; i++) { 
   var anchor = anchors[i]; 
   if (anchor.getAttribute("href") && 
       anchor.getAttribute("rel") == "external") 
     anchor.target = "_blank"; 
 } 
} 
////////////////////////////////////////////////
// Description: XHTML standard way of rendering links for external targets.  Use 
//	syntax - <a href="" rel="external">Link</a> and call on the onload statement
///////////////////////////////////////////////
function WinOpeninternet(url, width, height) {

window.open(url,"","toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=no,status=no,width=" + width + ",height=" + height);

}




function menuOver(groupID, HTMLElementNameOrID, Direction) {
alert('show ' + groupID)
	//if (menuState == "open") {
		//swapButton(currID)
	//}
	menuState = "open"
	currID = groupID
	
	//act(HTMLElementNameOrID)
	
	cswmShow(groupID, HTMLElementNameOrID, Direction)
	
	if (groupID == "about_intersouth") {
		// over about
		act(HTMLElementNameOrID)
		document.images['about_before'].src = eval('lightbluepixel' + ".src");
		document.images['btn_about_spacer'].src = eval('btn_about_spacera' + ".src");
	}
	if (groupID == "our_team") {
		act('btn_ourteam')
		document.images['btn_ourteam_spacer'].src = eval('btn_about_spacera' + ".src");
		document.images['btn_about_spacer'].src = eval('btn_about_spacerb' + ".src");
		//alert(document.images['btn_ourteam_spacer'].src)
	}
	if (groupID == "portfolio") {
		act('btn_port')
		document.images['btn_ourteam_spacer'].src = eval('btn_about_spacerb' + ".src");
		document.images['btn_port_spacer'].src = eval('btn_about_spacera' + ".src");
	}
	if (groupID == "entrepreneurs") {
		act('btn_entrepreneurs')
		document.images['btn_port_spacer'].src = eval('btn_about_spacerb' + ".src");
		document.images['btn_entrepreneurs_spacer'].src = eval('btn_about_spacera' + ".src");
	}
	if (groupID == "news") {
		act('btn_news')
		document.images['btn_entrepreneurs_spacer'].src = eval('btn_about_spacerb' + ".src");
		document.images['btn_news_spacer'].src = eval('btn_about_spacera' + ".src");
	}
	if (groupID == "success") {
		act('btn_success')
		document.images['btn_news_spacer'].src = eval('btn_about_spacerb' + ".src");
	}
}

function menuOut(HTMLElementNameOrID) {
	//inact(HTMLElementNameOrID)
	cswmHide()
	menuState = "close"
	//swapButton(HTMLElementNameOrID)
}

function swapButton(id) {
alert('hide ' + id);
menuState = "close"
	if (id == "about_intersouth") {
		// over about
		document.images['about_before'].src = eval('darkbluepixel' + ".src");
		document.images['btn_about_spacer'].src = eval('btn_about_spacer' + ".src");
		inact('btn_about')
	} 
	if (id == "our_team") {
		inact('btn_ourteam')
		document.images['btn_ourteam_spacer'].src = eval('btn_ourteam_spacer' + ".src");
		document.images['btn_about_spacer'].src = eval('btn_about_spacer' + ".src");
	}
	if (id== "portfolio") {
		inact('btn_port')
		document.images['btn_ourteam_spacer'].src = eval('btn_about_spacer' + ".src");
		document.images['btn_port_spacer'].src = eval('btn_about_spacer' + ".src");
	}
	if (id == "entrepreneurs") {
		inact('btn_entrepreneurs')
		document.images['btn_port_spacer'].src = eval('btn_about_spacer' + ".src");
		document.images['btn_entrepreneurs_spacer'].src = eval('btn_about_spacer' + ".src");
	}
	if (id == "news") {
		inact('btn_news')
		document.images['btn_entrepreneurs_spacer'].src = eval('btn_about_spacer' + ".src");
		document.images['btn_news_spacer'].src = eval('btn_about_spacer' + ".src");
	}
	if (id == "success") {
		inact('btn_success')
		document.images['btn_news_spacer'].src = eval('btn_about_spacer' + ".src");
	}
}












function css() {
	// BROWSER CHECK

	browser = navigator.appName;
	appVer = parseInt(navigator.appVersion);

	ie = "Microsoft Internet Explorer";
	ns = "Netscape";
	if (navigator.appVersion.indexOf("Macintosh") != -1) {
		isMac = true;
	} else {
		isMac = false;
	}

	if (isMac)  {
		if (browser == ie) {
			//document.styleSheets[0].disabled = true
			document.writeln('<link rel="stylesheet" type="text/css" media="screen" href="' + url + 'mac_ie.css">')
		} else {
			//document.styleSheets[0].disabled = true
			document.writeln('<link rel="stylesheet" type="text/css" media="screen" href="' + url + 'mac_NN.css">')

		}
	} else {
		if (browser == ie) {
			//document.styleSheets[0].disabled = true
			document.writeln('<link rel="stylesheet" type="text/css" media="screen" href="' + url + 'win_ie.css">')

		} else {
			if (appVer >= 5) {
				document.writeln('<link rel="stylesheet" type="text/css" media="screen" href="' + url + 'win_ie.css">')
			} else {
				//document.styleSheets[0].disabled = true
				document.writeln('<link rel="stylesheet" type="text/css" media="screen" href="' + url + 'win_NN.css">')	
			}
		}
	}

}


function doPopup(url, width, height) {

	var remote = window.open(url, "newWin", "status=no,width=" + width + ",height=" + height + ",location=no,toolbar=no,directories=no")
	if (remote.opener == null) remote.opener = self; 
	remote.opener.name = "opener";
}





function doAdminPopup(url) {

	var localUrl = url
	if (localUrl == "") { localUrl = "Maintain_Jobs.htm" }
	var myWin = window.open("admin/help/default.asp?p="+localUrl, "newWin", "status=no,width=620,height=400,location=no,toolbar=no,directories=no")
}


/* THIS CODE KEEPS ERROR MESSAGES FROM POPPING UP */
function error() {
	return true
}
window.onerror = error

function clearForm() {
	document.forms[0].reset()
}

