var objAddRequest;
var clientUrl;
var setWindow;
//var pType='Navratri';   
    
    function addSense(advUrl,imageId)
    {
       
        var serUrl ='/servlet/AddSense?imageID='+imageId+'&pageType='+pType;
        clientUrl = advUrl;   
        // alert(pType);
   	if(advUrl=='dgmTP'){
		setWindow = 'dgmTP';
	}else{
		setWindow = imageId;
	}
	//alert(serUrl);
        if(window.ActiveXObject)
        {
            objAddRequest = new ActiveXObject('Microsoft.XMLHTTP');            
        }
        else
        {
            objAddRequest = new XMLHttpRequest();
            
        }
        if(objAddRequest)
        {
			
			 objAddRequest.onreadystatechange = sendInfo;
            //alert("objAddRequest 2");
            objAddRequest.open('Get',serUrl,true);
            objAddRequest.send(''); 
			       
        }
    }
    function sendInfo()
    {   
        
      
        if(objAddRequest.readyState==4)
        {            
            if(objAddRequest.status==200)
            {               
			switch (setWindow)
			{
				case "contactus":
					window.open(clientUrl,'','width=517,height=600,screenX=0,screenY=0,left=380,top=80,scrollbars=yes,resizable=no');
				break;
				case "Right_add100":
				window.open(clientUrl,'W2Stay','scrollbars=yes,resizable=no');
				break;
				case "PlanATrip":
				window.open(clientUrl,'PlanATrip','scrollbars=yes,resizable=yes');
				break;
				case "MyTrip":
				window.open(clientUrl,'MyTrip','width=725,height=495,left=133,top=185,screenX=0,screenY=0,scrollbars=no,resizable=no');
				break;
				case "HowToReach":
				window.open(clientUrl,'HowToReach','width=410,height=490,left=305,top=180,screenX=0,screenY=0,scrollbars=no,resizable=no');
				break;
				case "Festival":
				window.open(clientUrl,'Festival','width=600,height=462,left=200,top=175,screenX=0,screenY=0,scrollbars=no,resizable=no');
				break;
				case "TravelTips":
				window.open(clientUrl,'TravelTips','width=770,height=650,left=50,top=25,screenX=0,screenY=0,scrollbars=yes,resizable=no');
				break;
				case "NavratriCmp":
				window.open(clientUrl,'NavratriCmp','width=780,height=530,screenX=0,screenY=0,left=100,top=100,scrollbars=no,resizable=no');
				break;
				case "Guidepost":
				window.open(clientUrl,'Guidepost','width=792,height=575,left=130,top=75,screenX=0,screenY=0,scrollbars=yes,resizable=no');
				break;
				case "NewsMedia":
				window.open(clientUrl,'NewsMedia','width=480,height=300,left=150,top=235,screenX=0,screenY=0,scrollbars=no,resizable=no');
				break;
				case "Advertisment":
				window.open(clientUrl,'Advertisment','width=767,height=550,left=215,top=80,screenX=0,screenY=0,scrollbars=yes,resizable=no');
				break;
				case "PressRelease":
				window.open(clientUrl,'PressRelease','scrollbars=yes,resizable=yes');
				break;
				case "Weather":
				window.open(clientUrl,'Weather','width=580,height=543,left=215,top=135,screenX=0,screenY=0,scrollbars=no,resizable=no');
				break;
				case "GuestBook":
				window.open(clientUrl,'GuestBook','width=800,height=650,left=50,top=25,screenX=0,screenY=0,scrollbars=yes,resizable=no');
				break;
				case "AboutVisitindia":
				window.open(clientUrl,'AboutVisitindia','width=700,height=472,left=155,top=140,screenX=0,screenY=0,scrollbars=no,resizable=no');
				break;
				case "CurrencyCal":
				window.open(clientUrl,'CurrencyCal','width=550,height=302,left=220,top=195,screenX=0,screenY=0,scrollbars=no,resizable=no');
				break;
				case "Helpline":
				window.open(clientUrl,'Helpline','width=600,height=430,left=165,top=145,screenX=0,screenY=0,scrollbars=no,resizable=no');
				break;
				case "AboutVisitindia":
				window.open(clientUrl,'AboutVisitindia','width=800,height=650,left=50,top=25,screenX=0,screenY=0,scrollbars=yes,resizable=no');
				break;	
				case "PhoneDirectory":
				window.open(clientUrl,'PhoneDirectory','width=635,height=698,left=265,top=0,screenX=0,screenY=0,scrollbars=yes,resizable=no');
				break;
				case "MoneyCounter":
				window.open(clientUrl,'MoneyCounter','width=400,height=409,left=570,top=50,screenX=0,screenY=0,scrollbars=no,resizable=no');
				break;
				case "OnlineShopping":
				window.open(clientUrl,'OnlineShopping','scrollbars=yes,resizable=yes');
				break;
				case "Blogging":
				window.open(clientUrl,'Blogging','width=1015,height=750,left=0,top=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes');
				break;
                                case "WebVideo":
				window.open(clientUrl,'WebVideo','width=1015,height=750,left=0,top=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes');
				break;
                                case "Classified":
				window.open(clientUrl,'Classified','width=517,height=600,screenX=0,screenY=0,left=380,top=80,scrollbars=yes,resizable=no');
				break;				
				case "KidZone":
				window.open(clientUrl,'KidZone','scrollbars=yes,resizable=yes');
				break;
				case "180":
				window.open(clientUrl,'180','scrollbars=yes,resizable=yes');
				break;
				case "225":
				window.open(clientUrl,'OnlineShopping','scrollbars=yes,resizable=yes');
				break;
				case "226":
				window.open(clientUrl,'OnlineShopping','scrollbars=yes,resizable=yes');
				break;
				case "227":
				window.open(clientUrl,'PlanATrip','scrollbars=yes,resizable=yes');
				break;
				case "228":
				window.open(clientUrl,'PlanATrip','scrollbars=yes,resizable=yes');
				break;
				case "29":
				window.open(clientUrl,'ContactUs','width=517,height=600,screenX=0,screenY=0,left=380,top=80,scrollbars=yes,resizable=no');
				break;
				case "30":
				window.open(clientUrl,'ContactUs','width=517,height=600,screenX=0,screenY=0,left=380,top=80,scrollbars=yes,resizable=no');
				break;
				case "199":
				window.open(clientUrl,'ContactUs','width=517,height=600,screenX=0,screenY=0,left=380,top=80,scrollbars=yes,resizable=no');
				break;
				case "222":
				window.open(clientUrl,'ContactUs','width=517,height=600,screenX=0,screenY=0,left=380,top=80,scrollbars=yes,resizable=no');
				break;
				
				case "272":
				window.open(clientUrl,'Blogging','width=1015,height=750,left=0,top=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes');
				break;
			
			/*case "TA36":
				window.open(clientUrl,'TA36','width=532,height=601,left=0,top=0,screenX=0,screenY=0,scrollbars=no,resizable=no');
				break;*/
			
                                case "Blog":
				window.open(clientUrl,'Blog','width=1015,height=750,left=0,top=0,screenX=0,screenY=0,scrollbars=yes,resizable=yes');
					break;

				case "dgmTP":
					setWindow='';
					//do nothing
					break;
				default :
				window.open(clientUrl,"");
			}
		}
      }
    }
