﻿var highColor = "#ffcccc";
// menu.js
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; 
      document.MM_sr=new Array; 
      for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){
        document.MM_sr[j++]=x; 
        if(!x.oSrc) 
            x.oSrc=x.src; 
        x.src=a[i+2];
       }
    }

// ufo.js
var UFO = {
	req: ["movie", "width", "height", "majorversion", "build"],
	opt: ["play", "loop", "menu", "quality", "scale", "salign", "wmode", "bgcolor", "base", "flashvars", "devicefont", "allowscriptaccess", "seamlesstabbing"],
	optAtt: ["id", "name", "align"],
	optExc: ["swliveconnect"],
	ximovie: "ufo.swf",
	xiwidth: "215",
	xiheight: "138",
	ua: navigator.userAgent.toLowerCase(),
	pluginType: "",
	fv: [0,0],
	foList: [],
		
	create: function(FO, id) {
		if (!UFO.uaHas("w3cdom") || UFO.uaHas("ieMac")) return;
		UFO.getFlashVersion();
		UFO.foList[id] = UFO.updateFO(FO);
		UFO.createCSS("#" + id, "visibility:hidden;");
		UFO.domLoad(id);
	},

	updateFO: function(FO) {
		if (typeof FO.xi != "undefined" && FO.xi == "true") {
			if (typeof FO.ximovie == "undefined") FO.ximovie = UFO.ximovie;
			if (typeof FO.xiwidth == "undefined") FO.xiwidth = UFO.xiwidth;
			if (typeof FO.xiheight == "undefined") FO.xiheight = UFO.xiheight;
		}
		FO.mainCalled = false;
		return FO;
	},

	domLoad: function(id) {
		var _t = setInterval(function() {
			if ((document.getElementsByTagName("body")[0] != null || document.body != null) && document.getElementById(id) != null) {
				UFO.main(id);
				clearInterval(_t);
			}
		}, 250);
		if (typeof document.addEventListener != "undefined") {
			document.addEventListener("DOMContentLoaded", function() { UFO.main(id); clearInterval(_t); } , null); // Gecko, Opera 9+
		}
	},

	main: function(id) {
		var _fo = UFO.foList[id];
		if (_fo.mainCalled) return;
		UFO.foList[id].mainCalled = true;
		document.getElementById(id).style.visibility = "hidden";
		if (UFO.hasRequired(id)) {
			if (UFO.hasFlashVersion(parseInt(_fo.majorversion, 10), parseInt(_fo.build, 10))) {
				if (typeof _fo.setcontainercss != "undefined" && _fo.setcontainercss == "true") UFO.setContainerCSS(id);
				UFO.writeSWF(id);
			}
			else if (_fo.xi == "true" && UFO.hasFlashVersion(6, 65)) {
				UFO.createDialog(id);
			}
		}
		document.getElementById(id).style.visibility = "visible";
	},
	
	createCSS: function(selector, declaration) {
		var _h = document.getElementsByTagName("head")[0]; 
		var _s = UFO.createElement("style");
		if (!UFO.uaHas("ieWin")) _s.appendChild(document.createTextNode(selector + " {" + declaration + "}")); // bugs in IE/Win
		_s.setAttribute("type", "text/css");
		_s.setAttribute("media", "screen"); 
		_h.appendChild(_s);
		if (UFO.uaHas("ieWin") && document.styleSheets && document.styleSheets.length > 0) {
			var _ls = document.styleSheets[document.styleSheets.length - 1];
			if (typeof _ls.addRule == "object") _ls.addRule(selector, declaration);
		}
	},
	
	setContainerCSS: function(id) {
		var _fo = UFO.foList[id];
		var _w = /%/.test(_fo.width) ? "" : "px";
		var _h = /%/.test(_fo.height) ? "" : "px";
		UFO.createCSS("#" + id, "width:" + _fo.width + _w +"; height:" + _fo.height + _h +";");
		if (_fo.width == "100%") {
			UFO.createCSS("body", "margin-left:0; margin-right:0; padding-left:0; padding-right:0;");
		}
		if (_fo.height == "100%") {
			UFO.createCSS("html", "height:100%; overflow:hidden;");
			UFO.createCSS("body", "margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;");
		}
	},

	createElement: function(el) {
		return (UFO.uaHas("xml") && typeof document.createElementNS != "undefined") ?  document.createElementNS("http://www.w3.org/1999/xhtml", el) : document.createElement(el);
	},

	createObjParam: function(el, aName, aValue) {
		var _p = UFO.createElement("param");
		_p.setAttribute("name", aName);	
		_p.setAttribute("value", aValue);
		el.appendChild(_p);
	},

	uaHas: function(ft) {
		var _u = UFO.ua;
		switch(ft) {
			case "w3cdom":
				return (typeof document.getElementById != "undefined" && typeof document.getElementsByTagName != "undefined" && (typeof document.createElement != "undefined" || typeof document.createElementNS != "undefined"));
			case "xml":
				var _m = document.getElementsByTagName("meta");
				var _l = _m.length;
				for (var i = 0; i < _l; i++) {
					if (/content-type/i.test(_m[i].getAttribute("http-equiv")) && /xml/i.test(_m[i].getAttribute("content"))) return true;
				}
				return false;
			case "ieMac":
				return /msie/.test(_u) && !/opera/.test(_u) && /mac/.test(_u);
			case "ieWin":
				return /msie/.test(_u) && !/opera/.test(_u) && /win/.test(_u);
			case "gecko":
				return /gecko/.test(_u) && !/applewebkit/.test(_u);
			case "opera":
				return /opera/.test(_u);
			case "safari":
				return /applewebkit/.test(_u);
			default:
				return false;
		}
	},
	
	getFlashVersion: function() {
		if (UFO.fv[0] != 0) return;  
		if (navigator.plugins && typeof navigator.plugins["Shockwave Flash"] == "object") {
			UFO.pluginType = "npapi";
			var _d = navigator.plugins["Shockwave Flash"].description;
			if (typeof _d != "undefined") {
				_d = _d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
				var _m = parseInt(_d.replace(/^(.*)\..*$/, "$1"), 10);
				var _r = /r/.test(_d) ? parseInt(_d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
				UFO.fv = [_m, _r];
			}
		}
		else if (window.ActiveXObject) {
			UFO.pluginType = "ax";
			try { // avoid fp 6 crashes
				var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
			}
			catch(e) {
				try { 
					var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
					UFO.fv = [6, 0];
					_a.AllowScriptAccess = "always"; // throws if fp < 6.47 
				}
				catch(e) {
					if (UFO.fv[0] == 6) return;
				}
				try {
					var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				}
				catch(e) {}
			}
			if (typeof _a == "object") {
				var _d = _a.GetVariable("$version"); // bugs in fp 6.21/6.23
				if (typeof _d != "undefined") {
					_d = _d.replace(/^\S+\s+(.*)$/, "$1").split(",");
					UFO.fv = [parseInt(_d[0], 10), parseInt(_d[2], 10)];
				}
			}
		}
	},

	hasRequired: function(id) {
		var _l = UFO.req.length;
		for (var i = 0; i < _l; i++) {
			if (typeof UFO.foList[id][UFO.req[i]] == "undefined") return false;
		}
		return true;
	},
	
	hasFlashVersion: function(major, release) {
		return (UFO.fv[0] > major || (UFO.fv[0] == major && UFO.fv[1] >= release)) ? true : false;
	},

	writeSWF: function(id) {
		var _fo = UFO.foList[id];
		var _e = document.getElementById(id);
		if (UFO.pluginType == "npapi") {
			if (UFO.uaHas("gecko") || UFO.uaHas("xml")) {
				while(_e.hasChildNodes()) {
					_e.removeChild(_e.firstChild);
				}
				var _obj = UFO.createElement("object");
				_obj.setAttribute("type", "application/x-shockwave-flash");
				_obj.setAttribute("data", _fo.movie);
				_obj.setAttribute("width", _fo.width);
				_obj.setAttribute("height", _fo.height);
				var _l = UFO.optAtt.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[UFO.optAtt[i]] != "undefined") _obj.setAttribute(UFO.optAtt[i], _fo[UFO.optAtt[i]]);
				}
				var _o = UFO.opt.concat(UFO.optExc);
				var _l = _o.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[_o[i]] != "undefined") UFO.createObjParam(_obj, _o[i], _fo[_o[i]]);
				}
				_e.appendChild(_obj);
			}
			else {
				var _emb = "";
				var _o = UFO.opt.concat(UFO.optAtt).concat(UFO.optExc);
				var _l = _o.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[_o[i]] != "undefined") _emb += ' ' + _o[i] + '="' + _fo[_o[i]] + '"';
				}
				_e.innerHTML = '<embed type="application/x-shockwave-flash" src="' + _fo.movie + '" width="' + _fo.width + '" height="' + _fo.height + '" pluginspage="http://www.macromedia.com/go/getflashplayer"' + _emb + '></embed>';
			}
		}
		else if (UFO.pluginType == "ax") {
			var _objAtt = "";
			var _l = UFO.optAtt.length;
			for (var i = 0; i < _l; i++) {
				if (typeof _fo[UFO.optAtt[i]] != "undefined") _objAtt += ' ' + UFO.optAtt[i] + '="' + _fo[UFO.optAtt[i]] + '"';
			}
			var _objPar = "";
			var _l = UFO.opt.length;
			for (var i = 0; i < _l; i++) {
				if (typeof _fo[UFO.opt[i]] != "undefined") _objPar += '<param name="' + UFO.opt[i] + '" value="' + _fo[UFO.opt[i]] + '" />';
			}
			var _p = window.location.protocol == "https:" ? "https:" : "http:";
			_e.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + _objAtt + ' width="' + _fo.width + '" height="' + _fo.height + '" codebase="' + _p + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + _fo.majorversion + ',0,' + _fo.build + ',0"><param name="movie" value="' + _fo.movie + '" />' + _objPar + '</object>';
		}
	},
		
	createDialog: function(id) {
		var _fo = UFO.foList[id];
		UFO.createCSS("html", "height:100%; overflow:hidden;");
		UFO.createCSS("body", "height:100%; overflow:hidden;");
		UFO.createCSS("#xi-con", "position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#fff; filter:alpha(opacity:75); opacity:0.75;");
		UFO.createCSS("#xi-dia", "position:absolute; left:50%; top:50%; margin-left: -" + Math.round(parseInt(_fo.xiwidth, 10) / 2) + "px; margin-top: -" + Math.round(parseInt(_fo.xiheight, 10) / 2) + "px; width:" + _fo.xiwidth + "px; height:" + _fo.xiheight + "px;");
		var _b = document.getElementsByTagName("body")[0];
		var _c = UFO.createElement("div");
		_c.setAttribute("id", "xi-con");
		var _d = UFO.createElement("div");
		_d.setAttribute("id", "xi-dia");
		_c.appendChild(_d);
		_b.appendChild(_c);
		var _mmu = window.location;
		if (UFO.uaHas("xml") && UFO.uaHas("safari")) {
			var _mmd = document.getElementsByTagName("title")[0].firstChild.nodeValue = document.getElementsByTagName("title")[0].firstChild.nodeValue.slice(0, 47) + " - Flash Player Installation";
		}
		else {
			var _mmd = document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		}
		var _mmp = UFO.pluginType == "ax" ? "ActiveX" : "PlugIn";
		var _uc = typeof _fo.xiurlcancel != "undefined" ? "&xiUrlCancel=" + _fo.xiurlcancel : "";
		var _uf = typeof _fo.xiurlfailed != "undefined" ? "&xiUrlFailed=" + _fo.xiurlfailed : "";
		UFO.foList["xi-dia"] = { movie:_fo.ximovie, width:_fo.xiwidth, height:_fo.xiheight, majorversion:"6", build:"65", flashvars:"MMredirectURL=" + _mmu + "&MMplayerType=" + _mmp + "&MMdoctitle=" + _mmd + _uc + _uf };
		UFO.writeSWF("xi-dia");
	},

	expressInstallCallback: function() {
		var _b = document.getElementsByTagName("body")[0];
		var _c = document.getElementById("xi-con");
		_b.removeChild(_c);
		UFO.createCSS("body", "height:auto; overflow:auto;");
		UFO.createCSS("html", "height:auto; overflow:auto;");
	},

	cleanupIELeaks: function() {
		var _o = document.getElementsByTagName("object");
		var _l = _o.length
		for (var i = 0; i < _l; i++) {
			_o[i].style.display = "none";
			for (var x in _o[i]) {
				if (typeof _o[i][x] == "function") {
					_o[i][x] = null;
				}}}	}};

    if (typeof window.attachEvent != "undefined" && UFO.uaHas("ieWin")) {
    	window.attachEvent("onunload", UFO.cleanupIELeaks);
    }

