﻿function PrintThisPage() 
{ 
   var sOption="toolbar=no,location=no,directories=no,menubar=yes,"; 
       sOption+="scrollbars=yes,width=750,height=500,left=100,top=25"; 

   var sWinHTML = document.getElementById('cal').innerHTML; 
   //add title id to run following code
   //var sWinHTMLTitle = "";        //document.getElementById('title').innerHTML;
   var sWinHTMLTitle = document.getElementById('title').innerHTML;
   
   var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><head><LINK href=http://www.seafoodnews.com/includes/forumcomment.css rel=Stylesheet>'); 
       winprint.document.write('<link rel="stylesheet" type="text/css" href="../includes/common.css" />'); 
       winprint.document.write('</head>'); 
       winprint.document.write('<body onload=window.print()>'); 
       winprint.document.write('<div style=\"border:thin black 0 px;\"><img src=\"http://www.seafoodnews.com/Images/SFNewslogo.jpg\" border=0><br>');
       winprint.document.write('<p align=center><span style="font-size: 20px; color: black; font-family:verdana, arial;"><b>');       
       winprint.document.write(sWinHTMLTitle);
       winprint.document.write('</b></span></p>');
       winprint.document.write('<br>');
       winprint.document.write(sWinHTML);
       winprint.document.write('<br><br><span style=\"font-size:8pt;font-family:verdana,arial;\">Source: Seafood.com News</span></div></body></html>'); 
       winprint.document.close(); 
       winprint.focus(); 
}

function PrintThisPageNoImg() 
{ 
   var sOption="toolbar=no,location=no,directories=no,menubar=yes,"; 
       sOption+="scrollbars=yes,width=750,height=500,left=100,top=25"; 

   var sWinHTML = document.getElementById('cal').innerHTML; 
   //add title id to run following code
   //var sWinHTMLTitle = "";        //document.getElementById('title').innerHTML;
   var sWinHTMLTitle = document.getElementById('title').innerHTML;
   
   var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><head><LINK href=http://www.seafoodnews.com/includes/forumcomment.css rel=Stylesheet>'); 
       winprint.document.write('<link rel="stylesheet" type="text/css" href="../includes/common.css" />'); 
       winprint.document.write('<title>' + sWinHTMLTitle + '</title>');
       winprint.document.write('</head>'); 
       winprint.document.write('<body onload=window.print()>'); 
       winprint.document.write('<div style=\"border:thin black 0 px;\"><br>');
       winprint.document.write('<p align=center><span style="font-size: 20px; color: black; font-family:verdana, arial;"><b>');       
       winprint.document.write(sWinHTMLTitle);
       winprint.document.write('</b></span></p>');
       winprint.document.write('<br>');
       winprint.document.write(sWinHTML);
       winprint.document.write('<br><br><span style=\"font-size:8pt;font-family:verdana,arial;\">Source: Seafood.com News</span></div></body></html>'); 
       winprint.document.close(); 
       winprint.focus(); 
}

function PrintThisPageNoComments() 
{ 
   var sOption="toolbar=no,location=no,directories=no,menubar=yes,"; 
       sOption+="scrollbars=yes,width=750,height=500,left=100,top=25"; 

   var sWinHTML = document.getElementById('contentstart').innerHTML; 
   //add title id to run following code
   //var sWinHTMLTitle = "";        //document.getElementById('title').innerHTML;
   var sWinHTMLTitle = document.getElementById('title').innerHTML;
   
   var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><head><LINK href=http://www.seafoodnews.com/includes/forumcomment.css rel=Stylesheet></head><body onload=window.print()>'); 
       winprint.document.write('<div style=\"border:thin black 0 px;\"><img src=\"http://www.seafoodnews.com/Images/SFNewslogo.jpg\" border=0><br>');
       winprint.document.write('<p align=center><span style="font-size: 20px; color: black; font-family:verdana, arial;"><b>');       
       winprint.document.write(sWinHTMLTitle);
       winprint.document.write('</b></span></p>');
       winprint.document.write('<br>');
       winprint.document.write(sWinHTML);
       winprint.document.write('<br><br><span style=\"font-size:8pt;font-family:verdana,arial;\">Source: Seafood.com News</span></div></body></html>'); 
       winprint.document.close(); 
       winprint.focus(); 
}

