﻿var amiWindow;
function GetWeather(eventId)
{
    var xmlhttp;
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        // code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    else{
        alert("Your browser does not support XMLHTTP!");
    }
      
    xmlhttp.onreadystatechange=function(){
        if(xmlhttp.readyState==4){
            document.getElementById('box_weather').innerHTML = xmlhttp.responseText;
            new Lightbox.base('box_weather');
            
        }
    }
    xmlhttp.open("GET","WeatherAjax.aspx?eventid="+eventId,true);
    xmlhttp.send(null);
}

function HideShowActivities(command,divnum)
   {
    var Activities = document.getElementById(divnum);
       if(command == 'hide')
        {
            if(Activities != null)
            {
            
            Activities.style.visibility = 'hidden';
            Activities.style.display = 'none';
            }
        }
        else if(command == 'show')
        {
            Activities.style.visibility = '';
            Activities.style.display = ''; 
        }
    return false;
    }
// JScript File

/******************************************
        The PrintPage function is used to print the
        order summary for the client.
        Code behind Binding Line # 320
        Code behind Function/Event handler Name: Page_Load
        Created BY: Tahir Shafique
        Changed By: Usman Aslam - changed according to new CSS
        ******************************************/
function PrintPage(activityCount)
{
    var a = window.open('','','toolbar=yes,location=no,resizable=yes,menubar=yes,scrollbars=yes,width=570px,height=840');
    
    a.document.open("text/html");
    a.document.write('<html><head ><title></title><link href="css/main.css" rel="stylesheet" type="text/css" />'); 
    a.document.write('</head>'); 
    a.document.write('<body onload="window.print();">');
    a.document.write('<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td>');
   
    a.document.write('</td></tr><tr><td align="left">');
    a.document.write('<div style="width:400px; height:33px; top:13px; position:absolute; overflow:hidden; text-align:left"><span style="color: #747474;padding-right: 12px; vertical-align: middle;  font-size: 75%; font-family: Arial, Helvetica, sans-serif;">Registration Powered By</span><img src="images/registration_img.png" style="vertical-align:middle;" alt="" /></div><br clear="all"><br>');
                
    var strHtml = document.getElementById('maincontent_inner').innerHTML;
    
    strHtml = strHtml.replace(/target=_blank/gi, " ");
    strHtml = strHtml.replace(/<A/gi, "<A target='_blank'");
    strHtml = strHtml.replace("button","hidden");

    var counter = activityCount;
    for(var count = 0 ; count< counter; count++)
    {
       strHtml = strHtml.replace("none","block");
    }
  
    a.document.write('<div class="event_page">');
        a.document.write('<div id="maincontent_inner">');
            a.document.write(strHtml);
        a.document.write('</div>');
    a.document.write('</div>');
    
    //**********************************
    a.document.write('</td></tr></table></body></html>');	        
    a.document.close();              
}

<!--
// Adeel Shahzad
// Hidding and showing the activities 

    

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { 
//v4.01
  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_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->






        function openMapWindow(value)
        {
        
            var url=window.location;
//            var hdnAddress= value;
//             if(hdnAddress!="")
            //var WinSettings = "center:yes;resizable:no;dialogHeight:535px;dialogWidth:540px;help:no"
            //var MyArgs = window.showModalDialog("Map.aspx"+url.search+"&Address="+hdnAddress.value, '', WinSettings);
            window.open("map.aspx"+url.search,"Map","width=550px, height=500px");
            //Modalbox.hide();           
        }
        
        
        function openWindowContact()
        {
      
            
            var url=window.location;
           if(navigator.appName == 'Netscape')
            {         
                          
                window.open("Contact.aspx"+url.search,"EmailAFriend","width=568px, height=565px, resizable=yes");
            }
            else
                window.open("Contact.aspx"+url.search,"EmailAFriend","width=568px, height=565px, resizable=yes");

        }
        
         function openWindowAmIRegister(eventid)
        {      
            var ufName=document.getElementById('txtFName').value;
            var ulName=document.getElementById('txtLName').value;              
            
            if(ufName=="First Name") ufName="";             
            if(ulName=="Last Name") ulName="";
            
             var url= "AmIRegistered.aspx?eventid="+eventid+"&ufName="+ufName+"&ulName="+ulName;      
            if (!amiWindow || amiWindow.closed) amiWindow=open(url,"AmIRegistered", "width=760px, height=585px, resizable=yes,titlebar=no,scrollbars=yes, status=no");
	        else amiWindow.location.href = url;      
            //    amiWindow=window.open("AmIRegistered.aspx?eventid="+eventid+"&ufName="+ufName+"&ulName="+ulName,"AmIRegistered","width=760px, height=585px, resizable=yes,titlebar=no,scrollbars=yes, status=no");
             amiWindow.focus();
             
             return false;
            
        }
        function openWindow()
        {
      
            //alert(navigator.appName.toString());
            var url=window.location;
            if(navigator.appName == 'Netscape')
            {                      
                window.open("EmailAFriend.aspx"+url.search,"EmailAFriend","width=568px, height=750px, resizable=yes");
            }
            else
                window.open("EmailAFriend.aspx"+url.search,"EmailAFriend","width=568px, height=750px, resizable=yes,scrollbar=1");
//            var WinSettings = "center:yes;resizable:no;dialogHeight:350px;dialogWidth:485px;help:no"
//            var MyArgs = window.showModalDialog("EmailAFriend.aspx"+url.search, '', WinSettings);
//            Modalbox.hide();
        }
        
        function openWindowWeb(url2)
        {
         
            var url=window.location;
//            var objHdnEvent = document.getElementById('ctl00_cphMiddle_hdnEventUrl');
            //alert(url2);
           // window.open(url2,'',"width=600px, height=455px,menubar=1,resizable=1,status=1,toolbar=1,location=1");
            window.open(url2,'','');
        }


