/******************************************************************************
 *                         Suponix.com (anDeRan)                              *
 ******************************************************************************/

var is_ie = !!document.uniqueID;

var chCopyright = function () {
	var menu       = document.getElementById("leftMenu");
	var page       = document.getElementById("page");
	var bodyHeight = document.body.scrollHeight;
	var crStyle    = document.getElementById("copyright").style;

	var byTop = menu.offsetTop + menu.offsetHeight + 40;
	var byBot = (bodyHeight >= page.offsetHeight ? bodyHeight : page.offsetHeight) - 30 - 64;

	crStyle.top = (byTop > byBot ? byTop : byBot) + "px";
	crStyle.left = page.offsetLeft + 40 + "px";

	if (!crStyle.display || crStyle.display == "none") {
		crStyle.display = "block";
	}
};

var display = function (link) {
	width = link.firstChild.width + 18;
	height = link.firstChild.height + 18;
	var left       = screen.width / 2 - width / 2;
	var top        = screen.height / 2 - height / 2;
	window.open('display.html?' + link.firstChild.src, '_blank', 'status=no,dependent=yes,modal=yes,height=' + height + ',width=' + width + ',left=' + left + ',top=' + top);
	return false;
};

var popup = function (link, width, height) {
	var left       = screen.width / 2 - width / 2;
	var top        = screen.height / 2 - height / 2;
	window.open(link.href, '_blank', 'status=no,dependent=yes,modal=yes,scrollbars=1,height=' + height + ',width=' + width + ',left=' + left + ',top=' + top);
	return false;
};

window.onload = function () {
	try {
		if (is_ie) {
			var i, objects = document.getElementsByTagName("object");
			for (i = 0; i < objects.length; i++) {
				objects[i].removeAttribute('data');
				objects[i].setAttribute('classid', 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000');
				objects[i].outerHTML = objects[i].outerHTML;
			}
		}

		chCopyright();

		var preload = [
			"images/hdrmenu/enterprise_solutions_on.gif",
			"images/hdrmenu/mvno_solutions_on.gif",
			"images/hdrmenu/carrier_solutions_on.gif",
			"images/hdrmenu/product_portfolio_on.gif"
		];
		var i = preload.length;
		while (i-- > 0) {
			(new Image()).src = preload[i];
		}
	} catch (e) { }
};

window.onresize = function () {
	chCopyright();
};
