//WHAT KIND OF BROWSER ARE YOU RUNNING?
var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

if (browser == "Internet Explorer" && OS == "Mac")
{
	alert("Alert:  This site is not supported on Internet Explorer for MAC.  Please view it with Safari, Netscape, or Firefox.  Thank you.");
}
/*
if (browser == "Internet Explorer" && OS == "Windows")
{
	alert("Alert:  We are currently working to resolve a bug in IE.  Until this is resolved, please view the site in another browser if possible.");
}
*/

//REMOVE ABOVE IF CHECKER DOESN'T WORK.

function mailAddress(part1,part2) {
	window.location = 'mailto:' + part1 + '@' + part2;
}

/* Asterik Studio Global JS Sheet */

// CHECK CLIENT BROWSER & PLATFORM
// original code from http://developer.apple.com/internet/_javascript/
//
// USAGE:	browserNaming();
// NOTES:	call it from within an external JS document
// RESULT:	browserNew = true/false
//			browserName = IE/NS/Opera
//			browserNameLong = IE5/etc
//			Macintosh = true/false
// WORKS:	everything
	var its;
	var browserName;
	var browserNameLong;
	var browserNew;
	var preloadFlag = false;
	var Macintosh = navigator.userAgent.indexOf('Mac')>0;

	function its() {
		var n = navigator;
		var ua = ' ' + n.userAgent.toLowerCase();
		var pl = n.platform.toLowerCase();
		var an = n.appName.toLowerCase();

		// browser version
		this.version = n.appVersion;
		this.nn = ua.indexOf('mozilla') > 0;

		// 'compatible' versions of mozilla aren't navigator
		if(ua.indexOf('compatible') > 0) {
			this.nn = false;
		}
		
		this.opera = ua.indexOf('opera') > 0;
		this.ie = ua.indexOf('msie') > 0;
		this.major = parseInt( this.version );
		this.minor = parseFloat( this.version );

		// platform
		this.mac = ua.indexOf('mac') > 0;
		this.win = ua.indexOf('win') > 0;

		// workaround for IE5 which reports itself as version 4.0
		if(this.ie) {
			if(ua.indexOf("msie 5") > 1) {
			var msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
			this.major = parseFloat(navigator.appVersion.substr(msieIndex,3));
			}
		}

		return this;
	}

	function browserNaming() {
		its = new its();
		
		// is it a DOM-enabled browser?
		if (!document.getElementById) {
			browserNew = false;
		}
		else {
			browserNew = true;
		}

		// need the name, too
		if (its.opera) {
			browserName = "Opera";
			alert("its OPERA");
		}
		else if (its.ie) {
			browserName = "IE";
			alert("its IE");
		}
		else {
			browserName = "NS";
			alert("its NS");
		}

		// and the number
		browserNameLong = browserName + its.major;
	
	}


/* Image/Text Swap */

var w3c = (document.getElementById) ? 1:0;
var ns4 = (document.layers) ? 1:0;
var ie4 = (document.all) ? 1:0;

function imgSwap(img,state){

	if(state == "on"){

		document[img].src = "_images/rollover_on.gif";

		tempArray = img.split("_");

		linkName = "link_" + tempArray[1];

		var nsLayer = eval("document." + linkName);

		!ns4?document.getElementById(linkName).style.color = "#ff0066":nsLayer.document.color = "#ff0066";

	}else{

		document[img].src = "_images/rollover_off.gif";

		tempArray = img.split("_");

		linkName = "link_" + tempArray[1];
// on mouse out on text
		!ns4?document.getElementById(linkName).style.color = "#626262":void(0);

	}

}

/* jump menu work selector */

function workSelect()
	{
	var i = document.browse.client.selectedIndex;
	var v = document.browse.client.options[i].value;
	location = "/work/" + v;
	}

function nav_jump(targ,selObj,restore){ 
if(selObj.options[selObj.selectedIndex].value != "null"){
 	 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
 	 if (restore) selObj.selectedIndex=0;
  }else{
  selObj.selectedIndex=0;
  }
}
/* open new centered window */
/* USAGE: javascript:centerWin('filename.php','windowname', width, height); */

function centerWin(url,name,popW,popH) {
        version = navigator.appVersion;
	var w = 800, h = 600;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	}
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	window.open(url,name,'width=' + popW + ',height=' + popH + ',scrollbars=no,toolbar=no,status=no,resizable=no,top=' + topPos + ',left=' + leftPos);void(0);
}

/* open new centered window with scrolling ability */

