//Generic functionsfunction bookmarkUs(){  if (document.all) {    window.external.AddFavorite ("http://www.sumanasa.com/", "Sumanasa.com India News");  }  else {  var msg = "Press CTRL-D to bookmark us!";  if(navigator.appName == "Netscape") alert(msg);  }}function breakout_of_frame(){  if (top.location != location) {    top.location.href = document.location.href ;  }}function setPreference(){	if (document.preference.newwindow.checked) setNavigationStyle(1);	else setNavigationStyle(0);}function today(){  var d=new Date();  var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");  var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");  return (weekday[d.getDay()] + " - " + monthname[d.getMonth()] + " " +  d.getDate() + ", " + d.getFullYear());}function getCookieExpireDate(noDays){  var today = new Date()  var expr = new Date(today.getTime()+noDays*24*60*60*1000)  return  expr.toGMTString()  }function setCookie (name, value, noOfDays, path, domain, secure) {  document.cookie = name + "=" + escape (value) +    ((noOfDays) ? "; expires=" + getCookieExpireDate(noOfDays) : "") +    ((path) ? "; path=" + path : "/") +    ((domain) ? "; domain=" + domain : "") +    ((secure) ? "; secure" : "");}function getCookie(name) {    var start = document.cookie.indexOf(name+"=");    var len = start+name.length+1;    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;    if (start == -1) return null;    var end = document.cookie.indexOf(";",len);    if (end == -1) end = document.cookie.length;    return unescape(document.cookie.substring(len,end));}function deleteCookie(name){   var cookieValue = getCookie(name);  if ((cookieValue != null) && (cookieValue != ""))    {		var exp = new Date(); 		exp.setTime(exp.getTime() - 1); 		document.cookie = name + "=" + "; expires=" + exp.toGMTString();    }}function maximizeWindow(){	top.window.moveTo(0,0);	top.window.resizeTo(screen.width,screen.height);}//sumanasa.com functionsvar navigationStyle = 0;var agent_isIE = true;var agent_isNS = false;var detect = navigator.userAgent.toLowerCase();var OS,browser,version,total,thestring;doBrowserCheck();getNavigationStyle();function checkIt(string){place = detect.indexOf(string) + 1;thestring = string;return place;}function getBrowserName(){if (checkIt('konqueror')){	browser = "Konqueror";	OS = "Linux";}else if (checkIt('omniweb')) browser = "OmniWeb"else if (checkIt('opera')) browser = "Opera"else if (checkIt('webtv')) browser = "WebTV";else if (checkIt('icab')) browser = "iCab"else if (checkIt('msie')) browser = "Internet Explorer"else if (!checkIt('compatible')){	browser = "Netscape Navigator"	version = detect.charAt(8);}else browser = "An unknown browser";if (!version) version = detect.charAt(place + thestring.length);if (!OS){	if (checkIt('linux')) OS = "Linux";	else if (checkIt('x11')) OS = "Unix";	else if (checkIt('mac')) OS = "Mac"	else if (checkIt('win')) OS = "Windows"	else OS = "an unknown operating system";}return browser;}function doBrowserCheck(){var ap = getBrowserName();agent_isNS = ap.indexOf('Netscape') >= 0;if (agent_isNS) agent_isIE = false;}function getNavigationStyle(){   navigationStyle = getCookie("navigationStyle");   if (navigationStyle == null) navigationStyle = 0;   else navigationStyle = parseInt(navigationStyle);   return navigationStyle;}function checkNavigationStyle(){   if (getNavigationStyle() == 1) document.preference.newwindow.checked = true;}function openLink(link){    var returnValue = true;    if (navigationStyle == 1)     {	window.open(link.href,"_blank");	returnValue = false;    }    return returnValue;}function setNavigationStyle(input){  setCookie("navigationStyle", input, 365, "/", "sumanasa.com");  navigationStyle = input;}/*window.onload = function(){  breakout_of_frame();  checkNavigationStyle();}*/function changeView(category, viewtype) {	setCookie("viewtype", viewtype, 365, "/");	window.location = "http://www.sumanasa.com" + category;}
