d = document;

ns5 = (d.getElementById&&!document.all)? true:false
ns4 = (d.layers)? true:false
ie4 = (d.all)? true:false
kon = ie4
moz = ns5
gal = ns5

var bname = navigator.appName;
var bplatinit = navigator.appVersion;
var bver = parseInt(navigator.appVersion);

var bplat="other";
var bplatlower=bplatinit.toLowerCase();

var iWidth = 769; //790;
var iTopHeight = 80; //91; //80
var iMiddleHeight = 431; 
var iBottomHeight = 60;

var winWidth = 769; //790;
var winHeight = 565; //571;

if(bplatlower.indexOf('win')!=-1){
	if (ns4){
	winHeight = 565; //575
	iTopHeight = 81; //92; //81
	iMiddleHeight = 431;
	iBottomHeight = 58;
	}
	if (ns5){
	winHeight = 565; //575
	}
}

if(bplatlower.indexOf('mac')!=-1){
	if (ie4){
	winHeight = 555;
	}
	if (ns4){
	iTopHeight = 84; //95; //84
	winHeight = 565; //575
	}
}

if(bplatlower.indexOf('x11')!=-1){
	if (ns4){
	iTopHeight = 84; //95; //84
	winHeight = 565; //575
	}
	if (kon){
	iTopHeight = 92; //103; //92
	iMiddleHeight = 500;
	winWidth = 800;
	winHeight = 630;
	}
}


function getCookie_value_rma(name){
			var cookies = document.cookie;
			
			if (cookies.indexOf(name) != -1){
				var startpos = cookies.indexOf(name)+name.length+1;
				var endpos = cookies.indexOf(";",startpos);
				if (endpos == -1) endpos = cookies.length;
				return unescape(cookies.substring(startpos,endpos));
			}else{
				return false; // the cookie couldn't be found! it was never set before, or it expired.
			}
}



function openRMA(iAssetId)
{

    if (getCookie_value_rma ("loggedin") == 'true')
    {
    
		var openWin;	
		openWin = window.open('/club/take_vote.sps?' + '&assetid=' + iAssetId, 'RMA', 'width='+winWidth+',height='+ winHeight +',top=0,left=0,resizable=no,status=no,location=no,menubar=no');
		openWin.focus();
	}
	else{
	
		window.location='/club/gateway.sps';;
	}
	

	
}


function openRMAnew(rmaurl)
{
	var openWin;	
	openWin = window.open(rmaurl , 'RMA', 'width='+winWidth+',height='+ winHeight +',top=0,left=0,resizable=no,status=no,location=no,menubar=no');
	openWin.focus();
}


function openRMAcat(iCategoryId)
{
	var openWin;
	openWin = window.open(RMA_URL + '&categoryid=' + iCategoryId, 'USTA', 'width='+winWidth+',height='+ winHeight +',top=0,left=0,resizable=no,status=no,location=no,menubar=no');
	openWin.focus();
}