// TODO: remove hard-coded check for remaxin
if (window.top != window) {
	try {
		if (!window.top.location.href && !window.location.href.match(/\/remaxin\/modules\/internet\/search\/frame/gi))
			window.top.location.replace(window.location);
	} catch (e) {
		if (!window.location.href.match(/\/remaxin\/modules\/internet\/search\/frame/gi))
			window.attachEvent('onload', denied);
	}
	
	
	/*var Request=false;
	if(window.XMLHttpRequest){
		try{
			Request=new XMLHttpRequest();
		}catch(e){
			Request=false;
		}
	}else if(window.ActiveXObject){
		try{
			Request=new ActiveXObject('Msxml2.XMLHTTP');
		}catch(e){
			try{
				Request=new ActiveXObject('Microsoft.XMLHTTP');
			}catch(e){
				Request=false;
			}
		}
	}
	
	var frameHost = window.top.location.host ? window.top.location.host : '[?-access denied]';
	
	if (Request) {
		Request.open('GET', '/proxy/framing.aspx?th=' + frameHost + '&wh=' + window.location.host);
		Request.send(null);
	}*/
}

function denied() {
	document.write('Permission Denied.');
	var link = document.createElement('a');
	link.href = window.location;
	link.target = '_top';
	link.appendChild(document.createTextNode(window.location));
	var space = String.fromCharCode(160)
	document.body.appendChild(document.createTextNode(space + 'Try' + space));
	document.body.appendChild(link);
}

var agt = navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);

// Check Platform
var is_win = (agt.indexOf("win") != -1);
var is_mac = (agt.indexOf("mac") != -1);

// Check Browser
var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ns = (agt.indexOf("netscape") != -1);

// Check MSIE Version
var is_ie5_2 = (is_ie && (agt.indexOf("msie 5.2") != -1));
var	is_ie5_5 = (is_ie && (agt.indexOf("msie 5.5") != -1));
var is_ie6 = (is_ie && (agt.indexOf("msie 6.0") != -1));
var is_ie7 = (is_ie && (agt.indexOf("msie 7.0") != -1));
var is_ie8 = (is_ie && (agt.indexOf("msie 8.0") != -1));
var is_compatibleIE = ((is_win && (is_ie5_5 || is_ie6 || is_ie7 || is_ie8)) || (is_mac && is_ie5_2));

// Check Netscape Version
var is_ns6_2 = (agt.indexOf("netscape6/6.2") != -1);
var is_ns7 = (agt.indexOf("netscape/7") != -1);
var is_ns5bsd = (agt.indexOf("freebsd 5") != -1);
var is_compatibleNS = (is_ns6_2 || is_ns7 || is_ns5bsd);

// Check Safari Version
var is_safari = (agt.indexOf("safari") != -1);

// Check Mozilla Version
var is_firefox = (agt.indexOf("firefox") != -1);

// Check Other Platforms
var is_supportedOS = (is_win || is_mac)

// Check Other Browsers
var	is_supportedBwsr = (is_ie || is_ns || is_safari || is_firefox)