function focus() { var obj1=document.getElementById('td1'); if (obj1 != null) obj1.className="v_font_noibat9pxFocus"; } function getTab(id) { switch(id) { case 1: document.getElementById("divHeader").innerHTML = "
NỔI BẬT
XEM NHIỀU NHẤT I  MỚI NHẤT
" break; case 2: document.getElementById("divHeader").innerHTML = "
XEM NHIỀU NHẤT
MỚI NHẤT I  NỔI BẬT
" break; case 3: document.getElementById("divHeader").innerHTML = "
MỚI NHẤT
NỔI BẬT I  XEM NHIỀU NHẤT
" break; } } function loadList(id) { var url = '/Ajax/BoxTinNoiBat.aspx?ID=' + id ; AjaxRequestURL('divList',url); } /***** TII Global Browser Sniffing Variables *****/ var tii_isopera = typeof window.opera != 'undefined'; var tii_isie = typeof document.all != 'undefined' && !tii_isopera && navigator.vendor != 'KDE'; var tii_issafari = navigator.vendor == 'Apple Computer, Inc.'; /***** TII Global Browser Sniffing Variables *****/ /***** TII Global Functions *****/ /* Gets the total offset position of the element, assuming none of its ancestors have a float of left or right. Direction is 'x' for horizontal, and 'y' for vertical */ function tii_getTotalOffsetPosition (element, direction) { var pos = direction == 'x' ? element.offsetLeft : element.offsetTop; var tmp = element.offsetParent; while (tmp != null) { pos += direction == 'x' ? tmp.offsetLeft : tmp.offsetTop; tmp = tmp.offsetParent; } return pos; } /* Stops the default action for the event, such as jumping to an anchor when clicking on a hyperlink */ function tii_stopDefaultAction (event) { event.returnValue = false; if (typeof event.preventDefault != 'undefined') { event.preventDefault (); } } /* Create a new element node with attributes */ /*function tii_dom_createElement (nodeName, attributes) { var isopera = typeof window.opera != 'undefined'; var isie = typeof document.all != 'undefined' && !isopera && navigator.vendor != 'KDE'; var newElement; try { newElement = document.createElement (nodeName); } catch (error) { return null; } var attributesLength = attributes.length; for (var i = 0; i < attributesLength; i++) { var attribute = attributes [i] [0]; var value = attributes [i] [1]; newElement.setAttribute (attribute, value); switch (attribute) { case 'id': newElement.id = value; break; case 'class': if (isie) { newElement.setAttribute ('className', value); } newElement.className = value; break; case 'style': newElement.style.cssText = newElement.style.cssText + ' ' + value; break; case 'for': if (isie) { newElement.setAttribute ('htmlFor', value); } newElement.htmlFor = value; } } return newElement; }*/ /* Removes all the unwanted whitespace text nodes from inside the tree (including tabs, spaces, and line breaks between list items) */ function tii_dom_removeWhitespaceTextNodes (node) { for (var x = 0; x < node.childNodes.length; x++) { var child = node.childNodes [x]; if (child.nodeType == 3 && !/\S/.test (child.nodeValue)) { node.removeChild (node.childNodes [x]); x--; } if (child.nodeType == 1) { tii_dom_removeWhitespaceTextNodes (child); } } } /***** ^^^ TII Global Functions Placed in >TII>Shared>JavaScript>TII LIB - JavaScript Event Listeners ^^^ *****/ // Util /* Adds a function for the window load event */ function tii_callFunctionOnWindowLoad (functionToCall) { if (typeof window.addEventListener != 'undefined') { window.addEventListener ('load', functionToCall, false); } else if (typeof document.addEventListener != 'undefined') { document.addEventListener ('load', functionToCall, false); } else if (typeof window.attachEvent != 'undefined') { window.attachEvent ('onload', functionToCall); } else { var oldFunctionToCall = window.onload; if (typeof window.onload != 'function') { window.onload = functionToCall; } else { window.onload = function () { oldFunctionToCall (); functionToCall (); }; } } } /* Calls functionToCall as soon as the targetElement is loaded, even if the document hasn't completely loaded yet. Place the parameter list for functionToCall in order after tii_callFunctionOnElementLoad (targetId, functionToCall), e.g., tii_callFunctionOnElementLoad (targetId, functionToCall, parameter1, parameter 2, parameter 3, ...) */ function tii_callFunctionOnElementLoad (targetId, functionToCall) { var myArguments = arguments; tii_callFunctionOnWindowLoad (function () { window.loaded = true; }); var targetElement = document.getElementById (targetId); if (targetElement == null && !window.loaded) { var pollingInterval = setInterval (function () { if (window.loaded) { clearInterval (pollingInterval); } targetElement = document.getElementById (targetId); if (targetElement != null) { clearInterval (pollingInterval); var argumentsTemp = new Array (); var argumentsTempLength = myArguments.length - 2; for (var i = 0; i < argumentsTempLength; i++) { argumentsTemp [i] = myArguments [i + 2]; } functionToCall.apply (this, argumentsTemp); } }, 10); } } /* Attaches an event handling function to the targetElement as soon as the targetElement is loaded (even if the document hasn't completely loaded yet). */ function tii_addEventHandlerOnElementLoad (targetId, eventType, functionToCall, bubbleEventUpDOMTree) { tii_callFunctionOnWindowLoad (function () { window.loaded = true; }); var targetElement = document.getElementById (targetId); if (targetElement == null && !window.loaded) { var pollingInterval = setInterval (function () { if (window.loaded) { clearInterval (pollingInterval); } targetElement = document.getElementById (targetId); if (targetElement != null) { clearInterval (pollingInterval); tii_addEventHandler (targetElement, eventType, functionToCall, bubbleEventUpDOMTree); } }, 10); } } /* Attaches an event handling function to the targetElement. Examples of eventType values are 'mouseover' and 'keyup', as opposed to 'onmouseover' and 'onkeyup'. bubbleEventUpDOMTree is a boolean variable specifying whether the event should activate the event listeners of all the ancestors of the element (up to the window object) */ function tii_addEventHandler (targetElement, eventType, functionToCall, bubbleEventUpDOMTree) { if (!targetElement) { window.status = 'Warning: Tried to attach event to null object'; return false; } if (typeof targetElement.addEventListener != 'undefined') { targetElement.addEventListener (eventType, functionToCall, bubbleEventUpDOMTree); } else if (typeof targetElement.attachEvent != 'undefined') { targetElement.attachEvent ('on' + eventType, functionToCall); } else { eventType = 'on' + eventType; if (typeof targetElement [eventType] == 'function') { var oldListener = targetElement [eventType]; targetElement [eventType] = function () { oldListener (); return functionToCall (); } } else { targetElement [eventType] = functionToCall; } } return true; } /* Removes an event handling function from the targetElement. Examples of eventType values are 'mouseover' and 'keyup', as opposed to 'onmouseover' and 'onkeyup'. bubbleEventUpDOMTree is a boolean variable specifying whether the event should activate the event listeners of all the ancestors of the element (up to the window object) ***NOTE: This function does not support removing anonymous functions; a reference to the added function is needed */ /*function tii_removeEventHandler (targetElement, eventType, functionToRemove, bubbleEventUpDOMTree) { if (typeof targetElement.removeEventListener != "undefined") { targetElement.removeEventListener (eventType, functionToRemove, bubbleEventUpDOMTree); } else if (typeof targetElement.detachEvent != "undefined") { targetElement.detachEvent ("on" + eventType, functionToRemove); } else { targetElement ["on" + eventType] = null; } return true; }*/ // Util // Copyright 2007 Time.com /*tii_addEventHandlerOnElementLoad ('query', 'click', function (event){ var qBox = typeof event.target != 'undefined' ? event.target : window.event.srcElement; qBox.style.color = '#000'; }, false); var keyevent = tii_issafari || tii_isie ? 'keydown' : 'keypress'; tii_addEventHandlerOnElementLoad ('query', keyevent, function (event){ var qBox = typeof event.target != 'undefined' ? event.target : window.event.srcElement; qBox.style.color = '#000'; }, false);*/ /*Initializes the primary navigation menu 125 milliseconds after the 'topnav' div is loaded */ /*tii_callFunctionOnElementLoad ('nav', function () { var delay = setTimeout (ew_initializeNav, 5); });*/ // Start the setMover on window load tii_callFunctionOnWindowLoad (function () { setMover (); }); // Most Popular Event handlers /*tii_addEventHandlerOnElementLoad ('tabChange1', 'click', function (event){tabChange(1);}, false); tii_addEventHandlerOnElementLoad ('tabChange2', 'click', function (event){tabChange(2);}, false); tii_addEventHandlerOnElementLoad ('tabChange3', 'click', function (event){tabChange(3);}, false); tii_addEventHandlerOnElementLoad ('tabChange4', 'click', function (event){tabChange(4);}, false); tii_addEventHandlerOnElementLoad ('tabChange5', 'click', function (event){tabChange(5);}, false); var keyevent = tii_issafari || tii_isie ? 'keydown' : 'keypress'; tii_addEventHandlerOnElementLoad ('tabChange1', keyevent , function (event){tabChange(1);}, false); tii_addEventHandlerOnElementLoad ('tabChange2', keyevent , function (event){tabChange(2);}, false); tii_addEventHandlerOnElementLoad ('tabChange3', keyevent , function (event){tabChange(3);}, false); tii_addEventHandlerOnElementLoad ('tabChange4', keyevent , function (event){tabChange(4);}, false); tii_addEventHandlerOnElementLoad ('tabChange5', keyevent , function (event){tabChange(5);}, false);*/ // Date /*var arrayDayNames = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); var arrayMonthNames = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); function getDateCurrent () { var today = new Date() var day = (today.getDay()); var monthName_List = new Date() monthNumber = (today.getMonth()); dayNumber=today.getDate(); if(dayNumber < 10){ dayNumber="0" + dayNumber; } var yearNumber = today.getYear(); if(yearNumber < 1000) { yearNumber+=1900; } if (document.getElementById('print')) { document.write(arrayMonthNames[monthNumber] + " " + dayNumber + ", " + yearNumber); } else { document.write(arrayDayNames[day] + ", " + arrayMonthNames[monthNumber] + " " + dayNumber + ", " + yearNumber); } } */ // Clear field: Clears input text on focus and resets to default text if no text is entered /*function clearField(status) { var srch = document.getElementById('query'); if ((srch.value == srch.defaultValue) && (status == 'on')) { srch.value = ''; } if ((srch.value == '') && (status == 'off')) { srch.value = srch.defaultValue; } } */ /* Top Nav Drop-down */ /*function ew_initializeNav () { tii_pnav_initializeDropdownMenu.apply (this, new Array ('nav', ew_pnav_hideOrShowMenuFunction, ew_pnav_changeStateFunction)); } /* Hide/show Menu function ew_pnav_hideOrShowMenuFunction (menu, hideElseShow, menuParent) { menu.style.left = (hideElseShow ? '-999' : (menuParent.offsetLeft)) + 'px'; } */ /* Change/Clear Status */ /*function ew_pnav_changeStateFunction (element, isADropdownItem, state) { if (isADropdownItem) { switch (state) { case 0: element.className = ''; break; case 1: element.className = 'active'; break; } } else { var anchor = element.getElementsByTagName ('a').item (0); var li = anchor.parentNode; switch (state) { case 0: li.className = li.className.replace(/primactive/gi, ''); break; case 1: li.className += (li.className == '' ? '' : ' ') + 'primactive'; break; } } } */ // Go To Specials: Links the elements of the select tag to their specific URLs /* function gotoSpecials() { document.location.href = document.frmSpecials.selSpecials.options[document.frmSpecials.selSpecials.selectedIndex].value; }*/ // Belt var moveTouts; // Sets the belt mover function setMover () { var toutsPerShow = 5; var moveDelay = 1; var widthTraversed = 0; var toutTracker = 0; var toutCount = 0; var directionChangeMultiplier; if (tii_isie) { directionChangeMultiplier = 20; } else { directionChangeMultiplier = 40; } var dotNumber = 2; var mover = document.getElementById ('mover'); if (!mover) { return false; } mover.style.left = '0px'; // The next line assumes that all the child nodes of mover are touts tii_dom_removeWhitespaceTextNodes (mover); var beltTouts = mover.childNodes; var beltToutsLength = beltTouts.length; var beltToutWidth; if (beltToutsLength > 0) { beltToutWidth = beltTouts.item (0).offsetWidth; } else { return false; } var visibleWidth = toutsPerShow * beltToutWidth; // Cai can quan tam day roi function moveBelt (event, directionChange) { //alert(directionChange); if ((event.type == keyevent && event.keyCode != 13) || widthTraversed > 0) { return false; } //di chuyen o day ne function recirculateTouts () { if (directionChange > 0) { if (Math.ceil (toutTracker / beltToutWidth) > 0 ) { toutTracker = toutTracker - beltToutWidth; var clonedTout = beltTouts.item (beltToutsLength - 1).cloneNode (true); mover.insertBefore (clonedTout, mover.firstChild); mover.removeChild(beltTouts.item (beltToutsLength)); toutCount++; } } if (directionChange < 0) { if (Math.floor (toutTracker / beltToutWidth) > 0) { toutTracker = toutTracker - beltToutWidth; var clonedTout = mover.childNodes[0].cloneNode (true); mover.appendChild (clonedTout); mover.removeChild (mover.childNodes[0]); mover.style.left = '0 px'; toutCount++; } } } //di chuyen o day ne moveTouts = setInterval (function () { widthTraversed = widthTraversed + directionChangeMultiplier; toutTracker = toutTracker + directionChangeMultiplier; recirculateTouts (); if (toutCount >= toutsPerShow) { // Stop animation clearInterval (moveTouts); // Set active button if (dotNumber == 1) { dotNumber = 2; } else { dotNumber = 1; } // var dot = document.getElementById ('dots') // if (!tii_isie){ // dot.style.background= 'url(http://img.timeinc.net/time/i/dots' + dotNumber + '.gif) 0px 0px no-repeat'; // }else{ // dot.style.backgroundPositionY = (dotNumber*13 -26) + ' px'; // } // Reinitialize variables mover.style.left = '0px'; beltTouts = mover.childNodes; widthTraversed = 0; toutCount = 0; } }, moveDelay); tii_stopDefaultAction (event); } // Cai can quan tam day roi var leftArrow = document.getElementById ('leftArrow'); var rightArrow = document.getElementById ('rightArrow'); if (!leftArrow || !rightArrow) { return false; } leftArrow.href = 'javascript:{}'; rightArrow.href = 'javascript:{}'; var keyevent = tii_issafari || tii_isie ? 'keydown' : 'keypress'; tii_addEventHandler (leftArrow, 'click', function (event) { moveBelt (event, 1)}, false); tii_addEventHandler (leftArrow, keyevent, function (event) { moveBelt (event, 1)}, false); tii_addEventHandler (rightArrow, 'click', function (event) { moveBelt (event, -1)}, false); tii_addEventHandler (rightArrow, keyevent, function (event) { moveBelt (event, -1)}, false); } // Quigo //function tiiQuigoSetEnabled(b) { //_tiiQuigoEnabled = b; //} /*function tiiQuigoIsEnabled() { if (typeof(_tiiQuigoEnabled) == "boolean") { return _tiiQuigoEnabled; } return true; } function tiiQuigoWriteAd(pid, placementId, zw, zh, ps) { if (tiiQuigoIsEnabled()) { qas_writeAd(placementId, pid, ps, zw, zh, 'ads.adsonar.com'); } }*/ // Most Popular & Tools Module in Global Biz // Ad Tag Migration //For Tacoda // Interstitials and popups /*function paramExists(param) { if(document.location.search.indexOf(param)>-1) return true; else return false; }*/ //For revenue Science var moveToutsSpecial; // Sets the belt mover function setMoverSpecial () { var toutsPerShow = 5; var moveDelay = 1; var widthTraversed = 0; var toutTracker = 0; var toutCount = 0; var directionChangeMultiplier; if (tii_isie) { directionChangeMultiplier = 20; } else { directionChangeMultiplier = 40; } var dotNumber = 2; var mover = document.getElementById ('moverSpecial'); if (!mover) { return false; } mover.style.left = '0px'; // The next line assumes that all the child nodes of mover are touts tii_dom_removeWhitespaceTextNodes (mover); var beltTouts = mover.childNodes; var beltToutsLength = beltTouts.length; var beltToutWidth; if (beltToutsLength > 0) { beltToutWidth = beltTouts.item (0).offsetWidth; } else { return false; } var visibleWidth = toutsPerShow * beltToutWidth; // Cai can quan tam day roi function moveBelt (event, directionChange) { //alert(directionChange); if ((event.type == keyevent && event.keyCode != 13) || widthTraversed > 0) { return false; } //di chuyen o day ne function recirculateTouts () { if (directionChange > 0) { if (Math.ceil (toutTracker / beltToutWidth) > 0 ) { toutTracker = toutTracker - beltToutWidth; var clonedTout = beltTouts.item (beltToutsLength - 1).cloneNode (true); mover.insertBefore (clonedTout, mover.firstChild); mover.removeChild(beltTouts.item (beltToutsLength)); toutCount++; } } if (directionChange < 0) { if (Math.floor (toutTracker / beltToutWidth) > 0) { toutTracker = toutTracker - beltToutWidth; var clonedTout = mover.childNodes[0].cloneNode (true); mover.appendChild (clonedTout); mover.removeChild (mover.childNodes[0]); mover.style.left = '0 px'; toutCount++; } } } //di chuyen o day ne moveToutsSpecial = setInterval (function () { widthTraversed = widthTraversed + directionChangeMultiplier; toutTracker = toutTracker + directionChangeMultiplier; recirculateTouts (); if (toutCount >= toutsPerShow) { // Stop animation clearInterval (moveToutsSpecial); // Set active button if (dotNumber == 1) { dotNumber = 2; } else { dotNumber = 1; } // var dot = document.getElementById ('dots') // if (!tii_isie){ // dot.style.background= 'url(http://img.timeinc.net/time/i/dots' + dotNumber + '.gif) 0px 0px no-repeat'; // }else{ // dot.style.backgroundPositionY = (dotNumber*13 -26) + ' px'; // } // Reinitialize variables mover.style.left = '0px'; beltTouts = mover.childNodes; widthTraversed = 0; toutCount = 0; } }, moveDelay); tii_stopDefaultAction (event); } // Cai can quan tam day roi var leftArrow = document.getElementById ('leftArrowSpecial'); var rightArrow = document.getElementById ('rightArrowSpecial'); if (!leftArrow || !rightArrow) { return false; } leftArrow.href = 'javascript:{}'; rightArrow.href = 'javascript:{}'; var keyevent = tii_issafari || tii_isie ? 'keydown' : 'keypress'; tii_addEventHandler (leftArrow, 'click', function (event) { moveBelt (event, 1)}, false); tii_addEventHandler (leftArrow, keyevent, function (event) { moveBelt (event, 1)}, false); tii_addEventHandler (rightArrow, 'click', function (event) { moveBelt (event, -1)}, false); tii_addEventHandler (rightArrow, keyevent, function (event) { moveBelt (event, -1)}, false); } tii_callFunctionOnWindowLoad (function () { setMoverSpecial (); }); function AjaxRequestURL(div,url){var obj = document.getElementById(div);if (obj){obj.innerHTML = "";}var xmlHttp;try{if (!document.all){xmlHttp=new XMLHttpRequest();}else{try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch (e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}}catch (e){alert("Your browser does not support AJAX!");return false;}; xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){if (obj) obj.innerHTML =xmlHttp.responseText;}}; xmlHttp.open("GET",url,true); xmlHttp.send(null);} /* * AVIM JavaScript Vietnamese Input Method Source File dated 26-09-2007 * * Copyright (C) 2004-2007 Hieu Tran Dang * Website: http://hdang.co.uk * * You are allowed to use this software in any way you want providing: * 1. You must retain this copyright notice at all time * 2. You must not claim that you or any other third party is the author * of this software in any way. */ va="email".split(',') //Put the ID of the fields you DON'T want to let users type Vietnamese in, multiple fields allowed, separated by a comma (,) method=1 //Default input method, 0=AUTO, 1=TELEX, 2=VNI, 3=VIQR, 4=VIQR* on_off=0 //Start AVIM on dockspell=0 //Start AVIM with spell checking on dauCu=1 //Start AVIM with old way of marking accent (o`a, o`e, u`y) useCookie=0 //Set this to 0 to NOT use cookies radioID="him_auto,him_telex,him_vni,him_viqr,him_viqr2,him_off,him_ckspell,him_daucu".split(",") var agt=navigator.userAgent.toLowerCase(),alphabet="QWERTYUIOPASDFGHJKLZXCVBNM\ ",them,spellerr,setCookie,getCookie,attached=new Array() var is_ie=((agt.indexOf("msie")!=-1)&&(agt.indexOf("opera")==-1)),S,F,J,R,X,D,oc,sk,saveStr,wi,frame,is_opera=false,D2,isKHTML=false var ver=0,support=true,changed=false,specialChange=false,uni,uni2,g,h,SFJRX,DAWEO,Z,AEO,moc,trang,kl=0,tw5,range=null,fID=document.getElementsByTagName("iframe") skey=new Array(97,226,259,101,234,105,111,244,417,117,432,121,65,194,258,69,202,73,79,212,416,85,431,89) var skey2="a,a,a,e,e,i,o,o,o,u,u,y,A,A,A,E,E,I,O,O,O,U,U,Y".split(','),A,E,O,whit=false,english="ĐÂĂƠƯÊÔ",lowen="đâăơưêô",ds1="d,D".split(","),db1=new Array(273,272) os1="o,O,ơ,Ơ,ó,Ó,ò,Ò,ọ,Ọ,ỏ,Ỏ,õ,Õ,ớ,Ớ,ờ,Ờ,ợ,Ợ,ở,Ở,ỡ,Ỡ".split(","),ob1="ô,Ô,ô,Ô,ố,Ố,ồ,Ồ,ộ,Ộ,ổ,Ổ,ỗ,Ỗ,ố,Ố,ồ,Ồ,ộ,Ộ,ổ,Ổ,ỗ,Ỗ".split(",") mocs1="o,O,ô,Ô,u,U,ó,Ó,ò,Ò,ọ,Ọ,ỏ,Ỏ,õ,Õ,ú,Ú,ù,Ù,ụ,Ụ,ủ,Ủ,ũ,Ũ,ố,Ố,ồ,Ồ,ộ,Ộ,ổ,Ổ,ỗ,Ỗ".split(",");mocb1="ơ,Ơ,ơ,Ơ,ư,Ư,ớ,Ớ,ờ,Ờ,ợ,Ợ,ở,Ở,ỡ,Ỡ,ứ,Ứ,ừ,Ừ,ự,Ự,ử,Ử,ữ,Ữ,ớ,Ớ,ờ,Ờ,ợ,Ợ,ở,Ở,ỡ,Ỡ".split(",") trangs1="a,A,â,Â,á,Á,à,À,ạ,Ạ,ả,Ả,ã,Ã,ấ,Ấ,ầ,Ầ,ậ,Ậ,ẩ,Ẩ,ẫ,Ẫ".split(",");trangb1="ă,Ă,ă,Ă,ắ,Ắ,ằ,Ằ,ặ,Ặ,ẳ,Ẳ,ẵ,Ẵ,ắ,Ắ,ằ,Ằ,ặ,Ặ,ẳ,Ẳ,ẵ,Ẵ".split(",") as1="a,A,ă,Ă,á,Á,à,À,ạ,Ạ,ả,Ả,ã,Ã,ắ,Ắ,ằ,Ằ,ặ,Ặ,ẳ,Ẳ,ẵ,Ẵ,ế,Ế,ề,Ề,ệ,Ệ,ể,Ể,ễ,Ễ".split(",");ab1="â,Â,â,Â,ấ,Ấ,ầ,Ầ,ậ,Ậ,ẩ,Ẩ,ẫ,Ẫ,ấ,Ấ,ầ,Ầ,ậ,Ậ,ẩ,Ẩ,ẫ,Ẫ,é,É,è,È,ẹ,Ẹ,ẻ,Ẻ,ẽ,Ẽ".split(",") es1="e,E,é,É,è,È,ẹ,Ẹ,ẻ,Ẻ,ẽ,Ẽ".split(",");eb1="ê,Ê,ế,Ế,ề,Ề,ệ,Ệ,ể,Ể,ễ,Ễ".split(",") arA="á,à,ả,ã,ạ,a,Á,À,Ả,Ã,Ạ,A".split(',');mocrA="ó,ò,ỏ,õ,ọ,o,ú,ù,ủ,ũ,ụ,u,Ó,Ò,Ỏ,Õ,Ọ,O,Ú,Ù,Ủ,Ũ,Ụ,U".split(',');erA="é,è,ẻ,ẽ,ẹ,e,É,È,Ẻ,Ẽ,Ẹ,E".split(',');orA="ó,ò,ỏ,õ,ọ,o,Ó,Ò,Ỏ,Õ,Ọ,O".split(',') aA="ấ,ầ,ẩ,ẫ,ậ,â,Ấ,Ầ,Ẩ,Ẫ,Ậ,Â".split(',');mocA="ớ,ờ,ở,ỡ,ợ,ơ,ứ,ừ,ử,ữ,ự,ư,Ớ,Ờ,Ở,Ỡ,Ợ,Ơ,Ứ,Ừ,Ử,Ữ,Ự,Ư".split(',');trangA="ắ,ằ,ẳ,ẵ,ặ,ă,Ắ,Ằ,Ẳ,Ẵ,Ặ,Ă".split(',');eA="ế,ề,ể,ễ,ệ,ê,Ế,Ề,Ể,Ễ,Ệ,Ê".split(',');oA="ố,ồ,ổ,ỗ,ộ,ô,Ố,Ồ,Ổ,Ỗ,Ộ,Ô".split(',') function notWord(w) { var str="\ \r\n#,\\;.:-_()<>+-*/=?!\"$%{}[]\'~|^\@\&\t"+fcc(160) return (str.indexOf(w)>=0) } function nan(w) { if ((isNaN(w))||(w=='e')) return true else return false } function mozGetText(obj) { var v,pos,w="";g=1 v=(obj.data)?obj.data:obj.value if(v.length<=0) return false if(!obj.data) { if(!obj.setSelectionRange) return false pos=obj.selectionStart } else pos=obj.pos if(obj.selectionStart!=obj.selectionEnd) return new Array("",pos) while(1) { if(pos-g<0) break else if(notWord(v.substr(pos-g,1))) { if(v.substr(pos-g,1)=="\\") w=v.substr(pos-g,1)+w; break } else w=v.substr(pos-g,1)+w; g++ } return new Array(w,pos) } function start(obj,key) { var w="",nnc;oc=obj;uni2=false if(method==0) { uni="D,A,E,O,W,W".split(','); uni2="9,6,6,6,7,8".split(','); D2="DAWEO6789" } else if(method==1) { uni="D,A,E,O,W,W".split(','); D2="DAWEO" } else if(method==2) { uni="9,6,6,6,7,8".split(','); D2="6789" } else if(method==3) { uni="D,^,^,^,+,(".split(','); D2="D^+(" } else if(method==4) { uni="D,^,^,^,*,(".split(','); D2="D^*(" } if(!is_ie) { key=fcc(key.which) w=mozGetText(obj) if(D2.indexOf(up(key))>=0) nnc=true else nnc=false if((!w)||(obj.sel)) return main(w[0],key,w[1],uni,nnc) if(!dockspell) w=mozGetText(obj) if((w)&&(uni2)&&(!changed)) main(w[0],key,w[1],uni2,nnc) } else { obj=ieGetText(obj) if(obj) { var sT=obj.cW.text w=main(obj.cW.text,key,0,uni,false) if((uni2)&&((w==sT)||(typeof(w)=='undefined'))) w=main(obj.cW.text,key,0,uni2,false) if(w) obj.cW.text=w } } if(D2.indexOf(up(key))>=0) { if(!is_ie) { w=mozGetText(obj) if(!w) return normC(w[0],key,w[1]) } else if(typeof(obj)=="object") { obj=ieGetText(obj) if(obj) { w=obj.cW.text if(!changed) { w+=key; changed=true } obj.cW.text=w w=normC(w,key,0) if(w) { obj=ieGetText(obj); obj.cW.text=w } } } } } function ieGetText(obj) { var caret=obj.document.selection.createRange(),w="" if(caret.text) caret.text="" else { while(1) { caret.moveStart("character",-1) if(w.length==caret.text.length) break w=caret.text if(notWord(w.charAt(0))) { if(w.charCodeAt(0)==13) w=w.substr(2) else if(w.charAt(0)!="\\") w=w.substr(1) break } } } if(w.length) { caret.collapse(false) caret.moveStart("character",-w.length) obj.cW=caret.duplicate() return obj } else return false } function ie_replaceChar(w,pos,c) { var r="",uc=0 if(isNaN(c)) uc=up(c) if((whit)&&(up(w.substr(w.length-pos-1,1))=='U')&&(pos!=1)&&(up(w.substr(w.length-pos-2,1))!='Q')) { whit=false if((up(unV(fcc(c)))=="Ơ")||(uc=="O")) { if(w.substr(w.length-pos-1,1)=='u') r=fcc(432) else r=fcc(431) } if(uc=="O") { if(c=="o") c=417 else c=416 } } if(!isNaN(c)) { changed=true;r+=fcc(c) return w.substr(0,w.length-pos-r.length+1)+r+w.substr(w.length-pos+1) } else return w.substr(0,w.length-pos)+c+w.substr(w.length-pos+1) } function tr(k,w,by,sf,i) { var r,pos=findC(w,k,sf) if(pos) { if(pos[1]) { if(is_ie) return ie_replaceChar(w,pos[0],pos[1]) else return replaceChar(oc,i-pos[0],pos[1]) } else { var c,pC=w.substr(w.length-pos,1),cmp;r=sf for(g=0;g=0) { var ret=sr(w,k,i); got=true if(ret) return ret } else if(uk==Z) { sf=repSign(null) for(h=0;h=0)||(Z.indexOf(uk)>=0)) return tr(k,w,by,sf,i) } function normC(w,k,i) { var uk=up(k),u=repSign(null),fS,c,j,space=(k.charCodeAt(0)==32)?true:false if((!is_ie)&&(space)) return for(j=1;j<=w.length;j++) { for(h=0;h=0) for(a=0;a=0) return true for(b=0;b=0) next=false if((next)&&((gi.indexOf(notViet[b])<0)||(a<=0)||(uw2.substr(a-1,1)!='G'))) return true } } } for(b=0;b=0) return true } } test=tw.substr(0,1) if((t==3)&&((test=="A")||(test=="O")||(test=="U")||(test=="Y"))) return true if((t==5)&&((test=="E")||(test=="I")||(test=="Y"))) return true uw2=unV2(tw) if(uw2==notV2) return true if(tw!=twE) for(z=0;z0)&&(uk=='E')) check=false if((them.indexOf(uk)>=0)&&(check)) { for(a=0;a=0) return true if(uk!=trang) if(uw2==noAOE) return true if((uk==trang)&&(trang!='W')) if(uw2==noT) return true if(uk==moc) for(a=0;a4) return true } else if(uw2.length>3) return true return false } function DAWEOF(cc,k) { var ret=new Array(),kA=new Array(A,moc,trang,E,O),z,a;ret[0]=g var ccA=new Array(aA,mocA,trangA,eA,oA),ccrA=new Array(arA,mocrA,arA,erA,orA) for(a=0;a=0) { if(uk==moc) { if((w2.indexOf("UU")>=0)&&(tw5!=dont[1])) { if(w2.indexOf("UU")==(w.length-2)) res=2 else return false } else if(w2.indexOf("UOU")>=0) { if(w2.indexOf("UOU")==(w.length-3)) res=2 else return false } } if(!res) { for(g=1;g<=w.length;g++) { cc=w.substr(w.length-g,1) pc=up(w.substr(w.length-g-1,1)) uc=up(cc) for(h=0;h=0) { if(((uk==moc)&&(unV(uc)=="U")&&(up(unV(w.substr(w.length-g+1,1)))=="A"))||((uk==trang)&&(unV(uc)=='A')&&(unV(pc)=='U'))) { if(unV(uc)=="U") tv=1 else tv=2 ccc=up(w.substr(w.length-g-tv,1)) if(ccc!="Q") res=g+tv-1 else if(uk==trang) res=g else if(moc!=trang) return false } else res=g if((!whit)||(uw.indexOf("Ư")<0)||(uw.indexOf("W")<0)) break } else if(DAWEOFA.indexOf(uc)>=0) { if(uk==D) { if(cc=="đ") res=new Array(g,'d') else if(cc=="Đ") res=new Array(g,'D') } else res=DAWEOF(cc,uk) if(res) break } } } } if((uk!=Z)&&(DAWEO.indexOf(uk)<0)) { var tEC=retKC(uk); for (g=0;g=0) { if(cc=='U') { if(pc!='Q') { c++;vowA[vowA.length]=g } } else if(cc=='I') { if((pc!='G')||(c<=0)) { c++;vowA[vowA.length]=g } } else { c++;vowA[vowA.length]=g } } else if(uk!=Z) { for(h=0;h=0)) return g else if(tE.indexOf(w.substr(w.length-g,1))>=0) { for(h=0;h=0) { c2++;fdconsonant=true if(dc[g]!='NGH') h++ else h+=2 } } if(!fdconsonant) { if(sc.indexOf(up(w.substr(w.length-h,1)))>=0) c2++ else break } } if((c2==1)||(c2==2)) return vowA[0] else return vowA[1] } else if(c==3) return vowA[1] else return false } function unV(w) { var u=repSign(null),b,a for(a=1;a<=w.length;a++) { for(b=0;b=0) { operaV=agt.split(" ");operaVersion=parseInt(operaV[operaV.length-1]) if(operaVersion>=8) is_opera=true else { operaV=operaV[0].split("/");operaVersion=parseInt(operaV[1]) if(operaVersion>=8) is_opera=true } } else if(agt.indexOf("khtml")>=0) isKHTML=true else { ver=agt.substr(agt.indexOf("rv:")+3) ver=parseFloat(ver.substr(0,ver.indexOf(" "))) if(agt.indexOf("mozilla")<0) ver=0 } } function up(w) { w=w.toUpperCase() if(isKHTML) { str="êôơâăưếốớấắứềồờầằừễỗỡẫẵữệộợậặự",rep="ÊÔƠÂĂƯẾỐỚẤẮỨỀỒỜẦẰỪỄỖỠẪẴỮỆỘỢẶỰ" for(z=0;z=0) w=w.substr(0,z)+rep.substr(io,1)+w.substr(z+1) } } return w } function findIgnore(el) { for(i=0;i0)) return true } if((is_ie)||(ver>=1.3)||(is_opera)||(isKHTML)) { getCookie() if(on_off==0) setMethod(-1) else setMethod(method) setSpell(dockspell);setDauCu(dauCu) } else support=false function onKeyPress(e) { if(!support) return if(!is_ie) { var el=e.target,code=e.which; if(e.ctrlKey) return; if((e.altKey)&&(code!=92)&&(code!=126)) return } else { var el=window.event.srcElement,code=window.event.keyCode; if((event.ctrlKey)&&(code!=92)&&(code!=126)) return } if(((el.type!='textarea')&&(el.type!='text'))||checkCode(code)) return sk=fcc(code); if (findIgnore(el)) return if(!is_ie) start(el,e) else start(el,sk) if(changed) { changed=false if (!is_ie) e.preventDefault() else return false } } function attachEvt(obj,evt,handle,capture) { if(is_ie) obj.attachEvent("on"+evt,handle) else obj.addEventListener(evt,handle,capture) } attachEvt(document,"keydown",onKeyDown,false) attachEvt(document,"keypress",onKeyPress,false) function findF() { for(g=0;g32) && theTyper.typing(c)); if (changed) this.replaceWord(theTyper.value); return !changed; } function getCurrentWord() { if(!document.all) return this.value; var caret= this.document.selection.createRange(); if (caret.text) return null; var backward= -10; do { var caret2= caret.duplicate(); caret2.moveStart("character", backward); outside= /[\x01-\x40]([^\x01-\x40]+)$/.exec(caret2.text); if (outside) backward = -outside[1].length; } while (outside && backward <0); this.curword= caret2.duplicate(); return caret2.text; } function replaceWord(newword) { if(!document.all) { this.value= newword; return; } this.curword.text= newword; this.curword.collapse(false); } // end interface // "class": CVietString // function CVietString(str) { this.value= str; this.keymode= initKeys(); this.charmap= initCharMap(); this.ctrlchar= '-'; this.changed= 0; this.typing= typing; this.Compose= Compose; this.Correct= Correct; this.findCharToChange= findCharToChange; return this; } function typing(ctrl) { this.changed= 0; this.ctrlchar= String.fromCharCode(ctrl); if (linebreak) linebreak= 0; else this.keymode.getAction(this); this.Correct(); return this.changed; } function Compose(type) { if(!this.value) return; var info= this.findCharToChange(type); if (!info || !info[0]) return; var telex; if (info[0]=='\\') telex= [1,this.ctrlchar,1]; else if (type>6) telex= this.charmap.getAEOWD(info[0], type, info[3]); else telex= this.charmap.getDau(info[0], type); if (!(this.changed = telex[0])) return; this.value= this.value.replaceAt(info[1],telex[1],info[2]); if (!telex[2]) { spellerror= 1; this.value+= this.ctrlchar; } } function Correct() { if (this.charmap.maxchrlen || !document.all) return 0; var tmp= this.value; if ('nNcC'.indexOf(this.ctrlchar)>=0) tmp+= this.ctrlchar; var er= /[^\x01-\x7f](hn|hc|gn)$/i.exec(tmp); if (er) { this.value= tmp.substring(0,tmp.length-2)+er[1].charAt(1)+er[1].charAt(0); this.changed= 1; } else if(!this.changed) return 0; er= /\w([^\x01-\x7f])(\w*)([^\x01-\x7f])\S*$/.exec(this.value); if (!er) return 0; var i= this.charmap.isVowel(er[1]); var ri= (i-1)%24 + 1, ci= (i-ri)/24; var i2= this.charmap.isVowel(er[3]); if (!ci || !i2) return 0; var ri2= (i2-1)%24 + 1, ci2= (i2-ri2)/24; var nc= this.charmap.charAt(ri)+ er[2]+ this.charmap.charAt(ci*24+ri2); this.value= this.value.replace(new RegExp(er[1]+er[2]+er[3],'g'), nc); } function findCharToChange(type) { var lastchars= this.charmap.lastCharsOf(this.value, 5); var i= 0, c=lastchars[0][0], chr=0; if (c=='\\') return [c,this.value.length-1,1]; if (type==15) while (!(chr=this.charmap.isVD(c))) { if ((c < 'A') || (i>=4) || !(c=lastchars[++i][0])) return null; } else while( "cghmnptCGHMNPT".indexOf(c)>=0) { if ((c < 'A') || (i>=2) || !(c=lastchars[++i][0])) return null; } c= lastchars[0][0].toLowerCase(); var pc= lastchars[1][0].toLowerCase(); var ppc= lastchars[2][0].toLowerCase(); if (i==0 && type!=15) { if ( (chr=this.charmap.isVowel(lastchars[1][0])) && ("uyoia".indexOf(c)>=0) && !this.charmap.isUO(pc,c) && !((pc=='o' && c=='a') || (pc=='u' && c=='y')) && !((ppc=='q' && pc=='u') || (ppc=='g' && pc=='i')) ) ++i; if (c=='a' && (type==9 || type==7)) i= 0; } c= lastchars[i][0]; if ((i==0 || chr==0) && type!=15) chr= this.charmap.isVowel(c); if (!chr) return null; var clen= lastchars[i][1], isuo=0; if ((i>0) && (type==7 || type==8 || type==11)) { isuo=this.charmap.isUO(lastchars[i+1][0],c); if (isuo) { chr=isuo; clen+=lastchars[++i][1]; isuo=1; } } var pos= this.value.length; for (var j=0; j<= i; j++) pos -= lastchars[j][1]; return [chr, pos, clen, isuo]; } // end CVietString // character-map template // function CVietCharMap(){ this.vietchars = null; this.length = 149; this.chr_cache = new Array(20); this.ind_cache = new Array(20); this.cptr = 0; this.caching= function(chr, ind) { this.chr_cache[this.cptr] = chr; this.ind_cache[this.cptr++] = ind; this.cptr %= 20; } return this; } CVietCharMap.prototype.charAt= function(ind){ var chrcode= this.vietchars[ind]; return chrcode ? String.fromCharCode(chrcode) : null; } CVietCharMap.prototype.isVowel= function(chr){ var i= 0; while ((i<20) && (chr != this.chr_cache[i])) ++i; if (i<20) return this.ind_cache[i]; i = this.length-5; while ((chr != this.charAt(i)) && i) --i; this.caching(chr, i); return i; } CVietCharMap.prototype.isVD= function (chr){ var ind= this.length-5; while ((chr != this.charAt(ind)) && (ind < this.length)) ++ind; return (ind24 || type==6]; } var map=[ [7,7,7,8,8, 8,9,10,11,15], [0,3,6,0,6, 9,0, 3, 6, 0], [1,4,7,2,8,10,1, 4, 7, 1] ]; CVietCharMap.prototype.getAEOWD= function(ind, type, isuo) { var c=0, i1=isuo? ind[0]: ind; var vc1= (type==15)? (i1-1)%2 : (i1-1)%12; if (isuo) { var base= ind[1]-(ind[1]-1)%12; if (type==7 || type==11) c= this.charAt(i1-vc1+9)+this.charAt(base+7); else if (type==8) c= this.charAt(i1-vc1+10)+this.charAt(base+8); return [c!=0, c, 1]; } var i= -1, shift= 0, del= 0; while (shift==0 && ++i0); i1 += shift; var chr= this.charAt(i1); if (i1<145) this.caching(chr, i1); if (!chr) chr= this.lowerCaseOf(0, i1); return [shift!=0, chr, del]; } CVietCharMap.prototype.lastCharsOf= function(str, num){ if (!num) return [str.charAt(str.length-1),1]; var vchars = new Array(num); for (var i=0; i< num; i++) { vchars[i]= [str.charAt(str.length-i-1),1]; } return vchars; } // end CVietCharMap prototype String.prototype.replaceAt= function(i,newchr,clen){ return this.substring(0,i)+ newchr + this.substring(i+clen); } // output map: class CVietUniCodeMap // function CVietUniCodeMap(){ var map= new CVietCharMap(); map.vietchars = new Array( "UNICODE", 97, 226, 259, 101, 234, 105, 111, 244, 417, 117, 432, 121, 65, 194, 258, 69, 202, 73, 79, 212, 416, 85, 431, 89, 225, 7845, 7855, 233, 7871, 237, 243, 7889, 7899, 250, 7913, 253, 193, 7844, 7854, 201, 7870, 205, 211, 7888, 7898, 218, 7912, 221, 224, 7847, 7857, 232, 7873, 236, 242, 7891, 7901, 249, 7915, 7923, 192, 7846, 7856, 200, 7872, 204, 210, 7890, 7900, 217, 7914, 7922, 7841, 7853, 7863, 7865, 7879, 7883, 7885, 7897, 7907, 7909, 7921, 7925, 7840, 7852, 7862, 7864, 7878, 7882, 7884, 7896, 7906, 7908, 7920, 7924, 7843, 7849, 7859, 7867, 7875, 7881, 7887, 7893, 7903, 7911, 7917, 7927, 7842, 7848, 7858, 7866, 7874, 7880, 7886, 7892, 7902, 7910, 7916, 7926, 227, 7851, 7861, 7869, 7877, 297, 245, 7895, 7905, 361, 7919, 7929, 195, 7850, 7860, 7868, 7876, 296, 213, 7894, 7904, 360, 7918, 7928, 100, 273, 68, 272); return map; } // input methods: class C...Keys function CVietKeys() { this.getAction= function(typer){ var i= this.keys.indexOf(typer.ctrlchar.toLowerCase()); if(i>=0) typer.Compose(this.actions[i]); } return this; } function CVKOff() { this.off = true; this.getAction= function(){}; return this; } function CTelexKeys() { var k= new CVietKeys(); k.keys= "sfjrxzaeowd"; k.actions= [1,2,3,4,5,6,9,10,11,8,15]; k.istelex= true; return k; } function CVniKeys() { var k= new CVietKeys(); k.keys= "0123456789"; k.actions= [6,1,2,4,5,3,7,8,8,15]; return k; } function CViqrKeys() { var k= new CVietKeys(); k.keys= "\xB4/'\u2019`.?~-^(*+d"; k.actions= [1,1,1,1,2,3,4,5,6,7,8,8,8,15]; return k; } function CAllKeys() { var k= new CVietKeys(); k.keys= "sfjrxzaeowd0123456789\xB4/'`.?~-^(*+d"; k.actions= [1,2,3,4,5,6,9,10,11,8,15,6,1,2,4,5,3,7,8,8,15,1,1,1,2,3,4,5,6,7,8,8,8,15]; k.istelex= true; return k; } // end vietuni.js function addFavoris() { if (navigator.appName!='Microsoft Internet Explorer') { window.silebar.addPanel("VnEconomy","http://vneconomy.vn/",""); } else { window.external.AddFavorite("http://vneconomy.vn/","VnEconomy"); } } function tang() { //alert(document.getElementById("divBody").style.fontSize); if(document.getElementById("divBody").style.fontSize=="") { document.getElementById("divBody").style.fontSize="12pt"; } var vfont = document.getElementById("divBody").style.fontSize; //document.getElementById("divBody").style.fontSize = size; var new_size = (Number(String(vfont).substring(0,vfont.length-2)) + 1); if(new_size>13) new_size=13; document.getElementById("divBody").style.fontSize= new_size + "pt"; //alert(document.getElementById("divBody").style.fontSize); TangCon(document.getElementById("divBody").style.fontSize); } function TangCon(size) { var cha = document.getElementById("divBody"); var listcon ; if (document.all) listcon = cha.all; else listcon = cha.getElementsByTagName("*"); var len = listcon.length; for (var i = 0 ; i < len ; i++) { listcon[i].style.fontSize= size; listcon[i].style.color = "#000000"; listcon[i].style.fontFamily="Times New Roman"; } } function giam() { if(document.getElementById("divBody").style.fontSize=="") { document.getElementById("divBody").style.fontSize="12pt"; } else { var vfont = document.getElementById("divBody").style.fontSize; //document.getElementById("divBody").style.fontSize = size; var new_size = (Number(String(vfont).substring(0,vfont.length-2)) - 1); if(new_size<10) new_size=10; document.getElementById("divBody").style.fontSize= new_size + "pt"; } TangCon(document.getElementById("divBody").style.fontSize); } function OpenWindowSendMail(){ var LeftPos=(screen.width)?(screen.width-600)/2:100; var TopPos=(screen.height)?(screen.height-500)/2:100; //alert('abc'); //window.open('/','toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no',"Left="+LeftPos+",top="+TopPos); //alert(location.href); window.open('/Ajax/News/SentMail.aspx?link='+location.href ,'',"left=" + LeftPos + ",top=" + TopPos + ",width=" + 510 + ",height=" + 300 + " "); } //Created By ThienTD var delay_hide = 500; var ParentMenu = new Array(); // Menu Con Cua Chuyen muc Home var ChildrenMenuHome = new Array( new Array('Về VnEconomy','/home.htm#'), new Array('Cộng tác viên','mailto:editor@vneconomy.vn'), new Array('Công việc tại VnEconomy','mailto:editor@vneconomy.vn'), new Array('Quảng cáo trên VnEconomy','mailto:cuongtongba@admicro.vn'), new Array('Ý kiến bạn đọc','/home/y-kien-ban-doc.htm'), new Array('RSS','/home/rss.htm') ); // Menu Con Cua Chuyen muc Doanh Nghiep var ChildrenMenuDoanhNghiep = new Array( new Array('Đời sống doanh nhân','/p5c502/doi-song-doanh-nhan.htm'), new Array('Chuyện làm ăn','/p5c503/chuyen-lam-an.htm') ); // Menu Con Cua Chuyen muc Giao Thuong var ChildrenMenuGiaoThuong = new Array( new Array('Đầu tư - ODA','/p10c1001/dau-tu-oda.htm'), new Array('Xuất nhập khẩu','/p10c1002/xuat-nhap-khau.htm'), new Array('Việt Nam - Mỹ','/p10c1003/viet-nam-my.htm'), new Array('Việt Nam - Đông Á','/p10c1005/viet-nam-dong-a.htm'), new Array('Việt Nam - ASEAN','/p10c1015/viet-nam-asean.htm'), new Array('Việt Nam - EU','/p10c1016/viet-nam-eu.htm') ); // Menu Con Cua Chuyen muc Music var ChildrenMenuTaiChinh = new Array( new Array('Ngân hàng','/p6c602/ngan-hang.htm'), new Array('Thuế - Ngân sách','/p6c601/thue-ngan-sach.htm'), new Array('Bảo hiểm','/p6c603/bao-hiem.htm'), new Array('Biến động lãi suất','/p6c410/bie-dong-lai-xuat.htm'), new Array('Thị trường vàng','/p6c628/thi-truong-vang.htm'), new Array('Biến động tỷ giá','/p6c604/bien-dong-ty-gia.htm') ); // Menu Con Cua Chuyen muc chung khoan var ChildrenMenuChungKhoan = new Array( new Array('Tin doanh nghiệp','/p7c642/tin-doanh-nghiep.htm'), new Array('Giao dịch trong ngày','/p7c281/giao-dich-trong-ngay.htm'), new Array('Chứng khoán thế giới','/p7c706/chung-khoan-the-gioi.htm'), new Array('Bình luận - Nhận định','/p7c708/binh-luan-nhan-dinh.htm'), new Array('Kinh nghiệm - Kiến thức','/p7c707/kinh-nghiem-kien-thuc.htm'), new Array('IPO - Cổ phần hóa','/p7c705/IPO-co-phan-hoa.htm'), new Array('Doanh nghiệp niêm yết A-Z','/p7c22061987/doanh-nghiep-niem-yet-a-z.htm') ); // Menu Con Cua Chuyen muc thi truong var ChildrenMenuThiTruong = new Array( new Array('Chuyển động thị trường','/p19c9911/chuyen-dong-thi-truong.htm'), new Array('Giá hàng hóa','/p19c9912/gia-hang-hoa.htm') ); // Menu Con Cua Chuyen muc Cong Nghe var ChildrenMenuCongNghe = new Array( new Array('Công nghệ thông tin','/p16c9904/cong-nghe-thong-tin.htm'), new Array('Viễn thông','/p16c9905/vien-thong.htm'), new Array('Dịch vụ - Sản phẩm','/p16c9906/dich-vu-san-pham.htm') ); // Menu Con Cua Chuyen muc Nha Dat var ChildrenMenuNhaDat = new Array( new Array('Thị trường','/p17c9907/thi-truong.htm'), new Array('Hạ tầng - Quy hoạch','/p17c9908/ha-tang-quy-hoach.htm') ); // Menu Con Cua Chuyen muc oto xe may var ChildrenMenuOtoXeMay = new Array( new Array('Thị trường','/p23c2301/thi-truong.htm'), new Array('Công nghiệp xe','/p23c2306/cong-nghiep-xe.htm'), new Array('Thế giới xe','/p23c2303/the-gioi-xe.htm'), new Array('Tư vấn','/p23c2304/tu-van.htm'), new Array('Giá xe','#','window.open("http://images.vneconomy.vn/Images/BangGiaOto.htm");') ); // Menu Con Cua Chuyen muc nguon nhan luc var ChildrenMenuNguonNhanLuc = new Array( new Array('Môi trường lao động','/p11c1102/moi-truong-lao-dong.htm'), new Array('Giáo dục - Đào tạo','/p11c9913/giao-duc-dao-tao.htm'), new Array('Xuất khẩu lao động','/p11c1103/xuat-khau-lao-dong.htm') ); // Menu Con Cua Chuyen muc the gioi var ChildrenMenuTheGioi = new Array( new Array('Bình luận - Nhận định','/p99c9901/binh-luan-nhan-dinh.htm'), new Array('Hồ sơ','/p99c9902/ho-so.htm') ); //Created By QuyTD : Dung giong method String.Format cua .NET String.prototype.StringFormat = function(args) { var text = this; for (var i = 0 ; i < arguments.length; i++) { text = text.replace("{"+ i +"}",arguments[i]); } return text; } function SelectSubMenu(id) { clear_delayhide(); var SubMenu; var postion = 30; if(id=='home') { SubMenu = ChildrenMenuHome; } else if(id=='doanhnghiep') { SubMenu = ChildrenMenuDoanhNghiep; } else if(id=='giaothuong') { SubMenu = ChildrenMenuGiaoThuong; //postion=200; } else if(id=='taichinh') { SubMenu = ChildrenMenuTaiChinh; } else if(id=='chungkhoan') { SubMenu = ChildrenMenuChungKhoan; } else if(id=='thitruong') { SubMenu = ChildrenMenuThiTruong; } else if(id=='congnghe') { SubMenu = ChildrenMenuCongNghe; } else if(id=='nhadat') { SubMenu = ChildrenMenuNhaDat; } else if(id=='otoxemay') { SubMenu = ChildrenMenuOtoXeMay; } else if(id=='nguonnhanluc') { SubMenu = ChildrenMenuNguonNhanLuc; } else if(id=='thegioi') { SubMenu = ChildrenMenuTheGioi; } GenSubmenu(SubMenu,postion); } function FocusMenu() { if(document.getElementById('currentTab').value!="") { clear_delayhide(); ChangeBackGroundImageOver(document.getElementById('currentTab').value); } } function BlurMenu() { if(document.getElementById('currentTab').value!="") { OrginaltionBacGround(document.getElementById('currentTab').value); DeactiveMenu(); } } function GenSubmenu(Submenu,position) { var htmlCode_Onclick =" {1}  "; var htmlCode =" {1}  "; //var htmlCode =""; var stringGen ="" ; if(Submenu!=null) { if(Submenu.length>0) { var subMenuCount = 0; for(subMenuCount = 0; subMenuCount < Submenu.length; subMenuCount++) { var menuItem = Submenu[subMenuCount]; if (menuItem.length > 2) stringGen+= htmlCode_Onclick.StringFormat(menuItem[1],menuItem[0],menuItem[2]); else stringGen+= htmlCode.StringFormat(menuItem[1],menuItem[0]); } } document.getElementById('subMenu').innerHTML = "
"+stringGen+"
"; //document.getElementById('subMenu').style.paddingLeft = position+"px"; } else return; } function ClearSubmenu() { document.getElementById('subMenu').innerHTML = document.getElementById('mainTab').value; document.getElementById('currentTab').value=""; } function DeactiveMenu() { var functiondelay = "ClearSubmenu()"; delayhide = setTimeout(functiondelay,delay_hide); } function clear_delayhide() { if (window.delayhide) { clearTimeout(delayhide); } } function ChangeID(id) { document.getElementById('currentTab').value = id; } function Set_Style(divName,style) { document.getElementById('div' + divName + 'Left').className = "style1" + style; document.getElementById('div' + divName + 'Center').className = "style2" + style; document.getElementById('div' + divName + 'Right').className = "style3" + style; } function ChangeBackGroundImageOver(id) { switch(id) { case 'home' : Set_Style('Home','1'); break; case 'doanhnghiep' : Set_Style('DoanhNghiep','1'); break; case 'giaothuong' : Set_Style('GiaoThuong','1'); break; case 'taichinh' : Set_Style('TaiChinh','1'); break; case 'chungkhoan' : Set_Style('ChungKhoan','1'); break; case 'thitruong' : Set_Style('ThiTruong','1'); break; case 'congnghe' : Set_Style('CongNghe','1'); break; case 'nhadat' : Set_Style('NhaDat','1'); break; case 'otoxemay' : Set_Style('OtoXeMay','1'); break; case 'nguonnhanluc' : Set_Style('NguonNhanLuc','1'); break; case 'thegioi' : Set_Style('TheGioi','1'); break; default: break; } } function MOver(id) { ChangeBackGroundImageOver(id); SelectSubMenu(id); ChangeID(id) } function OrginaltionBacGround(id) { switch(id) { case 'home' : Set_Style('Home',''); break; case 'doanhnghiep' : Set_Style('DoanhNghiep',''); break; case 'giaothuong' : Set_Style('GiaoThuong',''); break; case 'taichinh' : Set_Style('TaiChinh',''); break; case 'chungkhoan' : Set_Style('ChungKhoan',''); break; case 'thitruong' : Set_Style('ThiTruong',''); break; case 'congnghe' : Set_Style('CongNghe',''); break; case 'nhadat' : Set_Style('NhaDat',''); break; case 'otoxemay' : Set_Style('OtoXeMay',''); break; case 'nguonnhanluc' : Set_Style('NguonNhanLuc',''); break; case 'thegioi' : Set_Style('TheGioi',''); break; default: break; } } function optNewsClick(txtSearchTin,lbkOK) { var txtSearchTin = GetControlByServerID(txtSearchTin); txtSearchTin.style.display = ''; document.getElementById('txtCafeFS').style.display = 'none'; var lbkOK = GetControlByServerID(lbkOK); lbkOK.style.display = ''; return true; } function GetControlByServerID(serverid) { var id = document.getElementById("hidPrefix").value + "_" + serverid; return document.getElementById(id); } function optCafeFClick(txtSearchTin,lbkOK) { var txtSearchTin = GetControlByServerID(txtSearchTin); txtSearchTin.style.display = 'none'; document.getElementById('txtCafeFS').style.display = ''; var lbkOK = GetControlByServerID(lbkOK); lbkOK.style.display = 'none'; return true; } function doClickTimTin(event,lbkOK,txtSearchTin) { var textSearch = GetControlByServerID(txtSearchTin); var strSearch = textSearch.value; var url = ""; var key; if(window.event) { key = window.event.keyCode; //alert(url); if (key == 13) { if(textSearch.value!="") { strSearch = strSearch.replace('?', '').replace(/"/g, '').replace(/^\s+|\s+$/g, ''); if(strSearch=="") return false; else if(strSearch.indexOf("?")!=-1) return false; url = "/home/tim-kiem.htm?key="+strSearch+"&bl=2"; document.location.href = url; return false; } else { alert("Bạn chưa nhập từ khóa tìm kiếm !"); return false; } } } else { key = event.which; if (key == 13) { if(textSearch.value!="") { strSearch = strSearch.replace('?', '').replace(/"/g, '').replace(/^\s+|\s+$/g, ''); if(strSearch=="") return false; else if(strSearch.indexOf("?")!=-1) return false; url = "/home/tim-kiem.htm?key="+strSearch+"&bl=2"; document.location.href = url; return false; } else { alert("Bạn chưa nhập từ khóa tìm kiếm !"); return false; } } } } function OnClick(txtSearchTin) { var textSearch = GetControlByServerID(txtSearchTin); var strSearch = textSearch.value; strSearch = strSearch.replace('?', '').replace(/"/g, '').replace(/^\s+|\s+$/g, ''); if(strSearch=="") return false; else if(strSearch.indexOf("?")!=-1) return false; strSearch = encodeURIComponent(strSearch) var url = "/home/tim-kiem.htm?key="+strSearch+"&bl=2"; //alert(url); if(strSearch!="") { document.location.href= url; return false; } else { alert("Bạn chưa nhập từ khóa tìm kiếm !"); return false; } } function LoadImage(id,src) { if (id.getAttribute("loi") == null) { id.setAttribute("loi","1"); } else { id.setAttribute("loi",eval(id.getAttribute("loi")) + 1); } if (eval(id.getAttribute("loi")) >=2) { var width = src.substr(src.lastIndexOf("=") + 1,src.length - src.lastIndexOf("=")); id.onerror = null; id.src = "/Images/no_image.jpg"; } else { id.src = src; } } /** * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/ * * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * */ if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="";_19+="";var _1d=this.getParams();for(var key in _1d){_19+="";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="";}_19+="";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.majorfv.major){return true;}if(this.minorfv.minor){return true;}if(this.rev=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject; (function(){ /* * jQuery @VERSION - New Wave Javascript * * Copyright (c) 2007 John Resig (jquery.com) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * $Date: 2007-11-19 17:07:44 +0100 (Mon, 19 Nov 2007) $ * $Rev: 3856 $ */ // Map over jQuery in case of overwrite if ( window.jQuery ) var _jQuery = window.jQuery; var jQuery = window.jQuery = function( selector, context ) { // If the context is a namespace object, return a new object return this instanceof jQuery ? this.init( selector, context ) : new jQuery( selector, context ); }; // Map over the $ in case of overwrite if ( window.$ ) var _$ = window.$; // Map the jQuery namespace to the '$' one window.$ = jQuery; // A simple way to check for HTML strings or ID strings // (both of which we optimize for) var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/; jQuery.fn = jQuery.prototype = { init: function( selector, context ) { // Make sure that a selection was provided selector = selector || document; // Handle HTML strings if ( typeof selector == "string" ) { // Are we dealing with HTML string or an ID? var match = quickExpr.exec( selector ); // Verify a match, and that no context was specified for #id if ( match && (match[1] || !context) ) { // HANDLE: $(html) -> $(array) if ( match[1] ) selector = jQuery.clean( [ match[1] ], context ); // HANDLE: $("#id") else { var elem = document.getElementById( match[3] ); // Make sure an element was located if ( elem ) // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id != match[3] ) return jQuery().find( selector ); // Otherwise, we inject the element directly into the jQuery object else { this[0] = elem; this.length = 1; return this; } else selector = []; } // HANDLE: $(expr, [context]) // (which is just equivalent to: $(content).find(expr) } else return new jQuery( context ).find( selector ); // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) return new jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector ); return this.setArray( // HANDLE: $(array) selector.constructor == Array && selector || // HANDLE: $(arraylike) // Watch for when an array-like object, contains DOM nodes, is passed in as the selector (selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) || // HANDLE: $(*) [ selector ] ); }, // The current version of jQuery being used jquery: "@VERSION", // The number of elements contained in the matched element set size: function() { return this.length; }, // The number of elements contained in the matched element set length: 0, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { return num == undefined ? // Return a 'clean' array jQuery.makeArray( this ) : // Return just the object this[ num ]; }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery( elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; // Return the newly-formed element set return ret; }, // Force the current matched set of elements to become // the specified array of elements (destroying the stack in the process) // You should use pushStack() in order to do this, but maintain the stack setArray: function( elems ) { // Resetting the length to 0, then using the native Array push // is a super-fast way to populate an object with array-like properties this.length = 0; Array.prototype.push.apply( this, elems ); return this; }, // Execute a callback for every element in the matched set. // (You can seed the arguments with an array of args, but this is // only used internally.) each: function( callback, args ) { return jQuery.each( this, callback, args ); }, // Determine the position of an element within // the matched set of elements index: function( elem ) { var ret = -1; // Locate the position of the desired element this.each(function(i){ if ( this == elem ) ret = i; }); return ret; }, attr: function( name, value, type ) { var options = name; // Look for the case where we're accessing a style value if ( name.constructor == String ) if ( value == undefined ) return this.length && jQuery[ type || "attr" ]( this[0], name ) || undefined; else { options = {}; options[ name ] = value; } // Check to see if we're setting style values return this.each(function(i){ // Set all the styles for ( name in options ) jQuery.attr( type ? this.style : this, name, jQuery.prop( this, options[ name ], type, i, name ) ); }); }, css: function( key, value ) { return this.attr( key, value, "curCSS" ); }, text: function( text ) { if ( typeof text != "object" && text != null ) return this.empty().append( document.createTextNode( text ) ); var ret = ""; jQuery.each( text || this, function(){ jQuery.each( this.childNodes, function(){ if ( this.nodeType != 8 ) ret += this.nodeType != 1 ? this.nodeValue : jQuery.fn.text( [ this ] ); }); }); return ret; }, wrapAll: function( html ) { if ( this[0] ) // The elements to wrap the target around jQuery( html, this[0].ownerDocument ) .clone() .insertBefore( this[0] ) .map(function(){ var elem = this; while ( elem.firstChild ) elem = elem.firstChild; return elem; }) .append(this); return this; }, wrapInner: function( html ) { return this.each(function(){ jQuery( this ).contents().wrapAll( html ); }); }, wrap: function( html ) { return this.each(function(){ jQuery( this ).wrapAll( html ); }); }, append: function() { return this.domManip(arguments, true, false, function(elem){ this.appendChild( elem ); }); }, prepend: function() { return this.domManip(arguments, true, true, function(elem){ this.insertBefore( elem, this.firstChild ); }); }, before: function() { return this.domManip(arguments, false, false, function(elem){ this.parentNode.insertBefore( elem, this ); }); }, after: function() { return this.domManip(arguments, false, true, function(elem){ this.parentNode.insertBefore( elem, this.nextSibling ); }); }, end: function() { return this.prevObject || jQuery( [] ); }, find: function( selector ) { var elems = jQuery.map(this, function(elem){ return jQuery.find( selector, elem ); }); return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ? jQuery.unique( elems ) : elems ); }, clone: function( events ) { // Do the clone var ret = this.map(function(){ return this.outerHTML ? jQuery( this.outerHTML )[0] : this.cloneNode( true ); }); // Need to set the expando to null on the cloned set if it exists // removeData doesn't work here, IE removes it from the original as well // this is primarily for IE but the data expando shouldn't be copied over in any browser var clone = ret.find("*").andSelf().each(function(){ if ( this[ expando ] != undefined ) this[ expando ] = null; }); // Copy the events from the original to the clone if ( events === true ) this.find("*").andSelf().each(function(i){ var events = jQuery.data( this, "events" ); for ( var type in events ) for ( var handler in events[ type ] ) jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data ); }); // Return the cloned set return ret; }, filter: function( selector ) { return this.pushStack( jQuery.isFunction( selector ) && jQuery.grep(this, function(elem, i){ return selector.call( elem, i ); }) || jQuery.multiFilter( selector, this ) ); }, not: function( selector ) { return this.pushStack( selector.constructor == String && jQuery.multiFilter( selector, this, true ) || jQuery.grep(this, function(elem) { return selector.constructor == Array || selector.jquery ? jQuery.inArray( elem, selector ) < 0 : elem != selector; }) ); }, add: function( selector ) { return this.pushStack( jQuery.merge( this.get(), selector.constructor == String ? jQuery( selector ).get() : selector.length != undefined && (!selector.nodeName || jQuery.nodeName(selector, "form")) ? selector : [selector] ) ); }, is: function( selector ) { return selector ? jQuery.multiFilter( selector, this ).length > 0 : false; }, hasClass: function( selector ) { return this.is( "." + selector ); }, val: function( value ) { if ( value == undefined ) { if ( this.length ) { var elem = this[0]; // We need to handle select boxes special if ( jQuery.nodeName( elem, "select" ) ) { var index = elem.selectedIndex, values = [], options = elem.options, one = elem.type == "select-one"; // Nothing was selected if ( index < 0 ) return null; // Loop through all the selected options for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { var option = options[ i ]; if ( option.selected ) { // Get the specifc value for the option value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; // We don't need an array for one selects if ( one ) return value; // Multi-Selects return an array values.push( value ); } } return values; // Everything else, we just grab the value } else return this[0].value.replace(/\r/g, ""); } } else return this.each(function(){ if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) this.checked = (jQuery.inArray(this.value, value) >= 0 || jQuery.inArray(this.name, value) >= 0); else if ( jQuery.nodeName( this, "select" ) ) { var values = value.constructor == Array ? value : [ value ]; jQuery( "option", this ).each(function(){ this.selected = (jQuery.inArray( this.value, values ) >= 0 || jQuery.inArray( this.text, values ) >= 0); }); if ( !values.length ) this.selectedIndex = -1; } else this.value = value; }); }, html: function( value ) { return value == undefined ? (this.length ? this[0].innerHTML : null) : this.empty().append( value ); }, replaceWith: function( value ) { return this.after( value ).remove(); }, eq: function( i ) { return this.slice( i, i + 1 ); }, slice: function() { return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); }, map: function( callback ) { return this.pushStack( jQuery.map(this, function(elem, i){ return callback.call( elem, i, elem ); })); }, andSelf: function() { return this.add( this.prevObject ); }, domManip: function( args, table, reverse, callback ) { var clone = this.length > 1, elems; return this.each(function(){ if ( !elems ) { elems = jQuery.clean( args, this.ownerDocument ); if ( reverse ) elems.reverse(); } var obj = this; if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) ) obj = this.getElementsByTagName("tbody")[0] || this.appendChild( document.createElement("tbody") ); var scripts = jQuery( [] ); jQuery.each(elems, function(){ var elem = clone ? this.cloneNode( true ) : this; if ( jQuery.nodeName( elem, "script" ) ) { // If scripts are waiting to be executed, wait on this script as well if ( scripts.length ) scripts = scripts.add( elem ); // If nothing is waiting to be executed, run immediately else evalScript( 0, elem ); } else { // Remove any inner scripts for later evaluation if ( elem.nodeType == 1 ) scripts = scripts.add( jQuery( "script", elem ).remove() ); // Inject the elements into the document callback.call( obj, elem ); } }); scripts.each( evalScript ); }); } }; function evalScript( i, elem ) { if ( elem.src ) jQuery.ajax({ url: elem.src, async: false, dataType: "script" }); else jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); if ( elem.parentNode ) elem.parentNode.removeChild( elem ); } jQuery.extend = jQuery.fn.extend = function() { // copy reference to target object var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; // Handle a deep copy situation if ( target.constructor == Boolean ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target != "object" ) target = {}; // extend jQuery itself if only one argument is passed if ( length == 1 ) { target = this; i = 0; } for ( ; i < length; i++ ) // Only deal with non-null/undefined values if ( (options = arguments[ i ]) != null ) // Extend the base object for ( var name in options ) { // Prevent never-ending loop if ( target === options[ name ] ) continue; // Recurse if we're merging object values if ( deep && typeof options[ name ] == "object" && target[ name ] && !options[ name ].nodeType ) target[ name ] = jQuery.extend( target[ name ], options[ name ] ); // Don't bring in undefined values else if ( options[ name ] != undefined ) target[ name ] = options[ name ]; } // Return the modified object return target; }; var expando = "jQuery" + (new Date()).getTime(), uuid = 0, windowData = {}; // exclude the following css properties to add px var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; jQuery.extend({ noConflict: function( deep ) { window.$ = _$; if ( deep ) window.jQuery = _jQuery; return jQuery; }, // This may seem like some crazy code, but trust me when I say that this // is the only cross-browser way to do this. --John isFunction: function( fn ) { return !!fn && typeof fn != "string" && !fn.nodeName && fn.constructor != Array && /function/i.test( fn + "" ); }, // check if an element is in a (or is an) XML document isXMLDoc: function( elem ) { return elem.documentElement && !elem.body || elem.tagName && elem.ownerDocument && !elem.ownerDocument.body; }, // Evalulates a script in a global context // Evaluates Async. in Safari 2 :-( globalEval: function( data ) { data = jQuery.trim( data ); if ( data ) { // Inspired by code by Andrea Giammarchi // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html var head = document.getElementsByTagName("head")[0] || document.documentElement, script = document.createElement("script"); script.type = "text/javascript"; if ( jQuery.browser.msie ) script.text = data; else script.appendChild( document.createTextNode( data ) ); head.appendChild( script ); head.removeChild( script ); } }, nodeName: function( elem, name ) { return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); }, cache: {}, data: function( elem, name, data ) { elem = elem == window ? windowData : elem; var id = elem[ expando ]; // Compute a unique ID for the element if ( !id ) id = elem[ expando ] = ++uuid; // Only generate the data cache if we're // trying to access or manipulate it if ( name && !jQuery.cache[ id ] ) jQuery.cache[ id ] = {}; // Prevent overriding the named cache with undefined values if ( data != undefined ) jQuery.cache[ id ][ name ] = data; // Return the named cache data, or the ID for the element return name ? jQuery.cache[ id ][ name ] : id; }, removeData: function( elem, name ) { elem = elem == window ? windowData : elem; var id = elem[ expando ]; // If we want to remove a specific section of the element's data if ( name ) { if ( jQuery.cache[ id ] ) { // Remove the section of cache data delete jQuery.cache[ id ][ name ]; // If we've removed all the data, remove the element's cache name = ""; for ( name in jQuery.cache[ id ] ) break; if ( !name ) jQuery.removeData( elem ); } // Otherwise, we want to remove all of the element's data } else { // Clean up the element expando try { delete elem[ expando ]; } catch(e){ // IE has trouble directly removing the expando // but it's ok with using removeAttribute if ( elem.removeAttribute ) elem.removeAttribute( expando ); } // Completely remove the data cache delete jQuery.cache[ id ]; } }, // args is for internal usage only each: function( object, callback, args ) { if ( args ) { if ( object.length == undefined ) for ( var name in object ) callback.apply( object[ name ], args ); else for ( var i = 0, length = object.length; i < length; i++ ) if ( callback.apply( object[ i ], args ) === false ) break; // A special, fast, case for the most common use of each } else { if ( object.length == undefined ) for ( var name in object ) callback.call( object[ name ], name, object[ name ] ); else for ( var i = 0, length = object.length, value = object[0]; i < length && callback.call( value, i, value ) !== false; value = object[++i] ){} } return object; }, prop: function( elem, value, type, i, name ) { // Handle executable functions if ( jQuery.isFunction( value ) ) value = value.call( elem, i ); // Handle passing in a number to a CSS property return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ? value + "px" : value; }, className: { // internal only, use addClass("class") add: function( elem, classNames ) { jQuery.each((classNames || "").split(/\s+/), function(i, className){ if ( !jQuery.className.has( elem.className, className ) ) elem.className += (elem.className ? " " : "") + className; }); }, // internal only, use removeClass("class") remove: function( elem, classNames ) { elem.className = classNames != undefined ? jQuery.grep(elem.className.split(/\s+/), function(className){ return !jQuery.className.has( classNames, className ); }).join(" ") : ""; }, // internal only, use is(".class") has: function( elem, className ) { return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) > -1; } }, // A method for quickly swapping in/out CSS properties to get correct calculations swap: function( elem, options, callback ) { // Remember the old values, and insert the new ones for ( var name in options ) { elem.style[ "old" + name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } callback.call( elem ); // Revert the old values for ( var name in options ) elem.style[ name ] = elem.style[ "old" + name ]; }, css: function( elem, name ) { if ( name == "height" || name == "width" ) { var old = {}, height, width; // Revert the padding and border widths to get the // correct height/width values jQuery.each([ "Top", "Bottom", "Right", "Left" ], function(){ old[ "padding" + this ] = 0; old[ "border" + this + "Width" ] = 0; }); // Swap out the padding/border values temporarily jQuery.swap( elem, old, function() { // If the element is visible, then the calculation is easy if ( jQuery( elem ).is(":visible") ) { height = elem.offsetHeight; width = elem.offsetWidth; // Otherwise, we need to flip out more values } else { elem = jQuery( elem.cloneNode(true) ) .find(":radio").removeAttr("checked").removeAttr("defaultChecked").end() .css({ visibility: "hidden", position: "absolute", display: "block", right: "0", left: "0" }).appendTo( elem.parentNode )[0]; var position = jQuery.css( elem.parentNode, "position" ) || "static"; if ( position == "static" ) elem.parentNode.style.position = "relative"; height = elem.clientHeight; width = elem.clientWidth; if ( position == "static" ) elem.parentNode.style.position = "static"; elem.parentNode.removeChild( elem ); } }); return name == "height" ? height : width; } return jQuery.curCSS( elem, name ); }, curCSS: function( elem, name, force ) { var ret; // A helper method for determining if an element's values are broken function color( elem ) { if ( !jQuery.browser.safari ) return false; var ret = document.defaultView.getComputedStyle( elem, null ); return !ret || ret.getPropertyValue("color") == ""; } // We need to handle opacity special in IE if ( name == "opacity" && jQuery.browser.msie ) { ret = jQuery.attr( elem.style, "opacity" ); return ret == "" ? "1" : ret; } // Make sure we're using the right name for getting the float value if ( name.match( /float/i ) ) name = styleFloat; if ( !force && elem.style[ name ] ) ret = elem.style[ name ]; else if ( document.defaultView && document.defaultView.getComputedStyle ) { // Only "float" is needed here if ( name.match( /float/i ) ) name = "float"; name = name.replace( /([A-Z])/g, "-$1" ).toLowerCase(); var getComputedStyle = document.defaultView.getComputedStyle( elem, null ); if ( getComputedStyle && !color( elem ) ) ret = getComputedStyle.getPropertyValue( name ); // If the element isn't reporting its values properly in Safari // then some display: none elements are involved else { var swap = [], stack = []; // Locate all of the parent display: none elements for ( var a = elem; a && color(a); a = a.parentNode ) stack.unshift(a); // Go through and make them visible, but in reverse // (It would be better if we knew the exact display type that they had) for ( var i = 0; i < stack.length; i++ ) if ( color( stack[ i ] ) ) { swap[ i ] = stack[ i ].style.display; stack[ i ].style.display = "block"; } // Since we flip the display style, we have to handle that // one special, otherwise get the value ret = name == "display" && swap[ stack.length - 1 ] != null ? "none" : ( getComputedStyle && getComputedStyle.getPropertyValue( name ) ) || ""; // Finally, revert the display styles back for ( var i = 0; i < swap.length; i++ ) if ( swap[ i ] != null ) stack[ i ].style.display = swap[ i ]; } // We should always get a number back from opacity if ( name == "opacity" && ret == "" ) ret = "1"; } else if ( elem.currentStyle ) { var camelCase = name.replace(/\-(\w)/g, function(all, letter){ return letter.toUpperCase(); }); ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ]; // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels if ( !/^\d+(px)?$/i.test( ret ) && /^\d/.test( ret ) ) { // Remember the original values var style = elem.style.left, runtimeStyle = elem.runtimeStyle.left; // Put in the new values to get a computed value out elem.runtimeStyle.left = elem.currentStyle.left; elem.style.left = ret || 0; ret = elem.style.pixelLeft + "px"; // Revert the changed values elem.style.left = style; elem.runtimeStyle.left = runtimeStyle; } } return ret; }, clean: function( elems, context ) { var ret = []; context = context || document; jQuery.each(elems, function(i, elem){ if ( !elem ) return; if ( elem.constructor == Number ) elem = elem.toString(); // Convert html string into DOM nodes if ( typeof elem == "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area)$/i) ? all : front + ">"; }); // Trim whitespace, otherwise indexOf won't work as expected var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div"); var wrap = // option or optgroup !tags.indexOf("", "" ] || !tags.indexOf("", "" ] || tags.match(/^<(thead|tbody|tfoot|colg|cap)/) && [ 1, "", "
" ] || !tags.indexOf("", "" ] || // matched above (!tags.indexOf("", "" ] || !tags.indexOf("", "" ] || // IE can't serialize and