/* Frame Buster! */
if(top.location != self.location) {
	top.location=self.location;
}
/* Domain Switcher */
var homeLoc = top.location;
var homeStr = homeLoc.toString();
var target = '';
if (homeStr.substring(0,22) != "http://www.tellabs.com" || homeStr.substring(22,23) == ".") {
	var fi = new RegExp("http://www.tellabs.fi/","i")
	if (homeStr.search(fi) != -1) {
		target = homeStr.replace(fi,"http://www.tellabs.com/fi/");
		top.location.replace(target);
	}
	var it = new RegExp("http://www.tellabs.it/","i")
	if (homeStr.search(it) != -1) {
		target = homeStr.replace(it,"http://www.tellabs.com/it/");
		top.location.replace(target);
	}
	var otherDoms = new Array("http://tellabs.com/",
							"http://www.tellabssucks.com/",
							"http://www.tellabsorders.com/",
							"http://www.tellabsoperations.com/",
							"http://www.tellabsoperations.net/",
							"http://www.tellabsinc.com/",
							"http://www.tellabsinc.net/",
							"http://www.tellabsbites.com/",
							"http://www.tellabs.eu.com/",
							"http://www.tellabs.dk/",
							"http://www.tellabs.cz/",
							"http://www.tellabs.com.pl/",
							"http://www.tellabs.co.at/",
							"http://www.tellabs.be/",
							"http://www.tellabs.at/",
							"http://www.telecommunicationslaboratories.com/",
							"http://www.tallgrassventures.com/",
							"http://www.portal.tellabs.com/",
							"http://www.ivp.tellabs.com/",
							"http://www.dicknotebaert.com/",
							"http://www.cathiekozik.com/");

	for (var domNum=0; domNum < otherDoms.length; domNum++) {
		var domLen = otherDoms[domNum].length;
		var domReg = new RegExp(otherDoms[domNum],'i');
		var domSearch = homeStr.search(domReg);
		if (domSearch != -1) {
			var target = homeStr.replace(domReg,'http://www.tellabs.com/');
			top.location.replace(target);
		}
	}
}

/* Usage:
** 
** <script language="JavaScript" type="text/javascript">
** // <![CDATA[
** 	flashBanner("filename","id",width,height,"quality","bgcolor","wmode",version);
** // ]]>
** </script>
** 
*/
function flashBanner(mov,id,w,h,qual,bg,wmode,ver) {
	var agent = navigator.userAgent.toLowerCase();
	if (ver && isNaN(ver) == false) {
		var MM_contentVersion = ver;
		var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
		if ( plugin ) {
				var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			    for (var i = 0; i < words.length; ++i)
			    {
				if (isNaN(parseInt(words[i])))
				continue;
				var MM_PluginVersion = words[i]; 
			    }
			var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
		}
		else if (agent.indexOf("msie") != -1 && navigator.appVersion.indexOf("Win") != -1) {
			document.write('<scr' + 'ipt language=VBScript\> \n');
			document.write('set MM_Installed = ( CreateObject("ShockwaveFlash.ShockwaveFlash"))\n');
			document.write('MM_FullVersion = MM_Installed.GetVariable("$version")\n');
			document.write('MM_FullVersion = Replace(MM_FullVersion,"WIN ","")\n');
			document.write('MM_VersionNum = Replace(MM_FullVersion,",",".")\n');
			document.write('</scr' + 'ipt\> \n');
			var MM_PluginVersion = MM_VersionNum.substr(0,3);
			var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
		}
		else {
			MM_FlashCanPlay = false;
		}
	} else {
		MM_FlashCanPlay = true;
	}
	if (MM_FlashCanPlay == true) {
		if (agent.indexOf("msie") != -1) {
			var moVie = '<object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="' + id + '" width="' + w + '" height="' + h + '">';
		} else if (agent.indexOf("opera") != -1) {
			var moVie = '<object classid="CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" id="' + id + '" width="' + w + '" height="' + h + '">';
				moVie += '<embed src="' + mov + '" id="' + id + '" width="' + w + '" height="' + h +'" type="application/x-shockwave-flash"';
				if (qual) moVie += ' quality="' + qual + '"';
				if (bg) moVie += ' bgcolor="' + bg + '"';
				if (wmode) moVie += ' wmode="' + wmode + '"';
				moVie += ' pluginspage="http://www.adobe.com/go/getflashplayer" />';
		} else {
			var moVie = '<object type="application/x-shockwave-flash" data="' + mov + '" id="' + id + '" width="' + w + '" height="' + h + '">';
				moVie += '<param name="pluginspage" value="http://www.adobe.com/go/getflashplayer" />';
		}
		moVie += '<param name="movie" value="' + mov + '" />';
		if (qual) {moVie += '<param name="quality" value="' + qual + '" />';}
		if (bg) {moVie += '<param name="bgcolor" value="' + bg + '" />';}
		if (wmode) {moVie += '<param name="wmode" value="' + wmode + '" />';}
		moVie += '</object>';
	} else {
		var moVie = '<div id="' + id + '" style="width:' + w + 'px; height:' + h + 'px; text-align: center;">';
			moVie += '<p style="padding:15px;">This site makes use of <a href="http://www.adobe.com/go/getflashplayer" target="_blank">Adobe&reg; Flash&reg;</a> software.<br /><br />';
			moVie += 'Why not <a href="http://www.adobe.com/go/getflashplayer" target="_blank">download</a> and install the latest version now? It will only take a moment.<br /><br /></p>';
			moVie += '</div>';
	}
	document.write(moVie);
}

