﻿// JScript File
$.fx.speeds._default = 750;
$(document).ready(function() {
	$( "#dialog" ).dialog({
		autoOpen: false,
		modal: true,
		width: 680,
		height: 460
	});

	$( ".PressRelease" ).click(function(e) {
	    e.preventDefault();
		var url = $(this).attr("href");	
		$("#dialog").html('<img src="/images/ASC-Software/web_logo_hex-small.png" alt="ASC Newsletter"/>');
		$("loadNews").html('');
		$("#dialog").dialog('open');
		$("#loadNews").load(url + " #newsContent", function(){
		    $($("#loadNews").html()).appendTo("#dialog");
		    $("#dialog").attr("style", "height: 400px; font-family: Arial, Helvetica, sans-serif; line-height: 1em; color: #222222; overflow: auto;");
		    $("#dialog h1").attr("style", "font-size: 18px; font-weight: bold;"); 
		    $("#dialog h2").attr("style", "font-size: 12px; font-weight: bold; text-transform: capitalize; margin-bottom: 1em;");	
		    $("#dialog p").attr("style", "font-size: 12px; margin-bottom: 14px;");
		    $("#dialog #newsContent").attr("style","margin-bottom 20px; top: 65px; margin: 0 auto; width: 95%; background: #fefcfd;	padding: 10px; margin-top: 10px; border: solid 2px #dcdcdc;");
		    $("#dialog #SocNetLinks").hide(); //Not working at the moment
		});
		
	    
//	    $("#dialog").html('<iframe id="ifrm" style="width: 100%; height: 100%;"></iframe>');
//		$( "#dialog" ).dialog( "open" );
//		$("#dialog>#ifrm").attr("src", url + "#newsContent");
		return false;
	});
	
	$("#closeWindow").click(function(e) {
	    e.preventDefault();
	    $("#dialog").dialog('close');
	});
});

function getTweet(tweetFrom, el)
{
    $(el).load('/news/reader.aspx?n=' + tweetFrom + " #plhNews_" + tweetFrom + " #SocNetLinks")
}