// tab.js
function nhChangeTabBox(strBoxId, intWhichTab) {
	var boxObj = document.getElementById(strBoxId);
	var nestedDivs = boxObj.getElementsByTagName('div');
	var nestedImgs = boxObj.getElementsByTagName('img');
	var containerObj = boxObj.parentNode;
	var containerDivs = containerObj.getElementsByTagName('div');
	var boolLS;
	
	for(i=0;i<containerDivs.length;i++) { // set containerDiv indexes
		if(containerDivs[i].id == "nhTabContentOne") { var contentIndex1 = i; }
		if(containerDivs[i].id == "nhTabContentTwo") { var contentIndex2 = i; }	
	}

	if(intWhichTab == 1) {
		boxObj.style.backgroundPosition = "0 -86px";
	}
	else {
		boxObj.style.backgroundPosition = "0 -59px";
	}

	// change the active class & display/hide content
	switch(intWhichTab) {
		case 0: //user clicked on tab 1
			nestedDivs[0].className = "active";
			nestedDivs[1].className = "";

			containerDivs[contentIndex2].style.display = "none";
			containerDivs[contentIndex1].style.display = "block";			
			break;
		
		case 1: //user clicked on tab 2
			nestedDivs[0].className = "";
			nestedDivs[1].className = "active";

			containerDivs[contentIndex2].style.display = "block";
			containerDivs[contentIndex1].style.display = "none";			
			break;
	}

	// swap the image label
	for (i=0;i<nestedImgs.length;i++) {
		if(nestedImgs[i].id) {
			if (i == intWhichTab) {
				nhImgSwap(nestedImgs[i].id,1);
			} else {
				nhImgSwap(nestedImgs[i].id);
			}
		}
	}
	
	// append the onmouseover, onmouseout
	for(i=0;i<nestedImgs.length;i++) {
		var parentObj = nestedImgs[i].parentNode;
		if(intWhichTab != i) {
			parentObj.onmouseover = function() { nhTabBoxDivMouseOver(this); }
			parentObj.onmouseout = function() { nhTabBoxDivMouseOut(this); }
		}
		else {
			parentObj.onmouseout = function() {}
			parentObj.onmouseover = function() {}
		}
	}	
}