/* Return the px distance from left border of the element to left border of the window */
function getElementLeft(p_elm) {
	var x = 0;
	var elm;
	if(typeof(p_elm) == "object"){
		elm = p_elm;
	} else {
		elm = document.getElementById(p_elm);
	}
	while (elm != null) {
		x+= elm.offsetLeft;
		elm = elm.offsetParent;
	}
	return parseInt(x);
}

/* Return the px width of the element */
function getElementWidth(p_elm){
	var elm;
	if(typeof(p_elm) == "object"){
		elm = p_elm;
	} else {
		elm = document.getElementById(p_elm);
	}
	return parseInt(elm.offsetWidth);
}

/* Return the px distances from right border of the element to left border of window */
function getElementRight(p_elm){
	return getElementLeft(p_elm) + getElementWidth(p_elm);
}

/* Return the px distances from top border of the element to top border of the window */
function getElementTop(p_elm) {
	var y = 0;
	var elm;
	if(typeof(p_elm) == "object"){
		elm = p_elm;
	} else {
		elm = document.getElementById(p_elm);
	}
	while (elm != null) {
		y+= elm.offsetTop;
		elm = elm.offsetParent;
	}
	return parseInt(y);
}

/* Return the px heght of the element */
function getElementHeight(p_elm){
	var elm;
	if(typeof(p_elm) == "object"){
		elm = p_elm;
	} else {
		elm = document.getElementById(p_elm);
	}
	return parseInt(elm.offsetHeight);
}

/* Return the px distances from bottom border of the element to border top of the window */
function getElementBottom(p_elm){
	return getElementTop(p_elm) + getElementHeight(p_elm);
}

/* Return a style property of the elemnt , it return null if does not exist */
function getElementProperty(p_elm, p_property){
	var elm = null;
	if(typeof(p_elm) == "object"){
		elm = p_elm;
	} else {
		elm = document.getElementById(p_elm);
	}
	if(elm != null){
		if(elm.style){
			elm = elm.style;
			if(elm[p_property]){
				return elm[p_property];
			} else {
				return null;
			}
		} else {
			return null;
		}
	}
}

/* Set a property of style type of the element */
function setElementProperty(p_elm, p_property, p_value){
	var elm = null;
	if(typeof(p_elm) == "object"){
		elm = p_elm;
	} else {
		elm = document.getElementById(p_elm);
	}
	if((elm != null) && (elm.style != null)){
		elm = elm.style;
		elm[ p_property ] = p_value;
	}
}
