function loadurl(dest,iid,sub_id) { createCookie('content_id',dest,0); createCookie('item_id',iid,0); document.getElementById("hiddentabID").value = dest; try { // Moz supports XMLHttpRequest. IE uses ActiveX. // browser detction is bad. object detection works for any browser xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp2 = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP"); //if(browser == "Microsoft Internet Explorer") // { // xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // } // else // { // xmlhttp = new XMLHttpRequest(); // } } catch (e) { // browser doesn't support ajax. handle however you want alert("Sorry, but your browser doesn't seem to support AJAX...Please upgrade to a modern browser like Internet Explorer 6.0"); } // the xmlhttp object triggers an event everytime the status changes // triggered() function handles the events xmlhttp.onreadystatechange = triggered; xmlhttp2.onreadystatechange = getresult; // Now, create the link for the content item using the passed tabid. if (sub_id == "0") { link = 'index.php?option=com_content&task=view&id=' + dest + '&Itemid=' + iid; } else { link = 'index.php?option=com_content&task=view&id=' + sub_id + '&Itemid=' + iid; } // open takes in the HTTP method and url(our link). link=link + '&caller=ajax'; xmlhttp.open("GET", link); // xmlhttp2.open("GET", link2); // send the request. if this is a POST request we would have // sent post variables: send("name=aleem&gender=male) // Moz is fine with just send(); but // IE expects a value here, hence we do send(null); xmlhttp.send(null); //xmlhttp2.send(null); } function getresult() { if ((xmlhttp2.readyState == 4) && (xmlhttp2.status == 200)) { document.title = xmlhttp2.responseText; } else { document.title = 'loading... '; } } function triggered() { // if the readyState code is 4 (Completed) // and http status is 200 (OK) we go ahead and get the responseText // other readyState codes: // 0=Uninitialised 1=Loading 2=Loaded 3=Interactive if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) { // xmlhttp.responseText object contains the response. //document.write(xmlhttp.responseText); var texttoDisplay= xmlhttp.responseText; document.getElementById("div_submenu_intro").innerHTML = texttoDisplay; var label = document.getElementById('diviconlabel'); var charFrom = texttoDisplay.indexOf(''); var charEnd = texttoDisplay.indexOf(''); if (label != null){ texttoDisplay = texttoDisplay.substring(charFrom + 8,charEnd); if (texttoDisplay=="Why RAK Airport?"){texttoDisplay= "Home";} label.innerHTML="" + texttoDisplay + ""; var l = texttoDisplay.length; var adj = 6 - l ; var pixelAdj = parseInt(adj) * 1; // center var textcurleftpos = label.style.left; var l = texttoDisplay.length; var adj = 6 - l ; var pixelAdj = parseInt(adj) * 1; label.style.left=(parseInt(textcurleftpos) + parseInt(pixelAdj)) + 'px'; } } // if the readyState code is NOT 4 (loading is incomplete) then show an image (*.gif) preloader. else { // loading... var label = document.getElementById('diviconlabel'); label.innerHTML="" + 'loading...' + ""; // document.getElementById("div_submenu_intro").innerHTML = "