function nhTabBoxDivMouseOver(whichDiv) {
	if(whichDiv.childNodes[0]) {
		if(whichDiv.childNodes[0].nodeName.toLowerCase() == 'img') {
			var strSrc = whichDiv.childNodes[0].src;
			if (strSrc.indexOf('_over.gif') == -1) {
				intChop = strSrc.length - 4;	
				strEnd = '_over.gif';
			}
			if (typeof(intChop) != "undefined") {
				newSrc = strSrc.substring( 0, intChop );
			}
			if (typeof(strEnd) != "undefined") {
				whichDiv.childNodes[0].src = newSrc + strEnd;
			}
		}
	}
}

function nhTabBoxDivMouseOut(whichDiv) {
	if(whichDiv.childNodes[0]) {
		if(whichDiv.childNodes[0].nodeName.toLowerCase() == 'img') {
			var strSrc = whichDiv.childNodes[0].src;
			if (strSrc.indexOf('_over.gif') > -1) {	
				intChop = strSrc.length - 9;	
				strEnd = '.gif';
			}
			if (typeof(intChop) != "undefined") {
				newSrc = strSrc.substring( 0, intChop );
			}
			if (typeof(strEnd) != "undefined") {
				whichDiv.childNodes[0].src = newSrc + strEnd;
			}
		}
	}
}


