/* JavaScript Function Library */
/* Last Update: 10 February 2010 */

var days=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')
var months=new Array('January','February','March','April','May','June','July','August','September','October','November','December')

function getBrowser() {
	WebBrowser = (navigator.userAgent.indexOf("Opera")!=-1 && document.getElementById) ? "op": (navigator.userAgent.indexOf("Konqueror")!=-1 && document.getElementById) ? "ko" : (document.all) ? "ie" : (document.layers) ? "nn" : (!document.all && document.getElementById) ? "mo" : "";
	}

function settimes(){
	if(navigator.userAgent.indexOf('IRIX') != -1) { 
		var OpSys = "Irix";
    }
	else if(navigator.userAgent.indexOf('Windows CE') != -1) {
		var OpSys = "Windows CE";
	}
	else if(navigator.userAgent.indexOf('Windows 95') != -1) {
		var OpSys = "Windows 95";
	}
	else if(navigator.userAgent.indexOf('Windows 98') != -1) {
		var OpSys = "Windows 98";
	}
	else if(navigator.userAgent.indexOf('Win 9x 4.90') != -1) {
		var OpSys = "Windows ME";
	}
	else if(navigator.userAgent.indexOf('Windows NT 4.0') != -1) {
		var OpSys = "Windows NT";
	}
	else if(navigator.userAgent.indexOf('Windows NT 5.0') != -1) {
		var OpSys = "Windows 2000";
	}
	else if(navigator.userAgent.indexOf('Windows NT 5.1') != -1) {
		var OpSys = "Windows XP";
	}
	else if(navigator.userAgent.indexOf('Windows NT 6.0') != -1) {
		var OpSys = "Windows Vista";
	}
	else if(navigator.userAgent.indexOf('Windows NT 6.1') != -1) {
		var OpSys = "Windows 7";
	}
	else if(navigator.userAgent.indexOf('Windows') != -1) {
		var OpSys = "Microsoft Windows";
	}
	else if(navigator.userAgent.indexOf('Mac') != -1) {
		var OpSys = "Macintosh";
	}
	else if(navigator.userAgent.indexOf('Chrome') != -1) {
		var OpSys = "Google Chrome";
	}
	else {
		var OpSys = "Other";
	}
	bversion=navigator.appVersion.split("[");
	if (WebBrowser=="op"){
		bversion=navigator.appVersion.split("(");
		bversion[1]="Opera "+bversion[0];
	}
	info=navigator.appVersion.split(";");
	if(WebBrowser=="mo"){
		nnbrws = navigator.userAgent.split(";");
		if (nnbrws[4])
			if (nnbrws[4].match("Netscape")) {
				nnbrws = nnbrws[4].split("Netscape");
				info[1]= "Netscape"+nnbrws[1];
			}
			else {
				nnbrws = nnbrws[4].split(")");
				info[1]= "Mozilla"+nnbrws[0];
			}
		}
	if (WebBrowser=="op")
		spc='&nbsp;&nbsp;&#8226;&nbsp;&nbsp;'
	else
		spc='&nbsp;&nbsp;&#8226;&nbsp;&nbsp;'
	var time= new Date();
	day=days[time.getDay()];
	nday=time.getDate();
	month=months[time.getMonth()];
	year= eval(time.getYear());
	if (year<1900)
		year=1900+eval(year);
	if (WebBrowser=="mo" || WebBrowser=="op")
		Stats = document.getElementById("Stats");
	if (WebBrowser=="nn")
		Stats = document.layers['nStats'];
	if (WebBrowser=="ie" || WebBrowser=="mo")
		Stats.innerHTML='&nbsp;&nbsp;'+day+", "+nday+" "+month+" "+year+spc+'OS : '+OpSys+spc+'Browser : '+info[1]+spc+'Color Depth : '+screen.colorDepth+' bit&nbsp;&nbsp;';
	else {
		if (WebBrowser=="nn")
			Stats.document.write(spc+'<Span class="time">'+day+', '+nday+' '+month+' '+year+spc+'OS : '+OpSys+spc+'Browser : '+navigator.appName+' '+bversion[0]+spc+'Color Depth : '+screen.pixelDepth+' bit</Span>&nbsp;&nbsp;')
		else
			Stats.document.write('<Span class="time" style="position:relative;top:2px">'+spc+day+', '+nday+' '+month+' '+year+spc+'OS : '+OpSys+spc+'Browser : '+navigator.appName+' '+bversion[0]+spc+'Color Depth : '+screen.pixelDepth+' bit'+'</Span>&nbsp;&nbsp;')
		Stats.document.close();
	}
}

function cat_window(url) {
link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=431,height=385,left=80,top=80");
}

function pdf_window(url) {
link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=665,height=500,left=0,top=0");
}

function pop_window(url) {
link = window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=490,height=480,left=0,top=0");
}
