if (document.layers)
{
	window.location.href = "upgrade.html";
}

/*
* This function is used to create the object and embed code for flash
* via document.write, because of the problem with IE 6.0 and plugins
* as a result of the Eolas vs Microsoft lawsuit
* For more details on how this effects flash see the following link:
* http://www.macromedia.com/devnet/activecontent/articles/devletter.html
*/
function createFlashCode (fileName, width, height, bgColour, majorVersion, minorVersion, swfQuality) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' +
						'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + majorVersion + ",0" + minorVersion + ',0"' +
						'width="' + width + '"' +
						'height="' + height + '">' +
					'<param name="bgcolor" value="#' + bgColour + '">' +
					'<param name="movie" value="' + fileName + '">' +
					'<param name="quality" value="' + swfQuality + '">' +
					'<param name="menu" value="false">' +
					'<param name="wmode" value="transparent">' +
					'<embed src="' + fileName + '"' +
						'quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"' +
						'type="application/x-shockwave-flash"' +
						 'menu="false" wmode="transparent"' +
						'width="' + width + '"' +
						'height="' + height + '">' +
					'</embed> ' +
					'</object>');
	
}


/**
* change the innerHTML of an element
*
* @param	string		id of element to change
* @param	string		text to place inside element
*/
function changeInnerHTML(id, fill)
{
	document.getElementById(id).innerHTML = fill;
}


/**
* Toggle the display of the swfs on the portfolio pages
*
* @param	int		indicates which swf to display
*/
function pDisplay(num)
{
	document.getElementById("span1").style.display = "none";
	document.getElementById("span2").style.display = "none";
	if (num == 1)
	{
		document.getElementById("span1").style.display = "block";
	}
	else
	{
		document.getElementById("span2").style.display = "block";
	}
	//setSWFLinks(num);
}
function setSWFLinks(n)
{
	var links = '<table border="0" cellspacing="0" cellpadding="0" width="200">';
	if (n == 1)
	{
		links += '<tr>';
		links +='<td width="12"><img src="media/work/i_arrow_red.gif" width="7" height="7"></td>';
		links +='<td class="px10bold" width="90"><b class="red">Screenshots</b></td>';
	    links +='<td width="12"><img src="media/work/i_arrow_blue.gif" width="7" height="7"></td>';
		links +='<td class="px10" width="86"><a href="javascript:pDisplay(2);">Services</a></td>';
		links +='</tr>';
		links +='<tr>';
		links +='<td height="10" colspan="4"></td>';
        links +='</tr>';
	}
	else
	{
		links += '<tr>';
		links +='<td width="12"><img src="media/work/i_arrow_blue.gif" width="7" height="7"></td>';
		links +='<td class="px10" width="90"><a href="javascript:pDisplay(1);">Screenshots</a></td>';
		links +='<td width="12"><img src="media/work/i_arrow_red.gif" width="7" height="7"></td>';
		links +='<td class="px10bold" width="86"><b class="red">Services</b></td>';
		links +='</tr>';
		links +='<tr>';
		links +='<td height="10" colspan="4"></td>';
        links +='</tr>';
	}
	links += "</table>";
	changeInnerHTML("swfLinks", links);
}


/**
* scroll to the top of the page
*/
function pagetop() 
{
	if (navigator.appName.toLowerCase() == "netscape") scrollPos = window.pageYOffset;
	else scrollPos = document.body.scrollTop;
	
	if (parseInt(scrollPos) < 1) 
	{
		window.scroll(0,0);
		return;
	} 
	else 
	{
    	window.scrollBy(0,-90);
		setTimeout("pagetop()",1);
	}	
}

/**
* open privacy policy or terms
*
* @param	string	page to open
*/
function policy(page, extras)
{
	var props  = "";
	if (extras)
	{
		props = ",toolbar=1,location=1,menubar=1"; 
	}
	policies = open(page,"policies","width=550,height=500,resizable=1,status=1,scrollbars=1"+props); 
	policies.focus();
}


/**
* write text backwards
*/
function kcab(id)
{
	var rtn = "";
	var str = id.innerHTML;
	for (i=str.length-1; i>=0; i--)
	{
		rtn += str.charAt(i);	
	}
	id.innerHTML = rtn;
	id.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(rotation=90)';
}


function imgbox(id, on)
{
	id.className = on ? "boxOn" : "box";
}