function PrintThisPagewithComments() 
{ 
   var sOption="toolbar=no,location=no,directories=no,menubar=yes,"; 
       sOption+="scrollbars=yes,width=750,height=500,left=100,top=25"; 

   var sWinHTML = document.getElementById('contentstart').innerHTML;    //var sWinHTML = document.getElementById('cal').innerHTML;         //contentstart
   var sWinHTMLTitle = document.getElementById('title').innerHTML;
   var sWinHTMLComments = document.getElementById('comments').innerHTML;
   var sWinHTMLPolicy = document.getElementById('policy').innerHTML;
   
   var winprint=window.open("","",sOption); 
       winprint.document.open(); 
       winprint.document.write('<html><head><LINK href=http://www.seafoodnews.com/includes/forumcomment.css rel=Stylesheet><style>caption {font-size:9pt;}</style></head><body onload=window.print()>'); 
       winprint.document.write('<div style=\"border:thin black 0 px;\"><img src=\"http://www.seafoodnews.com/Images/SFNewslogo.jpg\" border=0><br>');
       winprint.document.write('<p align=center><font style="font-size: 20px; color: black"><b><u>');       
       winprint.document.write(sWinHTMLTitle);
       winprint.document.write('</u></b></font></p>');
       winprint.document.write('<br>');
       winprint.document.write(sWinHTML);
       winprint.document.write('<br><br><span style=\"font-size:8pt;font-family:verdana,arial;\">Source: Seafood.com News</span>'); 
       winprint.document.write('<br><br>');
       winprint.document.write(sWinHTMLComments);
       winprint.document.write('<span style=\"font-size:7pt;font-family:verdana,arial;\">' + sWinHTMLPolicy + '</span>');
       winprint.document.write('<br></div></body></html>');
       winprint.document.close(); 
       winprint.focus(); 
}


function OpenPdf(strURL)
{   
    var newWindow = window.open(strURL,'Comtell','width=700,height=500,screenX=750,screenY=30, scrollbars=yes, left = 150, top = 175');
}

function OpenOther(strURL)
{   
    var newWindow = window.open(strURL,'Comtell','width=700,height=500,screenX=750,screenY=30, scrollbars=yes menubar=yes, left = 150, top = 175');
}

//******************************************************************************************


function setCookie(szName, szValue, szExpires, szPath, szDomain, bSecure)
{
 	var szCookieText = 	   escape(szName) + '=' + escape(szValue);
	szCookieText +=	 	   (szExpires ? '; EXPIRES=' + szExpires.toGMTString() : '');
	szCookieText += 	   (szPath ? '; PATH=' + szPath : '');
	szCookieText += 	   (szDomain ? '; DOMAIN=' + szDomain : '');
	szCookieText += 	   (bSecure ? '; SECURE' : '');
	
	document.cookie = szCookieText;
}

//******************************************************************************************
// This functions reads & returns the cookie value of the specified cookie (by cookie name) 
//
// Prototype : getCookie(szName)
//******************************************************************************************

function getCookie(szName)
{
 	var szValue =	  null;
	if(document.cookie)	   //only if exists
	{
       	var arr = 		  document.cookie.split((escape(szName) + '=')); 
       	if(2 <= arr.length)
       	{
           	var arr2 = 	   arr[1].split(';');
       		szValue  = 	   unescape(arr2[0]);
       	}
	}
	return szValue;
}

//******************************************************************************************
// To delete a cookie, pass name of the cookie to be deleted
//
// Prototype : deleteCookie(szName)
//******************************************************************************************

function deleteCookie(szName)
{
 	var tmp = 	  			 	 getCookie(szName);
	if(tmp) 
	{ setCookie(szName,tmp,(new Date(1))); }
}

//==========================================^-^==============================================//
//    		 //
//==========================================^-^==============================================//   


//function cnnMpStories( intWhich ) {
//	for(i=1;i<4;i++) {
//		if(i==intWhich) {
//			eval('cnnMpStories' + i).style.display = 'block';
//			eval('cnnMpStoriesTab' + i).className = 'active';
//		}
//		else {
//			eval('cnnMpStories' + i).style.display = 'none';
//			eval('cnnMpStoriesTab' + i).className = '';
//		}
//	}
//	eval('cnnMpStoriesTab'+ intWhich).blur();
//}

//	function putCookie(szText)
//	{
//	 	if(szText && (szText.length != 0))
//		{
//    		var today = new Date();
//    		var nextMonth = new Date(today.getYear(), today.getMonth()+1, today.getDate());
//    		setCookie("technofundoDemoCookie", szText, nextMonth);
//			//document.location.reload();
//		}
//		else
//		{
//		  	alert("Please enter your name to set the cookie");
//			//document.CookieDemo.UserName.focus();
//		}
//	}
//	var szName = getCookie("technofundoDemoCookie");
//	if(szName && (szName.length != 0)) javascript:cnnMpStories(szName);          //document.write('<div class="cook"><center>Welcome back ' + szName + '.<\/center><\/div>');

