function switcharticles(no) { for(i=1;i<=6;i++) { var th =document.getElementById("tabhead"+i).style; if(no==i) { document.getElementById("spotdescdata"+i).style.display="inline"; th.backgroundImage = 'url(/images/nav_focus'+i+'.gif)'; th.borderRightWidth = "0px"; document.getElementById("toptitle"+i).style.display="inline"; document.getElementById("td"+i).style.border="1"; } else { document.getElementById("spotdescdata"+i).style.display="none"; document.getElementById("toptitle"+i).style.display="none"; document.getElementById("td"+i).style.border="0"; th.backgroundImage = 'url(/images/bg_spotlightnav.jpg)'; th.borderRightWidth = "1px"; } } } function selectRandomArticle() { var rnd_no = Math.round((6)*Math.random()); if (rnd_no == 0) { rnd_no = 1; } switcharticles(rnd_no); } function cleantext() { if(document.forms['subs'].email.value=="Enter your Email") { document.forms['subs'].email.value=""; } } function callsubscription(e,a) { var subid=""; for(i=0;i < a.length;i++) { if(a[i].checked==true) { subid+=a[i].value +","; } } subid=subid.substring(0,subid.length-1); var url="/nasscom/templates/ajaxsubscription.aspx?subid=" + subid +"&email="+ e; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } req.onreadystatechange = processRequestsubs; req.open("GET", url, true); req.send(null); } function processRequestsubs() { if (req.readyState == 4) { if (req.status == 200) { parseMessagessubs(); } } } function parseMessagessubs() { response = req.responseXML.documentElement; usr=response.getElementsByTagName('status')[0].getAttribute("user"); //if(usr=="existing") //{ // window.location.href="/"; //} itemDescription = response.getElementsByTagName('status')[0].getAttribute("msg"); document.getElementById('subsmsg').innerHTML=itemDescription; } function hidebox() { var l = document.getElementById("homeeventbox").style.display; document.getElementById("homeeventbox").style.display = l == "none" ? "block" : "none"; document.getElementById("homesubscriptionbox").style.display = l != "none" ? "block" : "none"; } function hideEventBox() { document.getElementById("homeeventbox").style.display = "block"; document.getElementById("homesubscriptionbox").style.display = "none"; } function hideSubscriptionBox() { document.getElementById("homeeventbox").style.display = "none"; document.getElementById("homesubscriptionbox").style.display = "block"; } function loginproc(ut,uid,pwd) { //return false; if(ut=="0") { alert("Please select the User Type"); return; } if(uid=="") { alert("Please enter the User Name"); return; } if(pwd=="") { alert("Please enter the Password"); return; } var url="/nasscom/templates/AjaxLogin.aspx?UT=" + ut +"&UID="+ uid +"&PWD="+ pwd +"&action=Login"; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } req.onreadystatechange = processRequestlogin; req.open("GET", url, true); req.send(null); } function processRequestlogin() { if (req.readyState == 4) { if (req.status == 200) { parseMessageslogin(); } } } function processRequestlogin2() { response = req.responseXML.documentElement; itemDescription = response.getElementsByTagName('login')[0].getAttribute("UserData"); alert(itemDescription); alert('yea'); } function parseMessageslogin() { response = req.responseXML.documentElement; itemDescription = response.getElementsByTagName('loginstatus')[0].getAttribute("status"); if(itemDescription=="True") { var ss1 = document.cookie.split(";"); var UT=0; var i=0; for(i=0; i < ss1.length; i++) { var cset = " " + ss1[i]; var ss2 = cset.split("="); if(cset.indexOf(" UT=")!=-1) { UT = parseInt("0" + ss2[1]); } } window.location.href="/"; /* if(UT=="2") { var hd = document.getElementsByTagName("head")[0]; document.getElementById("MainLogo").src = "/Images/Nasscom_members.gif"; var d = document.createElement("LINK"); d.href = "/Nasscom/styles/members.css"; d.rel = "stylesheet"; d.type = "text/css"; hd.appendChild(d); } document.getElementById("LoginMessage").innerHTML = ""; var url="/AjaxLogin.aspx?UT=GetUD&action=Login"; alert(url); if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } req.onreadystatechange = processRequestlogin2; req.open("GET", url, true); req.send(null); */ } else { errmsg = response.getElementsByTagName('loginstatus')[0].getAttribute("txt"); document.getElementById('msg').innerHTML=errmsg ; } } function getQueryVariable() { var variable = "ID"; var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0; i< vars.length;i++) { var pair = vars[i].split("="); if (pair[0].toLowerCase() == variable.toLowerCase()) return pair[1]; else return 11234; } } function compsearch(q) { window.location.href="/nasscom/templates/MainSearch.aspx?src=15486&q="+q; } function ContinueShopping() { window.location.href= "LandingPage.aspx?id=4865"; } function dropMenu(id) { var menu = document.getElementById("dropmenu_id" + id); menu.style.display = "block"; } function proceed(tid) { window.location.href= "PublicationOrderInvoice.aspx?id=15032&tid="+tid; } function makestring(s) { if(s.src.value == "-1") { alert("Please select a section.\n"); return false; } var qry=""; var q1 = s.q1.value; if (q1.length > 0) { var ss = q1.split(" "); var i=0; for(i=0; i < ss.length; i++) { if(ss[i].length > 0) qry += " +" + ss[i]; } } var q2 = s.q2.value; if(q2.length>0) { qry += " \"" + q2 + "\" "; } var q3 = s.q3.value; if(q3.length>0) { var ss = q3.split(" "); var i=0; for(i=0; i< ss.length; i++) { if( ss[i].length > 0) qry += " " + ss[i]; } } var q4 = s.q4.value; if(q4.length>0) { var ss = q4.split(" "); var i=0; for(i=0; i< ss.length; i++) { if(ss[i].length>0) qry += " -" + ss[i]; } } s.q.value = qry; return true; } function ChangeInBill() { window.location.href= "MyCart.aspx?id=10999"; } /*function DoPay(amt) { if(amt!= "0" ) { window.location.href= "SSL_DOpay.asp?tid=tb5ra22uhyuafruxsd3c1mzv"; } else { window.location.href= "PublicationOrderInvoice.aspx?id=15032&tid=tb5ra22uhyuafruxsd3c1mzv"; } }*/ function DoPay(amt) { //alert(amt); if(amt!= "0" ) { window.location.href= "SSL_DOpay.asp?tid=tb5ra22uhyuafruxsd3c1mzv"; } else { window.location.href= "PublicationOrderInvoice.aspx?id=15032&tid=tb5ra22uhyuafruxsd3c1mzv"; } } function DoPayWithName(amt, sessionId, eventName) { //alert(amt + " " + sessionId + " " + eventName); if(amt!= "0" ) { window.location.href= "SSL_DOpay.asp?tid=" + sessionId + "&eventName=" + eventName; } else { window.location.href= "PublicationOrderInvoice.aspx?id=15032&tid=" + sessionId; } } function addtocart(PageID,Item,qty) { var url="/nasscom/templates/Ajax.aspx?id=" + getQueryVariable("ID") + "&PID=" + PageID +"&Item="+ Item +"&Qty="+ qty +"&action=AddToCart2"; if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } req.onreadystatechange = processRequest; req.open("GET", url, true); req.send(null); alert ("Added Successfully Click 'Shopping Cart' to complete your order"); } function processRequest() { if (req.readyState == 4) { if (req.status == 200) { parseMessages(); } } } function parseMessages() { response = req.responseXML.documentElement; itemDescription = response.getElementsByTagName('cart')[0].getAttribute("count"); //if(document.getElementById('Cart').length>0) //document.getElementById('Cart').innerHTML=itemDescription; } function addtocartCheckOut(PageID,Item,qty,CheckOut) { //window.location.href= "?id=" + getQueryVariable("ID") + "&PID=" + PageID +"&Item="+ Item +"&Qty="+ qty + "&CheckOut="+ CheckOut ; window.location.href= "/nasscom/templates/Ajax.aspx?id=" + getQueryVariable("ID") + "&PID=" + PageID +"&Item="+ Item +"&Qty="+ qty + "&CheckOut="+ CheckOut + "&action=AddToCart2" ; } function showcart() { window.location.href="http://www.nasscom.in/nasscom/templates/MyCart.aspx?id=10999"; } function useredit() { window.location.href="UserEdit.aspx?id=15024"; } function removeitem(ItemID) { //alert(url); // if (window.XMLHttpRequest) { // req = new XMLHttpRequest(); //} else if (window.ActiveXObject) { // req = new ActiveXObject("Microsoft.XMLHTTP"); // } /// req.onreadystatechange = processRequest; // req.open("GET", url, true); //req.send(null); //var rw="row" + ItemID //var o=document.getElementById(rw); //o.style.display="none"; window.location.href= "MyCart.aspx?id=" + getQueryVariable("ID") + "&Item="+ItemID; } function removeitemfromcart(ItemID) { window.location.href= "MyCart.aspx?id=" + getQueryVariable("ID") + "&Item="+ItemID; } function PayNow() { window.location.href= "ShippingDetails.aspx?id=15000"; } function Calc(qty,ItemID) { //alert(ItemID); if(qty=="") { alert('Qty can not be null'); return; } if(isNaN(qty)) { alert('Please enter the Number'); return; } if(qty<0) { alert('Qty can not be less than 0'); return; } if(qty==0) { alert('Qty should be greater than 0'); return; } window.location.href= "MyCart.aspx?id=" + getQueryVariable("ID") + "&itemIdx="+ItemID + "&updqty=" + qty; } function ChangeAdd(tbn) { if(tbn=="1") { document.__aspnetForm.no.checked=false; document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_BillingAddress.value=document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_ShippingAddress.value; document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_BillCity.value=document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_ShipCity.value; document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_BillState.value=document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_ShipState.value; document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_BillPinCode.value=document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_ShipPinCode.value; var billcountryselectedindex=document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_Billcountryname; var shipcountryselectedindex=document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_Shipcountryname.selectedIndex; var ddlen=document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_Billcountryname.options.length; for(i=0;i< ddlen;i++) { if(i == shipcountryselectedindex) { document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_Billcountryname.options[i].selected=true; return; } } } else { document.__aspnetForm.yes.checked=false; document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_BillingAddress.value=""; document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_BillCity.value=""; document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_BillState.value=""; document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_BillPinCode.value="" document.__aspnetForm.MainFramework1_Content1_ShippingDetail1_Billcountryname.options[97].selected=true; } } function olprint() { var wdoc = document; if(wdoc.getElementById("notrequired")) { var i = wdoc.getElementById("notrequired"); i.style.display = "none"; } if(wdoc.getElementById("mytable1")) { var l = wdoc.getElementById("mytable1"); l.style.display = "none"; } if(wdoc.getElementById("crnr")) { var j = wdoc.getElementById("crnr"); j.style.display = "none"; } if(wdoc.getElementById("nsrow")) { var l = wdoc.getElementById("nsrow"); l.style.display = "none"; } if(wdoc.getElementById("myrow")) { var my = wdoc.getElementById("myrow"); my.style.display = "none"; } if (wdoc.getElementById("mytable")) { var k= wdoc.getElementById("mytable"); k.style.width="0px"; } window.print(); } function LoginHelper(s) { var myMsg=document.getElementById("loginMsg"); if (s.selectedIndex==1 || s.selectedIndex==3 ) { myMsg.innerHTML='Provide the email address with which you registered'; document.getElementById("emailLabel").innerHTML = 'Email Address*'; var d = document.getElementById("disignation"); d.style.display = "none"; } else { document.getElementById("emailLabel").innerHTML = 'Official Email ID*'; myMsg.innerHTML=''; var d2 = document.getElementById("disignation"); d2.style.display = "block"; } } function LeftNav() { var nr = document.getElementById("leftmenu"); if(nr==null) return; var div= nr.getElementsByTagName('div'); for (i=0;i < div.length;i++) { var t = div[i]; if(t.className == "lm_item") { var atags = t.getElementsByTagName("a"); if(atags.length>0) { var pn = atags[0].parentNode; if(pn.offsetHeight>25) { //alert(atags[0].innerHTML); var imgs = pn.getElementsByTagName("IMG"); //alert(imgs.length); imgs[0].style.display = "none"; atags[0].style.display = "block"; atags[0].style.paddingLeft = "20px"; //alert(atags[0].innerHTML); if(document.all && imgs.length>1) { //alert(t.innerHTML); imgs[1].style.marginTop = "20px"; imgs[1].style.marginRight = "-5px"; } } if(atags[0].href == window.location.href) { atags[0].style.marginLeft = "2px"; atags[0].style.display = "block"; var ih=t.innerHTML; var height_style = ""; if(atags[0].style.paddingLeft != "0px") { t.innerHTML=""+ih; } else { t.innerHTML=""+ih; } t.className = "lm_item1"; imgs = t.getElementsByTagName("IMG"); imgs[1].style.display = "none"; //return; } } else if(t.className == "lm_item1") { /*var pn = atags[0].parentNode; if(pn.offsetHeight>25) { //alert(atags[0].innerHTML); var imgs = pn.getElementsByTagName("IMG"); //alert(imgs.length); imgs[0].style.display = "none"; atags[0].style.display = "block"; atags[0].style.paddingLeft = "32px"; }*/ } } } } function max(x,y) { return x>y ? x : y; } function centerSite() { return; var body = document.getElementsByTagName("BODY")[0]; if(body.offsetWidth>1030) { var diff = body.offsetWidth - 1000; var left = diff/2; body.style.paddingLeft = left + "px"; var mcd = document.getElementById("maincontainerdiv").offsetWidth; var hm = document.getElementById("HoldMe"); var div = hm.childNodes[0]; div.style.left = (left+15) + "px"; var qll = document.getElementById("quicklinklist"); qll.style.left = (left+780) + "px"; var divs = document.getElementsByTagName("DIV"); var d; for(j=0; j < divs.length; j++) { d = divs[j]; if(d.className == "paybox_usd" || d.className == "paybox_inr") { d.style.left = (left+d.offsetLeft) + "px"; } } } var browserName=navigator.appName; var sam = document.getElementById("newBox"); if (browserName!="Microsoft Internet Explorer") { sam.style.marginBottom = "1px"; sam.style.marginTop = "2px"; sam.style.height = "14px"; } var topSection = document.getElementById("TopMenuRegion"); topSection.style.left = "0px"; } function sizeHome() { centerSite(); var th = document.getElementById("maincontainerdiv"); if(window.navigator.appVersion.indexOf("MSIE 7")!=-1) th.style.width = "1001px"; return; var th = document.getElementById("tabhead7"); var th1 = document.getElementById("tabhead1"); var b3 = document.getElementById("spotdescbox"); if(th) { var l = b3.offsetHeight - (th1.offsetHeight*6); th.style.height = l + "px"; th.backgroundImage = "none"; } } function alignLeftRight() { centerSite(); var leftC = document.getElementById("notrequired"); var centerC = document.getElementById("MainBody"); var MC = document.getElementById("maincontainerdiv"); var rightC = document.getElementById("rightregion"); if(!centerC) centerC = MC; else { if( window.location.search.indexOf("21366")== -1) { MC.style.backgroundImage = "url(/images/bg_headsmall.gif)"; MC.style.backgroundRepeat = "repeat-x"; centerC.style.backgroundImage = "none"; centerC.style.backgroundColor = "Transparent"; } } var mh = 0; if(leftC) mh=max(centerC.offsetHeight,leftC.offsetHeight); if(rightC) mh = max(mh,rightC.offsetHeight); //alert(bottomC.clientHeight); //centerC.style.height = mh + "px"; //rightC.style.height = leftC.style.height = (mh+40) + "px"; //rightC.style.height = leftC.style.height = mh + "px"; //leftC.style.height = (bottomC.offsetTop - 65 - 5) + "px"; var href = location.href.toLowerCase(); if( /* href.indexOf("newlogin.aspx")==-1 && */ href.indexOf("forgotpassword.aspx")==-1) MC.style.height = mh + "px"; if(!document.all) { var c = document.getElementById("profilermanagerbody"); var d = document.getElementById("resourcesbody"); if(c) c.style.width = "190px"; if(d) d.style.width = "190px"; } if(document.getElementById("calander")) showcal(); var si = document.getElementById("searchimg"); if(si) { if(document.all) { si.style.marginRight = "-3px"; } else { document.getElementById("borderlinepad").style.width = "998px"; } } } // This function is used for displaying QuickLinks menu. function ShowQuickLinks() { document.getElementById("quicklinklist").style.display = 'block'; } // This function is used for hiding QuickLinks menu. function HideQuickLinks() { document.getElementById("quicklinklist").style.display = 'none'; } function centerSite2() { //return; var body = document.getElementsByTagName("BODY")[0]; if(body.offsetWidth>1030) { //var diff = body.offsetWidth - 1000; var diff = screen.availWidth - 1000; var left = diff/2; window.status = left; body.style.paddingLeft = left + "px"; /* var hm = document.getElementById("HoldMe"); var div = hm.childNodes[0]; div.style.left = (left+15) + "px"; var qll = document.getElementById("quicklinklist"); qll.style.left = (left+780) + "px"; var divs = document.getElementsByTagName("DIV"); var d; for(j=0; j < divs.length; j++) { d = divs[j]; if(d.className == "paybox_usd" || d.className == "paybox_inr") { d.style.left = (left+d.offsetLeft) + "px"; } }*/ } } /* For Mouse Roll over to Image (Start)*/ function MM_findObj(n, d) { var p,i,x; if(!d) d=document; if((p=n.indexOf("?")) > 0 && parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x && i < d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x && d.layers && i < d.layers.length; i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_showHideLayers() { var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i < (args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; } obj.visibility=v; } } /* For Mouse Roll over to Image (Start)*/ function showImage(imgID) { document.getElementById(imgID).style.display="block"; } function hideImage(imgID) { document.getElementById(imgID).style.display="none"; } /* For Mouse Roll over to Image (End)*/ function GoogleAnalyse() { /*var _uacct = "UA-670821-1";*/ _uacct = "UA-757351-1"; urchinTracker(); } /************************ For Newsletter Unsubscription page (Start) **************/ function showHide(f) { var allCheckBoxes = f.form.elements; if(f.name.indexOf("Mainframework2:Content2:Content1:Subscription1:chk") != -1) { var allChkBox = f; if (!allChkBox.checked) { document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkAllSections").checked = false; } } } function showHideAll(f) { var allCheckBoxes = f.form.elements; for (index = 0; index < allCheckBoxes.length; index++) { if(f.name.indexOf("Mainframework2:Content2:Content1:Subscription1:chk") != -1) allCheckBoxes[index].checked = f.checked; } } function CheckAnySelection() { if (document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkAllSections").checked == false) { if (document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkHrConnect").checked == false) { if (document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkEvents").checked == false) { if (document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkNewUpdates").checked == false) { if (document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkPublication").checked == false) { if (document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkNasscomNewsline").checked == false) { if (document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkBpoNewsline").checked == false) { alert ("Please select any newsletter section"); return false; } else { return true; } } else { return true; } } else { return true; } } else { return true; } } else { return true; } } else { return true; } } else { return true; } } function SetCheckBoxBorder() { document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkBpoNewsline").style.border = "0px"; document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkNasscomNewsline").style.border = "0px"; document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkPublication").style.border = "0px"; document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkNewUpdates").style.border = "0px"; document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkEvents").style.border = "0px"; document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkHrConnect").style.border = "0px"; document.getElementById("Mainframework2_Content2_Content1_Subscription1_chkAllSections").style.border = "0px"; } function HideRightPanel() { var wdoc = document; if(wdoc.getElementById("searchimg")) { var i = wdoc.getElementById("searchimg"); i.style.display = "none"; } } /************************ For Newsletter Unsubscription page (End) **************/ // JScript source code var dmili = 1000*60*60*24; var lastday,firstday; var lines=0; function showcal() { /* var h = document.getElementsByTagName("head"); var e = document.createElement("link"); e.href = "/nasscom/styles/showcal.css"; e.rel = "stylesheet"; e.tyle = "text/css"; h[0].appendChild(e); */ var today1 = new Date(); firstday = new Date(today1); firstday.setDate(1); rendercal(); } function monthToString(n) { switch(n) { case 0: return "JAN"; case 1: return "FEB"; case 2: return "MAR"; case 3: return "APR"; case 4: return "MAY"; case 5: return "JUN"; case 6: return "JUL"; case 7: return "AUG"; case 8: return "SEP"; case 9: return "OCT"; case 10: return "NOV"; case 11: return "DEC"; } } function weekToString(w) { switch(w) { case 0: return "S"; case 1: return "M"; case 2: return "T"; case 3: return "W"; case 4: return "T"; case 5: return "F"; case 6: return "S"; } } function hideibox() { document.getElementById("eventinfo").style.display="none"; } function rendercal() { lines=0; //alert("starting=" + firstday); var cday = new Date(firstday); cday.setMilliseconds(-firstday.getDay()*dmili); var cal = document.getElementById("calander"); cal.innerHTML = ""; if(document.all) cal.style.width = "161px"; var i=0; var cmon = firstday.getMonth(); var i=0; var d = document.createElement("DIV"); d.className = "arrowleft"; d.innerHTML = ""; d.onmousedown = function(event) { firstday = new Date(firstday); firstday.setMilliseconds(-dmili-1); firstday.setDate(1); rendercal(); } cal.appendChild(d); var d = document.createElement("DIV"); d.className = "arrowright"; d.innerHTML = ""; d.onmousedown = function(event) { firstday = new Date(lastday); firstday.setMilliseconds(dmili+1); firstday.setDate(1); rendercal(); } cal.appendChild(d); d = document.createElement("DIV"); d.className = "monthname"; d.innerHTML = monthToString(firstday.getMonth()) + " " + firstday.getFullYear(); cal.appendChild(d); var wc=0; for(wc=0; wc<7; wc++) { d = document.createElement("DIV"); d.className = "day weekname" + (wc==0 ? " newweek" : ""); d.innerHTML = weekToString(wc); cal.appendChild(d); } //thi is not realy a infinite while(true) { i++; var d; isCurrentMonth=cmon == cday.getMonth(); clearFloat=false; isHoliday = cday.getDay()==0 || cday.getDay()==6; var lastDayOfWeek= (cday.getDay()==6 && document.all); if(cday.getDay()==0) { if(firstday < cday) if(!isCurrentMonth) break; clearFloat=true; lines++; } d = document.createElement("DIV"); a = document.createElement("A"); a.href="#";//http://something"; d.className = "day" + (isCurrentMonth ? "" : " outmonth") + (clearFloat ? " newweek" : "") + (lastDayOfWeek ? " day-ie" : "") + (isHoliday ? " holiday" : ""); d.innerHTML = cday.getDate(); d.style.cursor = "default"; //200609011050:tjin:the bug whicgh was making the first 29th of the last month getting highliogted insteadof the 29th of the current month. The reason why that the ID of both dates were the same. Now I modified the id of out of month dates with diferent ID so that the jax does not highlight by any chance. d.id = "event_day" + cday.getDate() + (isCurrentMonth ? "" : "_out") ; a.onmouseover = function(event) { if(document.all) event = window.event; d = window.event ? window.event.srcElement : event.target; if(!d.pagename || d.pagename.length <=2) return false; var ibox = document.getElementById("eventinfo"); var ilink = document.getElementById("eventinfo_link"); var ispot = document.getElementById("eventinfo_spot"); var ides = document.getElementById("eventinfo_des"); var iname = document.getElementById("eventinfo_name"); var ifrom = document.getElementById("eventinfo_from"); ispot.src = d.spot; ispot.alt = d.pagename; var ivenue = document.getElementById("eventinfo_venue"); ivenue.innerHTML = d.venue; iname.innerHTML = d.pagename; iname.href = ilink.href = d.linkurl; //ides.innerHTML = d.des; //alert(d.df); var eventDate = GetEventDateByName(d.df); //alert (eventDate); ifrom.innerHTML = eventDate; ibox.style.display="block"; if (ides.innerHTML == "") ides.style.display="none"; var offsetTop = document.all ? event.clientY : d.offsetTop; var offsetLeft = document.all ? event.clientX : d.offsetLeft; ibox.style.top = (offsetTop+20+document.body.scrollTop) + "px"; ibox.style.left = (offsetLeft-260) + "px"; } a.appendChild(d); cal.appendChild(a); if(isCurrentMonth) lastday = new Date(cday); cday.setMilliseconds(dmili); if(i > 60) break; } if(lines<6) { d = document.createElement("DIV"); d.className = "day newweek"; d.innerHTML = ""; cal.appendChild(d); } //alert(lines); getInfo(firstday); } // Added by Bhasker to Format display date (Start) function GetEventDateByName(localEventDate) { return (localEventDate).getDate()+ ' ' + GetNameMonth((localEventDate).getMonth()) + ', ' + (localEventDate).getFullYear() } function GetNameMonth(i) { var d = new Date() var month = new Array(12) month[0]="Jan" month[1]="Feb" month[2]="Mar" month[3]="Apr" month[4]="May" month[5]="Jun" month[6]="Jul" month[7]="Aug" month[8]="Sep" month[9]="Oct" month[10]="Nov" month[11]="Dec" return month[i] } // Added by Bhasker to Format display date (End) function scan1(id0,pagename,url,df0,dt,spot,des,venue) { var df = new Date(); df.setTime(Date.parse(df0)); var id = "event_day"+df.getDate(); var obj = document.getElementById(id); if(obj.className.indexOf("validate") == -1) obj.className += " validate"; //you can happily extend a object even from its object //that's my javascript! obj.spot = spot; obj.df = df; obj.pagename = pagename; obj.linkurl = url; obj.pageid = id; obj.des = des; obj.style.cursor = "pointer"; obj.venue = venue; //alert(2); } function getInfo(dt) { var url="/nasscom/templates/Ajax.aspx?ID=11234&action=listevents&mon=" + (1+dt.getMonth()) + "&year=" + (dt.getFullYear()); //alert(url); if (window.XMLHttpRequest) { req = new XMLHttpRequest(); } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); } req.onreadystatechange = processRequestEvents; last_url = url; req.open("GET", url, true); req.send(null); } function processRequestEvents() { if (req.readyState == 4) { if (req.status == 200) { parseMessagesEvents(); } } } function decode(s) { var ns; while(true) { ns=s.replace("+"," "); if(ns==s) return unescape(ns); s = ns; } alert("!!!"); } function showevent() { var dd=document.getElementById("EventInfo"); alert('test'); } function parseMessagesEvents() { response = req.responseXML.documentElement; var pds = response.getElementsByTagName('event'); var i=0; //alert("loop for " + pds.length); for(i=0; i < pds.length; i++) { pd = pds[i]; if(!pd) alert("error in last url:" + last_url); ID = pd.getAttribute("id"); last_id = ID = parseInt(ID); pagename = pd.getAttribute("PageName"); df = pd.getAttribute("DateFrom"); dt = pd.getAttribute("DateTo"); spot = pd.getAttribute("Spotlight"); var fullURL = pd.getAttribute("LinkURL"); if (fullURL.indexOf("http://") > -1) { url = pd.getAttribute("LinkURL"); //alert("Without"); } else { url = "http://www.nasscom.in" + pd.getAttribute("LinkURL"); //alert("With"); } venue = pd.getAttribute("Venue"); req = 0; var des = ""; if(pd.childNodes.length>0) des = pd.childNodes[0].nodeValue; pagename = decode(pagename); //alert("scan1(" + ID + "," + pagename + "," + url + "," + df + "," + dt + "," + spot + "," + des + ")"); scan1(ID,pagename,url,df,dt,spot,des,venue); } } //http://10.0.0.6/nasscom/templates/ajax.aspx?action=listevents&id=11234// JScript source code var ml_d=0; var ml_year; var ml_delay = 20; var thisMonth = new Date(); function lessMLMonYear(n) { n.href = n.href.replace("" + ml_year,"" + (ml_year-1)); n.innerHTML = n.innerHTML.replace("" + ml_year,"" + (ml_year-1)); n.className = "ml_mon" + (thisMonth.getMonth() == n.mon && n.year == thisMonth.getFullYear()? " ml_active" : ""); //alert("ml=" + ml_year + ",n=" + ("" + (ml_year-1)) + "," + n.href); } function addMLMonYear(n) { n.href = n.href.replace("" + ml_year,"" + (ml_year+1)); n.innerHTML = n.innerHTML.replace("" + ml_year,"" + (ml_year+1)); n.className = "ml_mon" + (thisMonth.getMonth() == n.mon && n.year == thisMonth.getFullYear()? " ml_active" : ""); //alert("ml=" + ml_year + ",n=" + ("" + (ml_year-1)) + "," + n.href); } function scrollYearDown() { var d = ml_d; var n = d.nextSibling; var p = d.parentNode; if((n && n.id.indexOf("ml_year")!=-1) || !n.nextSibling) { ml_year = d.year; d.year++; //alert(ml_year + "," + d.year); var h = d.innerHTML; h = h.replace("" + ml_year,"" + d.year); d.innerHTML = h; //alert(d.innerHTML + ";.year=" + d.year); if(d.year==2006) p.appendChild(d); } else { lessMLMonYear(n); p.insertBefore(d,n.nextSibling); setTimeout("scrollYearDown()",ml_delay); } } function scrollYearUp() { var d = ml_d; //alert(d); var pr = d.previousSibling; var p = d.parentNode; //alert(pr.id); if(pr && pr.id.indexOf("ml_year")!=-1) { ml_year = d.year; d.year--; var h = d.innerHTML; //alert(ml_year + "," + d.year); h = h.replace("" + ml_year,"" + d.year); //alert(h); d.innerHTML = h; return; } addMLMonYear(pr) p.insertBefore(d,pr); setTimeout("scrollYearUp()",ml_delay); } function addMLYear(box,d) { var I = document.createElement("IMG"); I.src = "/images/updown.gif"; I.alt = "UpDown"; I.width = 10; I.height = 10; I.style.float = "right"; var A = document.createElement("A"); //A.href = "/Nasscom/templates/LandingPage.aspx?id=2399&q=12_" + d; //A.href = "#"; A.onmousedown = function(event) { //return; ml_d = window.event ? window.event.srcElement : event.target; //if current year is after this objects' year then it is supposed to go down //otherwise, its supposed to go up. //alert("will go (current:" + ml_year + ">active:" + ml_d.year + ")" + (ml_year>ml_d.year ? "down" : "up")); if(ml_year>ml_d.year) scrollYearDown(); else scrollYearUp(); } A.year = d; A.id = "ml_year" + d; A.className = "ml_year"; A.appendChild(I); A.innerHTML += d; box.appendChild(A); } function makelist(src,event) { //200612051113: vikas: the bugfix that thisMonth was initialized once on pageload and reset at all mouseovers\ //this resulted in changing the thisMonth everytime when it should always be pointing to today! thisMonth = new Date(); var box = document.getElementById("ml_box"); box.innerHTML = ""; box.style.display = "none"; //alert(thisMonth); if(document.all) event = window.event; var today = new Date(); var year = 2004; var pastyear = new Date(); var ss,c_mon,c_year; if(location.search.indexOf("q=")!=-1) { var s = location.search; var i = s.indexOf("q="); var q1 = s.substring(i+2,i+9); i=q1.indexOf("&"); q1 = q1.substring(0,i == -1 ? 50 : i); ss = q1.split("_"); c_mon = parseInt(ss[0]); c_year = parseInt(ss[1]); //dd/mm/2006 did not work in IE //therefore 1 MAY, 2006 did and on both fire and ie var dt1="1 " + monthToString(c_mon-1) + ", " + c_year thisMonth.setTime(Date.parse(dt1)); } pastyear.setTime(Date.parse("1/1/" + year)); var cday = new Date(firstday); //alert(today + "," + pastyear); var total_rows=0; while((thisMonth.getFullYear())>pastyear.getFullYear()) { addMLYear(box,pastyear.getFullYear()); year++; total_rows++; pastyear.setTime(Date.parse("1/1/" + year)); // alert(year); } ml_year = year; var j=0; var endstring = ""; //alert(thisMonth); for(j=0; j<12; j++) { var A = document.createElement("A"); total_rows++; var currentPageId = window.location.href; var ampi = currentPageId.indexOf("&"); var finalQString = ""; ampi = ampi == -1 ? window.location.href.length : ampi; finalQString = ampi == -1 ? window.location.href.length : ampi; currentPageId = currentPageId.substring(window.location.href.indexOf("id=") + 3, finalQString); //A.href = "/Nasscom/templates/LandingPage.aspx?id=2399&q=" + (j+1) + "_" + year; A.href = "/Nasscom/templates/LandingPage.aspx?id=" + currentPageId + "&q=" + (j+1) + "_" + year; A.className = "ml_mon" + (thisMonth.getMonth() == j ? " ml_active" : ""); //alert("found" + thisMonth.getMonth() + "==" + j); A.id = "ml_mon" + (j+1); A.year = year; A.mon = j+1; endstring = ""; if(thisMonth.getMonth() == j) { endstring = ", " + year; base_month = A; c_mon = total_rows; } A.innerHTML = monthToString(j) + endstring; //var I = document.createElement("IMG"); box.appendChild(A); } year = thisMonth.getFullYear() + 1; thisMonth.setTime(Date.parse("1/1/" + year)); while(thisMonth.getFullYear()<=(today.getFullYear()+1)) { //alert("this="+year); addMLYear(box,thisMonth.getFullYear()); year++; total_rows++; thisMonth.setTime(Date.parse("1/1/" + year)); } box.style.top = "0px"; //all this is for firefox if(document.all) { box.style.left = (event.clientX -35)+ "px"; if(event.clientY<230) { c_mon--; var t = (event.clientY - (20 * c_mon) - 15); if(t<25) t=25; box.style.top = t + "px"; } else { var foot = document.getElementById("FooterMain"); //alert("foot=" + foot.clientTop); var dh = foot.offsetTop + foot.offsetHeight; c_mon--; // Adding 186 for some hidden height. This height is differ from mozilla so added here. var t = (src.offsetTop - (20 * c_mon) - 2 + 186); box.style.top = t + "px"; } } else { box.style.left = src.offsetLeft + "px"; if(src.offsetTop<230) { c_mon--; var t = (src.offsetTop - (20 * c_mon) - 2); if(t<25) t=25; box.style.top = t + "px"; } else { var foot = document.getElementById("FooterMain"); var dh = foot.offsetTop + foot.offsetHeight; c_mon--; var t = (src.offsetTop - (20 * c_mon) - 2); box.style.top = t + "px"; } } box.style.display = "block"; } var hidelisttime=0; function hidelist(obj) { hidelisttime = setTimeout("hidethisnow()",50); } function hidethisnow() { var box = document.getElementById("ml_box"); box.style.display = "none"; } function resethide() { clearTimeout(hidelisttime); }