function nhImgSwap( strId, intSwap ) {
	// assumes 2 images: image.gif and image_over.gif
	var imgObj = document.getElementById( strId );
	var strTemp = imgObj.src;
	var intStrLength = strTemp.length;
	var intChop, strEnd; 
	
	if ( intSwap ) {
		if (strTemp.indexOf('_over.gif') == -1) {
			intChop = intStrLength - 4;	
			strEnd = '_over.gif';
		}
	} else {
		if (strTemp.indexOf('_over.gif') > -1) {	
			intChop = intStrLength - 9;	
			strEnd = '.gif';
		}
	}
	
	if (typeof(intChop) != "undefined") {
		strTemp = strTemp.substring( 0, intChop );
	}
	
	if (typeof(strEnd) != "undefined") {
		imgObj.src = strTemp + strEnd;
	}	
}

function gotoDetails(id) {
    window.location.href = "/NewsDetails.aspx?id=" + id;
}


    var nhAnimationValue = 10;
    var nhAnimationInterval = 40;

	function nhContainer()
	{
		this.nhCollapseNodeID = 0;		
		this.nhExpandNodeID = 0;
		this.nhModuleMaxRowHeight = 68;
		this.nhModuleMinRowHeight = 24;
		this.nhCollapsedRowHeight = 34;
		this.nhExpandedRowHeight = 58;
		this.tzImageObjbArr = new Array();		
		this.heightAdjustObjbArr = new Array();
		this.containerArr = new Array();
		this.idArr = new Array();
		this.idExpansionStatus = new Array();
		this.numIds = 0;
		this.dataUrl = '';
		this.refreshRate = 30000;
		this.objName = '';
		this.xmlHttpReq = false;
		this.iframeObj = false;
		this.domParserAX = false;
		this.parseHandler = new Function();
	}
	function nhContainer_setObjName(objName)
	{
		this.objName = objName;
	}
	nhContainer.prototype.setObjName = nhContainer_setObjName;
	
	function nhContainer_setParsingFunction(func)
	{
		this.parseHandler = func;
	}
	nhContainer.prototype.setParsingFunction = nhContainer_setParsingFunction;
	
	function nhContainer_refresh()
	{
		if (!this.xmlHttpReq && window.ActiveXObject)
		{
			try
			{
				this.xmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e)
			{
				try
				{
					this.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
				} catch(e) {
					// do nothing
				}
			}
			try
			{
				this.domParserAX = new ActiveXObject("Microsoft.XMLDOM");
				xmlDoc.async = false;
			}catch(e) {
			// do nothing
			}			
		} else if (!this.xmlHttpReq && window.XMLHttpRequest && (navigator.userAgent.indexOf('Mozilla/5.0')==-1) && (navigator.userAgent.indexOf('Opera')==-1))
		{
			this.xmlHttpReq = new XMLHttpRequest();
			if(this.xmlHttpReq.overrideMimeType) {
				this.xmlHttpReq.overrideMimeType("text/xml");
			}
		}
		if(this.xmlHttpReq)
		{
			this.xmlHttpReq.open("GET", this.dataUrl+"?cacheID="+(nhModuleCacheBuster%30),false);
			this.xmlHttpReq.send("");
			this.handleResponse();
		}
		else
		{
			this.iframeObj=document.getElementById(this.objName+'Frame');
			window.frames[this.objName+'Frame'].location.replace(this.dataUrl+"?cacheID="+(nhModuleCacheBuster%30));
		}
		window.setTimeout(this.objName+'.refresh()',this.refreshRate);
		nhModuleCacheBuster++;
	}
	nhContainer.prototype.refresh = nhContainer_refresh;
	
	function nhContainer_setDataUrl(url) {
		this.dataUrl = url;
	}
	nhContainer.prototype.setDataUrl = nhContainer_setDataUrl;

	function nhContainer_setRefreshRate(time) { // in seconds
		this.refreshRate = time*1000;		
	}
	nhContainer.prototype.setRefreshRate = nhContainer_setRefreshRate;
	
	function nhContainer_addContainer(id,height) {
		if (document.getElementById(id)) {
			document.getElementById(id).style.height = "24px";
		}
		this.idArr[this.idArr.length] = id;
		this.containerArr[this.containerArr.length] = document.getElementById(id);
		this.heightAdjustObjbArr[this.heightAdjustObjbArr.length] = document.getElementById(id);
		this.tzImageObjbArr[this.tzImageObjbArr.length] = document.getElementById(id +'Image');
		this.idExpansionStatus[this.idExpansionStatus.length] = false;
		this.numIds++;
		if (height) {
			this.nhModuleMaxRowHeight = height;
			this.nhExpandedRowHeight = this.nhModuleMaxRowHeight;				
		}
	}
	nhContainer.prototype.addContainer = nhContainer_addContainer;

	function nhContainer_zipNode(id) {
	    
		for(var i=0;i<this.numIds;i++)
		{
			if(id==this.idArr[i])
			{
				if(this.idExpansionStatus[i])
				{
					this.privateCollapseNode( i );
				}
				else
				{
					this.privateExpandNode( i );
				}
			}else
			{
				if(this.idExpansionStatus[i])
				{
					this.privateCollapseNode( i );
				}
			}
		}
	}
	nhContainer.prototype.zipNode = nhContainer_zipNode;
	
	var nhClassValue = '';

	function nhContainer_nhCollapseNode(which) {
		if (this.nhExpandedRowHeight > this.nhModuleMinRowHeight ) {
			document.getElementById(which.id).style.height = this.nhExpandedRowHeight + "px";
		} else {
			document.getElementById(which.id).style.height = this.nhModuleMinRowHeight + "px";
			window.clearInterval(this.nhCollapseNodeID);
			this.nhCollapseNodeID = 0;
			this.nhExpandedRowHeight = this.nhModuleMaxRowHeight;
			if(document.getElementById(which.id+'Image') && document.getElementById(which.id+'Image').lowsrc) {
				document.getElementById(which.id+'Image').src = 'http://i.cnn.net/cnn/images/1.gif';
			}
		}
		this.nhExpandedRowHeight = this.nhExpandedRowHeight-nhAnimationValue;
	}
	nhContainer.prototype.nhCollapseNode = nhContainer_nhCollapseNode;	
		
	function nhContainer_privateCollapseNode(item) {
	    
		if (this.nhCollapseNodeID == 0) {
			this.nhCollapseNodeID = window.setInterval(this.objName+".nhCollapseNode("+this.objName+".containerArr["+item+"])", nhAnimationInterval);
			this.idExpansionStatus[item]=false;
			nhClassValue = eval(this.objName+".containerArr[ "+item+" ].className.replace(new RegExp(\"nhExpanded\"), \"nhCollapsed\")");
			nhClassValue = nhClassValue.replace(new RegExp(" nhOver"), "");			
			window.setTimeout(this.objName+".containerArr[ "+item+" ].className='"+nhClassValue+"';",500);
		}
	}	
	nhContainer.prototype.privateCollapseNode = nhContainer_privateCollapseNode;			

	function nhContainer_nhExpandNode(which) {
		if (this.nhCollapsedRowHeight <= this.nhModuleMaxRowHeight) {
			which.style.height = this.nhCollapsedRowHeight + "px";
		} else {
			which.style.height = this.nhModuleMaxRowHeight + "px";
			window.clearInterval(this.nhExpandNodeID);
			this.nhExpandNodeID = 0;
			this.nhCollapsedRowHeight = this.nhModuleMinRowHeight;
		}
		this.nhCollapsedRowHeight = this.nhCollapsedRowHeight + nhAnimationValue;
	}
	nhContainer.prototype.nhExpandNode = nhContainer_nhExpandNode;

	function nhContainer_privateExpandNode(item) {
		var realId = this.idArr[item]+'Image';
		if(document.getElementById(realId))
		{
			if (document.getElementById(realId).lowsrc){
				document.getElementById(realId).src = document.getElementById(realId).lowsrc;
			}
		}
		if (this.nhExpandNodeID == 0) {
            this.nhExpandNodeID = window.setInterval(this.objName+".nhExpandNode("+this.objName+".heightAdjustObjbArr["+item+"])", nhAnimationInterval);
			this.idExpansionStatus[item] = true;
			this.containerArr[ item ].className =  this.containerArr[ item ].className.replace(new RegExp(" nhOver"), "");
			this.containerArr[ item ].className =  this.containerArr[ item ].className.replace(new RegExp("nhCollapsed"), "nhExpanded");
		}
	}	
	nhContainer.prototype.privateExpandNode = nhContainer_privateExpandNode;			

	function nhContainer_handleResponse(node) {
		if((this.xmlHttpReq && this.xmlHttpReq.readyState==4) || (this.iframeObj && this.iframeObj.readyState && this.iframeObj.readyState=='complete')|| (this.iframeObj))
		{
			var docObj= '';
			if(this.iframeObj)
			{
				if(this.iframeObj.contentDocument)
				{
					docObj = this.iframeObj.contentDocument;
				}
				else
				{
					docObj = document.frames(this.iframeObj.name).document;
				}
			}
			else
			{
				if(this.domParserAX )
				{
					this.domParserAX.async = false;
					this.domParserAX.loadXML(this.xmlHttpReq.responseText);
					docObj = this.domParserAX.documentElement;			
				}
				else
				{
					docObj = this.xmlHttpReq.responseXML.documentElement;
				}
			}
			var valueNLs = docObj.getElementsByTagName("value");
			var callObjs = new Array();
			for(var i=0;i<valueNLs.length;i++)
			{
				var callObj = new Object();
				var valueNode = valueNLs.item(i);
				callObj.key = valueNode.getAttribute('key');
				callObj.action = valueNode.getAttribute('type');
				callObj.data = valueNode.getAttribute('contents');
			callObjs[callObjs.length] = callObj;
			}
			this.parseHandler(callObjs,this);
		}
	}
	nhContainer.prototype.handleResponse = nhContainer_handleResponse;
	
    function initTopNews() {
	    var nhTopNewsContainers = document.getElementById("topNews").getElementsByTagName("div");
	    for (var i=0; i<nhTopNewsContainers.length; i++){
            var nhTopNewsContainer = nhTopNewsContainers[i];
		    if(nhTopNewsContainer.id.substr(0,7) == "topNews") {
			    nhTopNewsContainer.onmouseover = function () { changeBackground(this,1); return false;}
			    nhTopNewsContainer.onmouseout = function () {changeBackground(this,0); return false;}	
		    }
		    if(nhTopNewsContainer.id.substr(0,13) == "nhHeadlineBar") {
			    nhTopNewsContainer.id = nhTopNewsContainer.id.replace(new RegExp("nhHeadlineBar"), "");
			    nhTopNewsContainer.onclick = function () {topNewsCntr.zipNode("topNews"+this.id); return false;}
		    }	
        }
	}

    function initNewsDetails() {
        initNews("relatedNews");
        initNews("categoryNews");
    }  
    
    function initMainPage() {
        initNews("comments");
        initNews("topNews");
    }      
