$(document).ready(function () {
today = new Date( ); 
$("#inline").datepicker({
	rangeSelect: true,
	startDate:'01/01/2008', 
minDate:new Date(2007, 0, 1),	
maxDate:'0d',
    	showOn: "both",     
	onSelect: function(date) {         
		$("#altInline").val(date);
		document.getElementById("altInline").value=date; 
 	} 
});


$("#archive_submit").click(function(){
	if($("#altInline").val() == ""){
		alert("Please select a date.");
	} else{$("#older_stories").submit();}
});
 
$("#altInline").hide();


$("#searchTerm").focus(function(){
    	if ($("#searchTerm").val() == "Search MyNC")
 			$("#searchTerm").val("") ;
    });

$("#search_submit").click(function(){
document['fQueryform']['mInfoSourceFlag']['value']='News';javascript:document['fQueryform']['moreSourceFlag']['value']='';
retrievalSubmitForm();
});

if(document.getElementById("ad_space"))	
	document.getElementById("ad_space").src="http://news.mync.com/site/ads/all_ad_grab/bXluYy5jb20vbmV3cy9vbmxpbmUvc2l0ZWluZm9pbmRleA==";

/* disabling
// Set specific variable to represent all iframe tags.
		var iFrames = document.getElementsByTagName('iframe');

		// Resize heights.
		function iResize()
		{
			// Iterate through all iframes in the page.
			for (var i = 0, j = iFrames.length; i < j; i++){
				// Set inline style to equal the body height of the iframed content.
				iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';
			}
		}

		// Check if browser is Safari or Opera.
		if ($.browser.safari || $.browser.opera)
		{
			// Start timer when loaded.
			$('iframe').load(function()
				{
					setTimeout(iResize, 0);
				}
			);

			// Safari and Opera need a kick-start.
			for (var i = 0, j = iFrames.length; i < j; i++)
			{
				var iSource = iFrames[i].src;
				iFrames[i].src = '';
				iFrames[i].src = iSource;
			}
		}
		else
		{
			// For other good browsers.
			$('iframe').load(function(){
				// Set inline style to equal the body height of the iframed content.
                this.style.height = (this.contentWindow.document.body.scrollHeight) + 'px';
                this.style.width= (this.contentWindow.document.body.scrollWidth) + 'px';
			});
		}
*/
});


function setInlineDate() { 
    try { 
        var date = $.datepicker.parseDate("mm/dd/yyyy", $("#altInline").val()); 
 	// $("#inline").datepicker("setDate", date); 
    } 
    catch (e) { 
        // Ignore 
    } 
} 

