function DDtoDay(inputDate)
{
  var dateString = new Array('','st','nd','rd','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','th','st','nd','rd','th','th','th','th','th','th','th','st');
  returnDate = '';
  tempDate = parseInt(inputDate);
  if (tempDate >= 1 && tempDate <= 31)
  {
	  returnDate = inputDate + dateString[tempDate];
	}
	return returnDate;
}

function getDate() 
{
  var now=new Date();
  var weekday=new Array("Sun","Mon","Tue","Wed", "Thur","Fri","Sat");
  var monthname=new Array("January","February","March", "April","May","June", "July","August","September", "October","November","December");
  return weekday[now.getDay()] + " " + DDtoDay( now.getDate() ) + " " + monthname[now.getMonth()] + " " + now.getFullYear();
}


function redirect(URLStr) { location = URLStr; }

var popUpWin=0;

function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
function copyrightPopup() 
{
  popUpWindow('copyright.htm', 200, 150, 400, 400);
}

function copyrightdate()
{
return 'Copyright:- Molspin Ltd 1998-2010'
}

function PicturePopupWindow(url, winName, w, h, scroll) {

    LeftPosition = (screen.width) ? (screen.width - w) / 2 : 0;
    TopPosition = (screen.height) ? (screen.height - h) / 2 : 0;
    settings =
'height=' + h + ',width=' + w + ',top=' + TopPosition + ',left=' + LeftPosition + ',scrollbars=' + scroll + ',resizable=0,toolbar=0,menubar=0,location=0,directories=0,status=0'
    if (!opener) {
        puWindow = window.open(url, winName, settings);
    }
    else {
        puWindow.close;
        puWindow = window.open(url, winName, settings);
    }
}