/*	    var nhTopNewsContainers = document.getElementById("relatedNews").getElementsByTagName("div");

	    for (var i=0; i<nhTopNewsContainers.length; i++){
            var nhTopNewsContainer = nhTopNewsContainers[i];
		    if(nhTopNewsContainer.id.substr(0,11) == "relatedNews") {
			    nhTopNewsContainer.onmouseover = function () { changeBackground(this,1); return false;}
			    nhTopNewsContainer.onmouseout = function () { changeBackground(this,0); return false;}	
		    }
		    if(nhTopNewsContainer.id.substr(0,13) == "nhHeadlineBar") {
			    nhTopNewsContainer.id = nhTopNewsContainer.id.replace(new RegExp("nhHeadlineBar"), "");
			    nhTopNewsContainer.onclick = function () {relatedNewsCntr.zipNode("relatedNews"+this.id); return false;}
		    }	
        }
	}
*/
    function initNews(strId) {
	    var nhTopNewsContainers = document.getElementById(strId).getElementsByTagName("div");
	    for (var i=0; i<nhTopNewsContainers.length; i++){
            var nhTopNewsContainer = nhTopNewsContainers[i];
		    if(nhTopNewsContainer.id.substr(0, strId.length) == strId) {
			    nhTopNewsContainer.onmouseover = function () { changeBackground(this,1); return false;}
			    nhTopNewsContainer.onmouseout = function () { changeBackground(this,0); return false;}	
		    }
		    if(nhTopNewsContainer.id.substr(0,13) == "nhHeadlineBar") {
			    nhTopNewsContainer.id = nhTopNewsContainer.id.replace(new RegExp("nhHeadlineBar"), "");
			    nhTopNewsContainer.onclick = function () { eval(strId+"Cntr").zipNode(strId+this.id); return false;}
		    }	
        }
	}
	function changeBackground(which, val) {
    	switch (val) {
	    	case 1:
		    	which.className += " nhOver";
			    break;
		    case 0:
			    which.className=which.className.replace(new RegExp(" nhOver\\b"), "");
			    break;
	    }
    }