function centerScroll(url,name,popW,popH) {
        version = navigator.appVersion;
	var w = 800, h = 600;

	if (document.all || document.layers) {
		w = screen.availWidth;
		h = screen.availHeight;
	}
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	window.open(url,name,'width=' + popW + ',height=' + popH + ',scrollbars=yes,toolbar=no,status=no,resizable=no,top=' + topPos + ',left=' + leftPos);void(0);
}

// POPUP WINDOW (FIXES THE IE4/MAC PROBLEM WHICH MAKES WINDOWS TOO SMALL)
// USAGE:	<a href="#" onclick="spawnWindow('newpage.php','windowname',400,384,'no');">

	function spawnWindow(desktopURL,windowName,width,height,scroll) {
 		if (Macintosh) {
 			if (browserNameLong == "IE4") {
				newheight = parseInt(height + 17);
			}
			else if (browserNameLong == "IE4.5") {
				newheight = parseInt(height + 17);
			}
			else {
				newheight = height;
			}
 		}
 		else { newheight = height; }	
 		window.open(desktopURL, windowName, "toolbar=no,location=no,status=no,menubar=no,scrollbars="+scroll+",width="+width+",height="+newheight+",resizable=no" );
	}
	
	

/* open video window */
/* USAGE: <a href="#" onClick="popVideo('URL',height,width,'title','headline','description');return false">text</a> */

function popVideo(videosrc,winwidth,winheight,title,headline,text){
var look='width='+winwidth+',height='+winheight+','
popwin=window.open("","",look)
popwin.document.write("<html><head>");
popwin.document.write("<title>"+title+"</title>");
popwin.document.write("<link href='http://www.asterikstudio.com/_scripts/site_global.css' rel='stylesheet' type='text/css'>");
popwin.document.write("</head><body>");
popwin.document.write("<table width='360' border='0' cellspacing='0' cellpadding='0'> ");
popwin.document.write("<tr align='left' valign='top'>");
popwin.document.write("<tr align='left' valign='top'>");
popwin.document.write("<td colspan='3'><img src='http://www.asterikstudio.com/_images/shim.gif' width='360' height='20' alt=''></td>");
popwin.document.write("</tr>");
popwin.document.write("<tr>");
popwin.document.write("<td width='20' height='315' align='left' valign='top'><img src='http://www.asterikstudio.com/_images/shim.gif' width='20' height='315' alt=''></td>");
popwin.document.write("<td width='320' align='left' valign='top'><table width='320' border='0' cellspacing='0' cellpadding='0'>");
popwin.document.write("<tr>");
popwin.document.write("<td width='320' height='255' align='left' valign='top' bgcolor='#FFFFFF'><object width=320 height=255 CLASSID='clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B' CODEBASE='http://www.apple.com/qtactivex/qtplugin.cab'>");
popwin.document.write("<param name='src' value="+videosrc+">");
popwin.document.write("<param name='controller' value='true'>");
popwin.document.write("<param name='autoplay' value='true'>");
popwin.document.write("<param name='kioskmode' value='true'>");
popwin.document.write("<embed src="+videosrc+" width=320 height=255 autoplay=true KIOSKMODE=true controller=true></embed>");
popwin.document.write("'bgcolor='FFFFFF' border=0 pluginspage='http://www.apple.com/quicktime/download/indext.php'>");
popwin.document.write("</object></td>");
popwin.document.write("</tr>");
popwin.document.write("<tr>");
popwin.document.write("<td width='320' height='5'><img src='http://www.asterikstudio.com/_images/shim.gif' width='320' height='5' alt=''></td>");
popwin.document.write("</tr>");
popwin.document.write("<tr>");
popwin.document.write("<td width='320' height='50' align='left' valign='top'><table width='320' border='0' cellspacing='0' cellpadding='0'>");
popwin.document.write("<tr>");
popwin.document.write("<td align='left' valign='top'><span class='heading'>"+headline+"</span><br>");
popwin.document.write(""+text+"</td>");
popwin.document.write("<td width='50' height='50' align='left' valign='top'><img src='http://www.asterikstudio.com/_images/asterik_logo.gif' width='50' height='50' alt=''></td>");
popwin.document.write("</tr>");
popwin.document.write("</table></td>");
popwin.document.write("</tr>");
popwin.document.write("</table></td>");
popwin.document.write("<td width='20' height='315' align='left' valign='top'><img src='http://www.asterikstudio.com/_images/shim.gif' width='20' height='315' alt=''></td>");
popwin.document.write("</tr>");
popwin.document.write("</table>");
popwin.document.write("</body>");
popwin.document.write("</html>");
popwin.document.close()
}
//-->
<!--

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

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

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		legal_notice_over = newImage("/images/legal_notice-over.gif");
		contact_over = newImage("/images/contact-over.gif");
		preloadFlag = true;
	}
}

// -->