
function openpopup(url,win_width,win_height){
winpops=window.open(url,"","width="+win_width+",height="+win_height+",resizable,scrollbars,left=25,top=25")
}

function openExtWin(url) {
var width = 800; var height = 600
if (screen.width < 801) {width = screen.width - 80}
else {width = 800}
if (screen.height < 601) {height = screen.height -50}
else {height = 600}
page = window.open(url,"","width="+width+",height="+height+",resizable,scrollbars=1,left=25,top=25")
}

function SetCookie(NameOfCookie, value) 
{  var ExpireDate = new Date ();
  ExpireDate.setTime(ExpireDate.getTime() + (365 * 24 * 3600 * 1000));
  document.cookie = NameOfCookie + "=" + escape(value) + 
  ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

var never = new Date()
never.setTime(never.getTime() + 2000*24*60*60*1000);

// name is a string of the name of your cookie
// value is the value corresponding to name

function SetCookie(name, value) {
 var expString = "; expires=" + never.toGMTString();
 document.cookie = name + "=" + escape(value) + expString;
}

function GetCookie(name) {
 var result = null;
 var myCookie = " " + document.cookie + ";";
 var searchName = " " + name + "=";
 var startOfCookie = myCookie.indexOf(searchName);
 var endOfCookie;
 if (startOfCookie != -1) {
  startOfCookie += searchName.length; // skip past name of cookie
  endOfCookie = myCookie.indexOf(";", startOfCookie);
  result = unescape(myCookie.substring(startOfCookie, endOfCookie));
 }
 return result;
}

function playSound () {		  
 // Sniff for MSIE and if true, write bgsound HTML, else do nothing. 
 var ver = navigator.appVersion;
 if (ver.indexOf("MSIE") != -1)
 {
 document.writeln('<BGSOUND SRC="sound/funfunfun.mid" LOOP="1">');
 }
else
 {
 document.writeln('');
 }
}

//usage:
//<a href="javascript:openExtWin('http://www.yahoo.com/')">Yahoo</a>
//<a href="javascript:openpopup('http://www.yahoo.com/',400,300)">Yahoo</a>