function $(id) {
    return document.getElementById(id);
}

var statics = {
    newsImageURL : null,
    imageURL : null,
    appRoot : null
};

function openWin(strURL, arg1, arg2, arg3)
{
		var argLen = arguments.length;
		var intX,intY,strUrl;
		if(argLen < 3){
			intX = '780';
			intY = '550';
		}else{
			intX = arg2;
			intY = arg3;
		}

		oWin = window.open ( strURL, arg1, "toolbar=no, menubar=no, location=no, status=no, width=" + intX + ", height=" + intY + ",left=0, top=0, scrollbars=yes, resizable=yes");
		oWin.focus();
}


function validateNum(Num) {
	var CharSet = "0123456789"
	var temp = ""
	for (var i=0; i<Num.length; i++) {
			temp = "" + Num.substring(i, i+1)
			if (CharSet.indexOf(temp) == "-1") OK = "0"
	}
}

	

function getCookie(name) {
	var cname = name + "=";
	var dc = document.cookie;
	
	if (dc.length > 0) {
		begin = dc.indexOf(cname);
		if (begin != -1) {
			begin += cname.length;
			end = dc.indexOf(";", begin);
			if (end == -1) end = dc.length;
				return unescape(dc.substring(begin, end));
		}
	}
	return null;
}

