function doAuthorPopup(authorid,url) {
	var params = 'AuthorPopupAction=POPUP';
	    params = params + '&authorid=' + authorid;

	var options = {
		method:'post',
		postBody: params,
		asynchronous: false,
		onSuccess: function(t) {
			if (t.responseText == 'ERROR') {
//			    fixedtooltip(t.responseText, obj, e, tipwidth);
			    return false;
                
			} else {
			    $('authorcontent').innerHTML = t.responseText;
//				fixedtooltip(t.responseText, obj, e, tipwidth);
			}
		},
		onFailure: function(t) {
//		    fixedtooltip(t.responseText, obj, e, tipwidth);
			return false;
            
		}
	};
	
	new Ajax.Request(url,options);
}

function getIEVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
var IsValidBrowser = false;
if ((getIEVersion() > 6) || (getIEVersion()==-1)) { IsValidBrowser = true;}


function accordionSwitch(myid, imageDiv, imageSrc, url) {
    if (myid.parentNode.parentNode.className.indexOf("HeaderSelected")> 0) {
        window.location = url;
    } else {
        imageDiv.src=imageSrc.src;
        imageDiv.alt=imageSrc.alt;
        return false;
    }
}

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.userAgent,
			subString: "Chrome",
			identity: "Chrome"
		},
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari",
			versionSearch: "Version"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			   string: navigator.userAgent,
			   subString: "iPhone",
			   identity: "iPhone/iPod"
	    },
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

function popUp(URL,W,H,X,Y){
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=1,width=" + W + ",height=" + H + ",left=" + X + ",top=" + Y + "');");
}

