// JavaScript Document

// browser detection:
var ua = navigator.userAgent;
var ns = (navigator.appName.toLowerCase().indexOf("netscape")!=-1)?1:0;
var ns4 = (document.layers)?1:0;
var ns6 = (document.getElementById && ns)?1:0;
var mac = (navigator.userAgent.toLowerCase().indexOf("mac")!=-1)?1:0;
var macie4 = (mac && !ns && parseInt(ua.substr(ua.indexOf("MSIE")+4,2)) <= 4)?1:0;
var macie = (mac && !ns)?1:0;


//getting the content height:
var contW="100%"
function GetContentH(){
	if (ns) {
				contW=parseInt(window.innerWidth-751)
				contW=parseInt(contW/2);
				if (contW<0)
				{
					contW=0;
				}
				
			}
	else
			{				
				contW=parseInt((document.body.clientWidth-751))
				contW=parseInt(contW/2);
				if (contW<0)
				{
					contW=0;
				}
			}
}

FixNSWindow();
function FixNSWindow() {
	if (ns6 || ns && (parseInt(navigator.appVersion) == 4)) {
		if (typeof document.NS == 'undefined') document.NS = new Object;
		if (typeof document.NS.NS_scaleFont == 'undefined') {
			document.NS.FixCssInNS = new Object;
			document.NS.FixCssInNS.initWindowWidth = window.innerWidth;
			document.NS.FixCssInNS.initWindowHeight = window.innerHeight;
		}
		window.onresize = FixCssInNS;
	}
}
function FixCssInNS() {
	if (document.NS.FixCssInNS.initWindowWidth != window.innerWidth || document.NS.FixCssInNS.initWindowHeight != window.innerHeight) document.location = document.location;
}
ReloadWindow();
function ReloadWindow(){if (!ns) setTimeout("window.onresize=new Function('window.location.reload()')",200);}

// <<< END: maximaixe an image Funcion


var newWinImg;
// <<< END: fixing the page content on resize
function OpenImage(imgFile){
	if (new String(newWinImg)!="undefined" && newWinImg!=null) if (!newWinImg.closed) newWinImg.close();
	var newWinImg=window.open("","ReservedItemsPicture","width=200,height=150,top=0,left=0,location=no,directories=no,hotkeys=no,copyhistory=no,resizable=no,menubar=no,status=no,toolbar=no,scrollbars=no,z-lock=yes");
	newWinImg.document.write('<HTML><HEAD><TITLE>Turkish Cyprus.com</TITLE></HEAD><BODY marginwidth=0 marginheight=0 leftmargin=0 topmargin=0 alink="#0033CC bgcolor="#E5F2FF" onload="window.resizeTo(parseInt(document.images[\'img\'].width)+10,parseInt(document.images[\'img\'].height)+10)"><IMG src="' + imgFile + '" name=img></BODY></HTML>')
	newWinImg.document.close()
	newWinImg.focus();
}
