﻿// JScript File

var oElemSubNavExanded;
function CallBackHandler( return_string, context )
{
    var div_content = $get("div_ContentPlaceHolder_Master");
    //var div_content = $get("ctl00_ContentPlaceHolder_Master_div_page_content");
    div_content.innerHTML = return_string;
//    if (oElemSubNavExanded)
//    {
//        //
//        //setTimeout('expandSubNav(oElemSubNavExanded);', 100);
//        // Set the handler to process the Web request.
//        Sys.Net.WebRequestManager.add_completedRequest(On_WebRequestCompleted);
//        expandSubNav(oElemSubNavExanded);
//    }
//    else
//    {
//        alert('oElemSubNavExanded is nothing');
//    }
}
function On_WebRequestCompleted(sender, eventArgs)
{
    expandSubNav(oElemSubNavExanded);
}

function expandSubNav(elem_id) {
    //alert('__pendingCallbacks.length=' + __pendingCallbacks.length);
    //elem = document.getElementById(elem);
    var elem = $get(elem_id);
    if (elem && elem.nextSibling) {
        if (elem.nextSibling.style.display=='none') {
            elem.nextSibling.style.display='inline';
        }
        else {
            elem.nextSibling.style.display='none';
        }
    }
}

if(document.images){
	function swapImage(name,source){
		document.images[name].src = source;
	}
}

function loadFlashHome()
{
		if(hasRightVersion)
		{
			// if we've detected an acceptable version
			var expiration = new Date();
					expiration.setTime(expiration.getTime() + 1000 * 60 * 60 * 24 * 365);
	
			document.cookie = "hasFlash=yes;expires=" + expiration.toGMTString();
	
			var oeTags = '<tr><td height="123"><img src="images/posterHome_crunched.jpg" width="568" height="123"></td></tr>'
				+ '<tr><td height="79" valign="bottom" bgcolor="#333333">'
				+ '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
				+ 'width="568" height="78" id="flashDetect"  ALIGN="" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab##version=6,0,0,0">'
				+ '<PARAM NAME="movie" VALUE="images/homeIcons.swf">'
				+ '<PARAM NAME="QUALITY" VALUE="high">'
				+ '<PARAM NAME="MENU" VALUE="false">'
				+ '<EMBED SRC="images/homeIcons.swf"'
				+ 'width="568" height="78"'
				+ 'QUALITY="high"'
				+ 'MENU="false"'
				+ 'TYPE="application/x-shockwave-flash"'
				+ 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
				+ '</EMBED>'
				+ '</OBJECT>'
				+ '</td></tr>';
	
			document.write(oeTags);   // embed the flash movie
		}
		else
		{
			var imgTag = '<tr><td height=202><img src="images/posterHome.gif" width="568" height="202"></td></tr>';
			document.write(imgTag);
		}

}


//var resultElement;

//function pageLoad()
//{
//    resultElement = $get("ResultId");
//}

//// This function performs a POST Web request.
//function PostWebRequest()
//{
//    alert("Performing Post Web request.");
//    
//    // Instantiate a WebRequest.
//    var wRequest = new Sys.Net.WebRequest();
//    
//    // Set the request URL.      
//    wRequest.set_url("default.aspx");
//    alert("Target Url: default.aspx");

//    // Set the request verb.
//    wRequest.set_httpVerb("POST");
//   
//    // Set the request handler.
//    wRequest.add_completed(OnWebRequestCompleted);
// 
//    // Set the body for he POST.
//    var requestBody = 
//        "Message=Hello! Do you hear me?";
//    wRequest.set_body(requestBody);
//    wRequest.get_headers()["Content-Length"] = 
//        requestBody.length;
//   
//    // Clear the results area.
//   resultElement.innerHTML = "";
//     
//    // Execute the request.
//    wRequest.invoke();              
//}


//// This callback function processes the 
//// request return values. It is called asynchronously 
//// by the current executor.
//function OnWebRequestCompleted(executor, eventArgs) 
//{    
//    if(executor.get_responseAvailable()) 
//    {
//        // Clear the previous results. 
//       
//       resultElement.innerHTML = "";
//   
//        // Display Web request status. 
//       resultElement.innerHTML +=
//          "Status: [" + executor.get_statusCode() + " " + 
//                    executor.get_statusText() + "]" + "<br/>";
//        
//        // Display Web request headers.
//       resultElement.innerHTML += 
//            "Headers: ";
//            
//       resultElement.innerHTML += 
//            executor.getAllResponseHeaders() + "<br/>";

//        // Display Web request body.
//       resultElement.innerHTML += 
//            "Body:";
//           
//      if(document.all)
//        resultElement.innerText += 
//           executor.get_responseData();
//      else
//        resultElement.textContent += 
//           executor.get_responseData();
//    }

//}
//if (typeof(Sys) !== "undefined") Sys.Application.notifyScriptLoaded();