/***********************************************
* Fixed ToolTip script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
	
var tipwidth='350px' //default tooltip width
var tipbgcolor='transparent'  //tooltip bgcolor
var disappeardelay=250  //tooltip disappear speed onMouseout (in miliseconds)
var vertical_offset="0px" //horizontal offset of tooltip from anchor link
var horizontal_offset="-3px" //horizontal offset of tooltip from anchor link

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="fixedtipdiv" style="visibility:hidden;width:'+tipwidth+';background-color:'+tipbgcolor+'" ></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}


function showhide(obj, e, visible, hidden, tipwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (tipwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=tipwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
}
return edgeoffset
}

function fixedtooltip(contentdiv, obj, e, tipwidth){
    var menucontents = $('authorcontent').innerHTML;
    if (window.event) event.cancelBubble=true
    else if (e.stopPropagation) e.stopPropagation()
    clearhidetip()
    dropmenuobj=document.getElementById? document.getElementById("fixedtipdiv") : fixedtipdiv
    dropmenuobj.innerHTML=menucontents

    if (ie4||ns6){
        showhide(dropmenuobj.style, e, "visible", "hidden", tipwidth)
        dropmenuobj.x=getposOffset(obj, "left")
        dropmenuobj.y=getposOffset(obj, "top")
        dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
        dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
    }
}

function hidetip(e){
    if (typeof dropmenuobj!="undefined"){
        if (ie4||ns6)
            dropmenuobj.style.visibility="hidden"
    }
}

function delayhidetip(){
    if (ie4||ns6)
        delayhide=setTimeout("hidetip()",disappeardelay)
}

function clearhidetip(){
    if (typeof delayhide!="undefined")
        clearTimeout(delayhide)
}


//Most Read Pagination
function pagination(rows,classNormal,classSelected) {
	var element = $("pageNavPosition");
	var pagerName = "pager"
	var pagerHtml = '';
	
	for (var page = 1; page <= rows; page++) {
            pagerHtml += '<span style="cursor:hand;" id="pg' + page + '" class="' + classNormal + '" onclick="' + pagerName + '.showPage(' + page + ');">' + page + '</span> ';
	}
	element.innerHTML = pagerHtml;
	
	this.showPage = function(pageNum) {
		for (var i = 1; i <= rows; i++) {
			if (i == pageNum) {
			$(i+'').style.display = ""
			$('pg' + i).className = classSelected;
			}
			else
			{
			$(i+'').style.display = "none"
			$('pg' + i).className = classNormal;
			}
		
		}
	}
			
}

//Gallery Pagination
function pagination2(rows,name,className,imgHighlighted,imgNonHighlighted,imgPrev,imgNext) {
	var currentPage = 1;
	var navHtml = '';

    var highlightImg = new Image();
    var nonHighlightImg = new Image();
    
    highlightImg.src = imgHighlighted;
    nonHighlightImg.src = imgNonHighlighted;
    
    if (rows > 0) {
	navHtml = '<span onclick="' + name + '.prev();"><div class="'+className+'">' + imgPrev + '</div></span>';
	for (var page = 1; page <= rows; page++) {			
            navHtml += '<span id="pg' + name + page + '" onclick="' + name + '.showPages(' + page + ');"><div class="'+className+'"><img id="pagin' + name + page + '" src="/App_Themes/Default/images/buttons/galleryFilledDot.jpg" /></div></span>';
	}
	navHtml += '<span onclick="' + name + '.next();"><div class="'+className+'">' + imgNext + '</div></span>';
	$("NavPosition" + name).innerHTML = navHtml;
	}
	
    this.showPages = function(pageNum) {
		for (var i = 1; i <= rows; i++) {
			if (i == pageNum) {
			    $(name + i + '').style.display = "";
			    $('pagin' + name + i).src = highlightImg.src;
			    this.currentPage = i;
			}
			else
			{
			    $(name + i + '').style.display = "none";     //<div id="UGCPhoto1" > content </div>
			    $('pagin' + name + i).src = nonHighlightImg.src;
			}
		}
	}
	this.prev = function() {
        if (this.currentPage > 1) {
            this.showPages(this.currentPage - 1);
        }
    }
    this.next = function() {
        if (this.currentPage < rows) {
            this.showPages(this.currentPage + 1);
        }
    } 			
}

function fnPDFSection(name,arrPDF,arrPDFSection,maxPageNo,maxAMPDFSection) {
	var menuwidth = '620'
    var pdfMenuHtml = '';
	var pdfMenuTemp = '';
	var goleftimage="/App_Themes/Default/images/buttons/blogsArrowMenuLeft.jpg";
	var gorightimage="/App_Themes/Default/images/buttons/blogsArrowMenuRight.jpg";
	var leftdircode=' onMouseover="' + name + '.moveleft();" onMouseout="clearTimeout(lefttime);"';
	var rightdircode=' onMouseover="' + name + '.moveright();" onMouseout="clearTimeout(lefttime);"';
	var thispage=0;
	var leftsidecode = '';
	var rightsidecode = '';
	var menuheight=25;
	var cross_scroll;
	var loadedyes=false;
    this.currPageNo = 0;
	var scrollspeed=6;
	this.currPageNo = 0;
	leftsidecode = '<table cellspacing="0" cellpadding="0" border="0"><tr><td valign="middle"><a href="#" ' + rightdircode + '><img src="' + goleftimage + '" border="0" /></a></td><td width="' + menuwidth + '" valign="top"><div style="position:relative;width:' + menuwidth + 'px;height:' + menuheight + 'px;overflow:hidden;"><div id="' + name + 'ShowMenu" style="position:absolute;left:0;top:5px;"><nobr>'
	rightsidecode = '</nobr></div></div></td><td valign="middle"><a href="#" ' + leftdircode + '><img src="' + gorightimage + '" border="0"/></a></td></tr></table>';

        
    this.fillMenu = function(keyword) {
		//alert("here");
        pdfMenuHtml = '';
		pdfMenuTemp = '';
		//alert("here again");
		
        for (i=0; i <= maxAMPDFSection; i++) {
			//alert(i);
            if (keyword == arrPDFSection[i][0]) {
				//alert(keyword);
                pdfMenuHtml += '<div id="pg' + name + arrPDFSection[i][1] + '" class="items" onclick="passSubCategory(\''+ arrPDFSection[i][0] +'\');' + name + '.gotoPage(' + arrPDFSection[i][1] + ')"><b>' + arrPDFSection[i][2] + '</b></div>';
				pdfMenuTemp += '<div class="items"><b>' + arrPDFSection[i][2] + '</b></div>';
				this.currPageNo = (arrPDFSection[i][1] - 0);
            }
            else
            {
                //pdfMenuHtml += '<div id="pg' + name + arrPDFSection[i][1] + '" class="items" onclick="' + name + '.gotoPage(' + arrPDFSection[i][1] + ')">' + arrPDFSection[i][0] + '</div>';
				pdfMenuHtml += '<div id="pg' + name + arrPDFSection[i][1] + '" class="items" onclick="passSubCategory(\''+ arrPDFSection[i][0] +'\');' + name + '.gotoPage(' + arrPDFSection[i][1] + ')">' + arrPDFSection[i][2] + '</div>';
				pdfMenuTemp += '<div class="items">' + arrPDFSection[i][2] + '</div>';
            } 
        }
		//alert($("navmenutemp" + name).innerHTML);
		$("navmenutemp" + name).innerHTML = pdfMenuTemp;
		//alert($("navmenutemp" + name).innerHTML);
		//alert("here");
		$("navmenu" + name).innerHTML = pdfMenuHtml;
		
		
		this.actualwidth = $("navmenutemp" + name).offsetWidth;
		this.checkMenu(pdfMenuHtml);
		//$("navmenutemp" + name).style.display = "none";
		this.onloadGoto(this.currPageNo);
		//$("navmenutemp" + name).style.display = "none";
		
    }
    this.onloadGoto = function(gotoPageNo) {
   
		for (j=0; j <= maxAMPDFSection; j++) {
			//alert(arrPDFSection[j][0] + ' - ' + arrPDF[gotoPageNo][0]);
			if (arrPDFSection[j][0] == arrPDF[gotoPageNo][0]) {
				$('pg' + name + arrPDFSection[j][1]).innerHTML='<b>' + arrPDFSection[j][2] + '</b>';
				//alert('what is happening here ' + gotoPageNo);
			}
			else {
				$('pg' + name + arrPDFSection[j][1]).innerHTML= arrPDFSection[j][2];
			}
		}

		$(name + 'Images').src = arrPDF[gotoPageNo - 0][2];
		//$(name + 'Images').setAttribute('OnClientClick', omniTrack(arrPDF[gotoPageNo - 0][1]));
		//alert(arrPDF[gotoPageNo - 0][1]);
		$(name + 'URL').setAttribute('href',arrPDF[gotoPageNo - 0][1]);
		if($('ctl00_cph1_PDFSelection1_hidUrl')!= null)
		    $('ctl00_cph1_PDFSelection1_hidUrl').value = arrPDF[gotoPageNo - 0][4];
		$(name + 'URL').setAttribute('target','_blank');
        
        this.currPageNo = gotoPageNo;
        
    }
	
	this.gotoPage = function(gotoPageNo) {
  
		for (j=0; j <= maxAMPDFSection; j++) {
			//alert(arrPDFSection[j][0] + ' - ' + arrPDF[gotoPageNo][0]);
			if (arrPDFSection[j][0] == arrPDF[gotoPageNo][0]) {
				$('pg' + name + arrPDFSection[j][1]).innerHTML='<b>' + arrPDFSection[j][2] + '</b>';
				//alert('what is happening here ' + gotoPageNo);
			}
			else {
				$('pg' + name + arrPDFSection[j][1]).innerHTML= arrPDFSection[j][2];
			}
		}
		


		$(name + 'Images').src = arrPDF[gotoPageNo - 0][2];
		$(name + 'URL').setAttribute('href',arrPDF[gotoPageNo - 0][1]);
		if($('ctl00_cph1_PDFSelection1_hidUrl')!= null)
		    $('ctl00_cph1_PDFSelection1_hidUrl').value =arrPDF[gotoPageNo - 0][4];
		$(name + 'URL').setAttribute('target','_blank');
        
        this.currPageNo = gotoPageNo;
        
    }	
	
	this.checkMenu = function(pdfMenuHtml) {
		
		//alert(name + ' width ' + $("navmenu" + name).offsetWidth + ' and ' + menuwidth);
		if (this.actualwidth > menuwidth) {
			$("navmenu" + name).innerHTML = " " + leftsidecode + pdfMenuHtml + rightsidecode;
			//alert($("navmenu" + name).innerHTML);
			//$("navmenutemp" + name).style.display = "none";
			loadedyes=true;
		}
		else
		{
			$("navmenu" + name).innerHTML = " " + pdfMenuHtml;
			//alert($("navmenu" + name).innerHTML);
			//$("navmenutemp" + name).style.display = "none";
		}
		
	} 

    
    this.onNext = function() {
        if (this.currPageNo < maxPageNo) {
            this.currPageNo = this.currPageNo + 1;
			//alert('next ' + this.currPageNo);
            $(name + 'Images').src = arrPDF[this.currPageNo][2];
            $(name + 'URL').setAttribute('href',arrPDF[this.currPageNo][1]);
            if($('ctl00_cph1_PDFSelection1_hidUrl')!= null)
                $('ctl00_cph1_PDFSelection1_hidUrl').value =arrPDF[this.currPageNo][4];
            $(name + 'URL').setAttribute('target','_blank');
            //this.fillMenu(arrPDF[this.currPageNo][0]);
			this.gotoPage(this.currPageNo);
			passSubCategory(arrPDF[this.currPageNo][0]);

        } else {
            this.currPageNo = 0;
            $(name + 'Images').src = arrPDF[this.currPageNo][2];
            $(name + 'URL').setAttribute('href',arrPDF[this.currPageNo][1]);
            if($('ctl00_cph1_PDFSelection1_hidUrl')!= null)
                $('ctl00_cph1_PDFSelection1_hidUrl').value =arrPDF[this.currPageNo][4];
            $(name + 'URL').setAttribute('target','_blank');
            //this.fillMenu(arrPDF[this.currPageNo][0]);
			this.gotoPage(this.currPageNo);
			passSubCategory(arrPDF[this.currPageNo][0]);
            
        }
        //fnRefreshAds('IframeRightColumnAd1');
        //fnRefreshAds('IframeRightColumnAd2');
        RightColumnAd1_RefreshAd();
        RightColumnAd2_RefreshAd();
        HeaderAd_RefreshAd();
        //fnRefreshAds('IframeHeaderAd');
        //fnRefreshDCAd(topAds,'divHeaderDoubleClickAd');
    }
    
    this.onPrev = function() {
        if (this.currPageNo > 0) {
            this.currPageNo = this.currPageNo - 1;
			//alert('prev ' + this.currPageNo);
            $(name + 'Images').src = arrPDF[this.currPageNo][2];
            $(name + 'URL').setAttribute('href',arrPDF[this.currPageNo][1]);
            if($('ctl00_cph1_PDFSelection1_hidUrl')!= null)
                $('ctl00_cph1_PDFSelection1_hidUrl').value =arrPDF[this.currPageNo][4];
            $(name + 'URL').setAttribute('target','_blank');
            //this.fillMenu(arrPDF[this.currPageNo][0]);
			this.gotoPage(this.currPageNo);
			passSubCategory(arrPDF[this.currPageNo][0]);
        } else {
            this.currPageNo = maxPageNo;
			//alert('prev ' + this.currPageNo);
            $(name + 'Images').src = arrPDF[this.currPageNo][2];
            $(name + 'URL').setAttribute('href',arrPDF[this.currPageNo][1]);
            if($('ctl00_cph1_PDFSelection1_hidUrl')!= null)
                $('ctl00_cph1_PDFSelection1_hidUrl').value =arrPDF[this.currPageNo][4];
            $(name + 'URL').setAttribute('target','_blank');
            //this.fillMenu(arrPDF[this.currPageNo][0]);
			this.gotoPage(this.currPageNo);
			passSubCategory(arrPDF[this.currPageNo][0]);
        
        }
        //fnRefreshAds('IframeRightColumnAd1');
        //fnRefreshAds('IframeRightColumnAd2');
        RightColumnAd1_RefreshAd();
        RightColumnAd2_RefreshAd();
        HeaderAd_RefreshAd();
        //fnRefreshAds('IframeHeaderAd');
        //fnRefreshDCAd(topAds,'divHeaderDoubleClickAd');
    }
	
	this.moveleft = function(){
		cross_scroll=$(name + "ShowMenu");
		if (loadedyes){
			if (parseInt($(name + "ShowMenu").style.left)>(menuwidth - this.actualwidth)){
				$(name + "ShowMenu").style.left=parseInt($(name + "ShowMenu").style.left)-scrollspeed+"px"
			}
		}
		lefttime=setTimeout(name + ".moveleft()",50)
	}

	this.moveright = function(){
		cross_scroll=$(name + "ShowMenu");
		if (loadedyes){
			if (parseInt($(name + "ShowMenu").style.left)<0)
				$(name + "ShowMenu").style.left=parseInt($(name + "ShowMenu").style.left)+scrollspeed+"px"
		}
		lefttime=setTimeout(name + ".moveright()",50)
	}
}

function fnRefreshAds(iFrameAd)
{
    if($(iFrameAd)){
      // $get(iFrameAd).src = $get(iFrameAd).src;
      $(iFrameAd).src = $(iFrameAd).src;
    }
}

function fnRefreshDCAd(dcAds,divAdId) 
{
   if(document.getElementById(divAdId)){
     if(dcAds){ 
         var ad = document.getElementById(divAdId);
         doubleClickOrd = Math.floor(Math.random()*1E16);
			
         url = "mc.todayonline.com/" + dcAds.page + ";sect=" + dcAds.page + ";pos=" + dcAds.pos + ";tile=" + dcAds.tile + ";sz=" + dcAds.width + "x" + dcAds.height + ";ord=" + doubleClickOrd + "?";
         var str = '<iframe src="http://ad.sg.doubleclick.net/adi/' + url + '" width="' + dcAds.width + '" height="' + dcAds.height + '" marginwidth="0" marginheight="0" frameborder="0" scrolling="no">';
         if (navigator.userAgent.indexOf("Gecko")==-1)
            str += '<script language="JavaScript" src="http://ad.sg.doubleclick.net/adj/' + url + '" type="text/javascript"><\/script>';
         str += '</iframe>';
         ad.innerHTML = str;
     }
   }
}

function fnSLPDFSection(name,arrPDFSection,maxPageNo,maxPDFSection) {
	var menuwidth = '900';
    var pdfMenuHtml = '';
	var pdfMenuTemp = '';
	var goleftimage="/App_Themes/Default/images/buttons/blogsArrowMenuLeft.jpg";
	var gorightimage="/App_Themes/Default/images/buttons/blogsArrowMenuRight.jpg";
	var leftdircode=' onMouseover="' + name + '.moveleft();" onMouseout="clearTimeout(lefttime);"';
	var rightdircode=' onMouseover="' + name + '.moveright();" onMouseout="clearTimeout(lefttime);"';
	var thispage=0;
	var leftsidecode = '';
	var rightsidecode = '';
	var menuheight=25;
	var cross_scroll;
	var loadedyes=false;
    this.currPageNo = 0;
	var scrollspeed=6;
	this.currPageNo = 0;
	leftsidecode = '<table cellspacing="0" cellpadding="0" border="0"><tr><td valign="middle"><a href="#" ' + rightdircode + '><img src="' + goleftimage + '" border="0" /></a></td><td width="' + (menuwidth + 90) + 'px" valign="top"><div style="position:relative;width:' + menuwidth + 'px;height:' + menuheight + 'px;overflow:hidden;"><div id="' + name + 'ShowMenu" style="position:absolute;left:0;top:0;"><nobr>'
	rightsidecode = '</nobr></div></div></td><td valign="middle"><a href="#" ' + leftdircode + '><img src="' + gorightimage + '" border="0"/></a></td></tr></table>';
    
    this.fillMenu = function(keyword) {
		//alert("here");
        pdfMenuHtml = '';
		pdfMenuTemp = '';
		//alert("here again");
        for (i=0; i <= maxPDFSection; i++) {
			//alert(i);
            if (keyword == arrPDFSection[i][0]) {
				//alert(keyword);
                pdfMenuHtml += '<div id="pg' + name + arrPDFSection[i][1] + '" class="items" onclick="JumpToSection(\'' + arrPDFSection[i][0] + '\')"><b>' + arrPDFSection[i][2] + '</b></strong></div>';
				pdfMenuTemp += '<div class="items"><b>' + arrPDFSection[i][2] + '</b></div>';
				this.currPageNo = (arrPDFSection[i][1] - 0);
            }
            else
            {
                //pdfMenuHtml += '<div id="pg' + name + arrPDFSection[i][1] + '" class="items" onclick="' + name + '.gotoPage(' + arrPDFSection[i][1] + ')">' + arrPDFSection[i][0] + '</div>';
				pdfMenuHtml += '<div id="pg' + name + arrPDFSection[i][1] + '" class="items" onclick="JumpToSection(\'' + arrPDFSection[i][0] + '\')">' + arrPDFSection[i][2] + '</div>';
				pdfMenuTemp += '<div class="items">' + arrPDFSection[i][2] + '</div>';
            } 
        }
		//alert($("navmenutemp" + name).innerHTML);
		$("navmenutemp" + name).innerHTML = pdfMenuTemp;
		//alert($("navmenutemp" + name).innerHTML);
		//alert("here");
		$("navmenu" + name).innerHTML = pdfMenuHtml;
		
		
		this.actualwidth = $("navmenutemp" + name).offsetWidth;
		this.checkMenu(pdfMenuHtml);
		//$("navmenutemp" + name).style.display = "none";
		this.gotoPage(keyword);
		//$("navmenutemp" + name).style.display = "none";
		
    }
	
	this.gotoPage = function(currKeyword) {
		for (j=0; j <= maxPDFSection; j++) {
			//alert(arrPDFSection[j][0] + ' - ' + arrPDF[gotoPageNo][0]);
			if (arrPDFSection[j][0] == currKeyword) {
				$('pg' + name + arrPDFSection[j][1]).innerHTML='<b>' + arrPDFSection[j][2] + '</b>';
				//alert('what is happening here ' + gotoPageNo);
			}
			else {
				$('pg' + name + arrPDFSection[j][1]).innerHTML= arrPDFSection[j][2];
			}
		}
		
		$(name + 'CurrentMenu').innerHTML = currKeyword;
//		JumpToSection(currKeyword);
    }	
	
	this.checkMenu = function(pdfMenuHtml) {
		
		//alert(name + ' width ' + $("navmenu" + name).offsetWidth + ' and ' + menuwidth);
		if (this.actualwidth > menuwidth) {
			$("navmenu" + name).innerHTML = " " + leftsidecode + pdfMenuHtml + rightsidecode;
			//alert($("navmenu" + name).innerHTML);
			//$("navmenutemp" + name).style.display = "none";
			loadedyes=true;
		}
		else
		{
			$("navmenu" + name).innerHTML = " " + pdfMenuHtml;
			//alert($("navmenu" + name).innerHTML);
			//$("navmenutemp" + name).style.display = "none";
		}
	} 
	
	this.moveleft = function(){
		cross_scroll=$(name + "ShowMenu");
		if (loadedyes){
			if (parseInt($(name + "ShowMenu").style.left)>(menuwidth - this.actualwidth)){
				$(name + "ShowMenu").style.left=parseInt($(name + "ShowMenu").style.left)-scrollspeed+"px"
			}
		}
		lefttime=setTimeout(name + ".moveleft()",50)
	}

	this.moveright = function(){
		cross_scroll=$(name + "ShowMenu");
		if (loadedyes){
			if (parseInt($(name + "ShowMenu").style.left)<0)
				$(name + "ShowMenu").style.left=parseInt($(name + "ShowMenu").style.left)+scrollspeed+"px"
		}
		lefttime=setTimeout(name + ".moveright()",50)
	}
}


function LimitText(fieldId, lblCountId, lblMaxCountId, lblCharId, maxchar, defaultText) {
    var txtField = $(fieldId);
    var lblCount = $(lblCountId);
    var lblMaxCount = $(lblMaxCountId);
    var lblChar = $(lblCharId);
    
    if(txtField) {
        if(txtField.value.strip() == defaultText) {
            if(lblCount) {
                lblCount.innerHTML = maxchar;
            }
            
            if(lblMaxCount) {
                lblMaxCount.style.visibility = 'hidden';
            }
            
            if(lblChar) {
                lblChar.innerHTML = 's';
            }
        }
        else {
            if(txtField.value.length > maxchar) {
                txtField.value = txtField.value.substring(0, maxchar);
            }

            if(lblCount) {
                lblCount.innerHTML = txtField.value.length;
            }
            
            if(lblMaxCount) {
                if(txtField.value.length >= maxchar) {
                    lblMaxCount.style.visibility = 'visible';
                }
                else {
                    lblMaxCount.style.visibility = 'hidden';
                }
            }
            
            if(lblChar) {
                if(txtField.value.length > 1) {
                    lblChar.innerHTML = 's';
                }
                else {
                    lblChar.innerHTML = '';
                }
            }
        }
    }
}
        
function BlockEnterKey(fn, e) {
    var characterCode;

    if(e && e.which) {
        try {
            e = e;
            characterCode = e.which;
        }
        catch(Error) {
            return true;
        }
    }
    else {
        try {
            if(event) {
                e = event;
                characterCode = e.keyCode;
            }
        }
        catch(Error) {
            return true;
        }
    }

    if(e && characterCode == 13) {
        if(fn != '') {
            eval(fn);
        }
        
        return false;
    }
    else {
        return true;
    }
}

function HideElement() {
    var target_element = $(g_element);
    
    if(target_element) {
        target_element.setStyle({display:'none'});
    }
}

function ShowElement() {
    var target_element = $(g_element);
    
    if(target_element) {
        target_element.setStyle({display:'block'});
    }
}

function ClearDefaultText(targetId, defaultText) {
    var target_element = $(targetId);
    
    if(target_element) {
        if(target_element.value.strip() == defaultText) {
            target_element.value = '';
            //target_element.setStyle({color:'#000000'});
        }
        else {
            target_element.select();
        }
    }
}

function SetDefaultText(targetId, defaultText) {
    var target_element = $(targetId);
    
    if(target_element) {
        if(target_element.value.strip() == '') {
            target_element.value = defaultText;
            target_element.setStyle({color:''});
        }
    }
}

function ClearPWDefaultText(targetId, defaultText) {
    var target_element = $(targetId);
    
    if(target_element) {
        if(target_element.value.strip() == defaultText) {
            target_element.value = '';
            targat_element.type = 'password';
            target_element.setStyle({color:'#000000'});
        }
        else {
            target_element.select();
        }
    }
}

function SetPWDefaultText(targetId, defaultText) {
    var target_element = $(targetId);
    
    if(target_element) {
        if(target_element.value.strip() == '') {
            target_element.type = 'text';
            target_element.value = defaultText;
            target_element.setStyle({color:''});
        }
    }
}

function ForwardButtonFocus() {
    var target_element = $('cbxEmailMyself');
    
    if(target_element) {
        try {
            target_element.focus();
        }
        catch(Error) {
        }
    }
}

function doShow() {
            //            Modalbox.show('<div class=\'warning\'><p>Are you sure to delete this item?</p> ' +
            //'<input type=\'button\' value=\'Yes, delete!\' onclick=\'Modalbox.hide()\' /> or <input type=\'button\' ' +
            //'value=\'No, leave it!\' onclick=\'Modalbox.hide()\' /></div>', { title: this.title, width: 300 });
            //        }
            Modalbox.show('<div  id="popupHolder" onblur="Modalbox.hide()"><div class="titlelb"><div class="titlerb"><div class="titletl"><div class="titletr">' +
  '<div class="Text">&nbsp;Your content has been submitted. Thank you!</div>' +
  '</div></div></div></div>' +
  '</div>', { width: 680, closeString:"Close", title: '<div id="Title">Content Submission</div>' });
        }