function setCookie(name, value, expires, path, domain, secure) {
	document.cookie = name + "=" + escape(value) + 
	((expires == null) ? "" : "; expires=" + expires.toGMTString()) +
	((path == null) ? "" : "; path=" + path) +
	((domain == null) ? "" : "; domain=" + domain) +
	((secure == null) ? "" : "; secure");
}


function radioIsChecked(obj){
	for(var i=0;i<obj.length;i++)
	{
		if(obj[i].checked){
   			return true;
		}
	}
	return false;
}
function getRadioValue(obj){
	for(var i=0;i<obj.length;i++)
	{
		if(obj[i].checked){
   			return obj[i].value;
		}
	}
	return null;
}

function validateSearch(obj) {
    obj.value = trimAll(obj.value);
    if (obj.value == "")
        return false;
    obj.form.method = "POST";
    obj.form.action = "Search.aspx";
    return true;
}

function leftTrim(sString) 
{
    while (sString.substring(0,1) == ' ')
    {
        sString = sString.substring(1, sString.length);
    }
    return sString;
}

function rightTrim(sString) 
{
    while (sString.substring(sString.length-1, sString.length) == ' ')
    {
        sString = sString.substring(0,sString.length-1);
    }
    return sString;
}

function trimAll(sString) 
{
    while (sString.substring(0,1) == ' ')
    {
        sString = sString.substring(1, sString.length);
    }
    while (sString.substring(sString.length-1, sString.length) == ' ')
    {   
        sString = sString.substring(0,sString.length-1);
    }
    return sString;
}

function submitFormOnEnter(e, strobjToTie)
{
    objToTie = document.getElementById(strobjToTie) ;
    
    if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
        objToTie.click();
        return false;
        } 
    else 
        return true; 
    
}
var params ='imgRoot='+statics.imageURL;
var o = "";

function getNewsNavigationObj(id){
    o = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="621" height="250">';
          o += '<param name="movie" value="' + statics.appRoot + 'mansetler.swf">';
          o += '<param name="FlashVars" value="kategori=' + id + '">';
          o += '<param name="wmode" value="transparent">';
          o += '<param name="z-index" value="-100">';
		  o += '<param name="allowScriptAccess" value="always" />';
          o += '<embed src="' + statics.appRoot + 'mansetler.swf" FlashVars="kategori=' + id + '" wmode="transparent" allowscriptaccess="always" width="621" height="250"/>';
    o += '</object>';
    document.write(o);
}

function getNewsNavigationObj1(id){
    o = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="621" height="250">';
          o += '<param name="movie" value="' + statics.appRoot + 'mansetler2.swf">';
          o += '<param name="FlashVars" value="kategori=' + id + '">';
          o += '<param name="wmode" value="transparent">';
          o += '<param name="z-index" value="-100">';
		  o += '<param name="allowScriptAccess" value="always" />';
          o += '<embed src="' + statics.appRoot + 'mansetler2.swf" FlashVars="kategori=' + id + '" wmode="transparent" allowscriptaccess="always" width="621" height="250"/>';
    o += '</object>';
    document.write(o);
}

function getBreakingNews(){
    o = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="608" height="25">';
          o += '<param name="movie" value="' + statics.appRoot + 'breaking.swf">';
          o += '<param name="wmode" value="transparent">';
		  o += '<param name="allowScriptAccess" value="always" />';
            o += '<embed src="' + statics.appRoot + 'breaking.swf" allowscriptaccess="always" wmode="transparent" width="608" height="25"/>';
    o += '</object>';
    document.write(o);
} 

function getBanner()
{
    str = "<o" + "bject classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width=\"468\" height=\"60\" id=\"banner_haberekle\" align=\"middle\">";
    str = str + "<par" + "am name=\"allowScriptAccess\" value=\"sameDomain\" /><param name=\"movie\" value=\"banner_haberekle.swf?clickTag=http://www.nethaber.com/NewsDetails.aspx?id=2730\" />";
    str = str + "<para" + "m name=\"quality\" value=\"high\" /><param name=\"bgcolor\" value=\"#ffffff\" /><embed src=\"banner_haberekle.swf?clickTag=http://www.nethaber.com/NewsDetails.aspx?id=2730\" quality=\"high\" bgcolor=\"#ffffff\" width=\"468\" height=\"60\" name=\"banner_haberekle\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />";
    str = str + "<" + "/o" + "bject>";
    document.write(str);
}
function getBannerWap()
{
    o = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="468" height="60" id="wab" align="middle">';
    o += '<param name="allowScriptAccess" value="sameDomain" />'
    o += '<param name="movie" value="wab.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#003399" /><embed src="wab.swf" quality="high" bgcolor="#003399" width="468" height="60" name="wab" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />;'
    o += '</object>';
    document.write(o);
} 

         
function getNewsVideo(strFile) {
    o = '<object width=\"425\" height=\"350\">';
    o += '<param name=\"movie\" value=\"' + strFile + '\"></param>';
    o += '<embed src=\"' + strFile + '\" type=\"application/x-shockwave-flash\" width=\"600\" height=\"350\"></embed></object>';
    document.write(o);
}

function highlight(obj) {
    if (obj.style.backgroundColor == "") {
        obj.style.backgroundColor = highColor;
    } else {
        obj.style.backgroundColor = "";
    }
}