// STUFF FOR LOGIN
function popLogin(){
	if (document.enter.TextBoxUserName.value != ""){
		document.enter.TextBoxPassword.focus();
	}else{
		document.enter.TextBoxUserName.focus();
	}
}

function popForgotPass(){
	//window.open('https://blip.se/person_forgotpass.aspx', '_blank', 'toolbar=0,location=0,status=1');
	var url = 'person_forgotsomething.htm';
	//url = 'person_forgotpass.aspx';
	window.open(url, '_blank', 'toolbar=0,location=0,status=1,width=580,height=440');
}
	
function popRegister(){
	//window.open('https://blip.se/person_forgotpass.aspx', '_blank', 'toolbar=0,location=0,status=1');
//				var url = 'https://blip.se/register/register.aspx';
	var url = '/register/register.aspx';
	window.open(url, '_blank', 'toolbar=0,location=0,status=1,width=580,height=440');
}

function validate(){
	var frm = document.forms[0];
	if(!frm.TextBoxUserName.value){
		return false;
	}
	if(!frm.TextBoxPassword.value){
		return false;
	}
	if(frm.TextBoxPassword.value.length < 4){
		alert('Ditt lösenord är för kort');
		return false;
	}				
	return true;
}

function popRadio(){
	var blipmejl_window = window.open('http://www.nwrweb.com/player/show/nrj.se/nrj.se/64', 'blip_radio', 'width=466,height=334,location=0,toolbar=0');
	blipmejl_window.focus();
}



function poprundtur(sida){
	var popup_url
	popup_url='/sub_sites/walkaround/' + sida + '.htm'
	var blipmejl_window = window.open(popup_url, 'walkaround', 'width=620,height=510,location=0,toolbar=0');
	blipmejl_window.focus();
}
// STUFF FOR BOM
expand = '';
var FirstLoad = '1';


function popBlip(pDesination, pName){
	// Thanks to redRemedy for helping out with the xp sp2-problem!
	var tLoad = '';
	var tName = 'BlipWindow';

	if(pDesination != null){
		tLoad = arguments[0];
	}
	
	if(pName != null){
		tName = pName;
	}
	
	tWindow = window.open('/blipomat/' + tLoad, tName, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=648,height=536');
	if (window.focus) 
	{
		tWindow.focus();
	}				
}



function init(){
	if(expand == '1'){
		toggleFriends();
	}
	
	if(FirstLoad == '1'){
		/*
		if(parent.frames['main'].rd){
			parent.frames['main'].location.href = 	parent.frames['main'].rd;
		}
		*/
	}
}

function LoadFramePage(){
	top.frames['main'].location.href = arguments[0];
}

function isExpanded(){
	if(document.getElementById('blipfriends_2')){
		if(document.getElementById('blipfriends_2').style.display == ''){
			return true;
		}else{
			return false;
		}
	}else{
		return false;
	}
}

function popMail(){
	popBlip('Blipomat_Mail.aspx');
}

function popRadio(){
	var blipmejl_window = window.open('http://www.nwrweb.com/player/show/nrj.se/nrj.se/64', 'blip_radio', 'width=466,height=334,location=0,toolbar=0');
	blipmejl_window.focus();
}

function popAvatar(){
	var avatar_window = window.open('/rsavatar/www/showgame2.aspx', 'blip_avatar', 'width=420,height=420,location=0,toolbar=0');
	avatar_window.focus();
}

function popPH(){
	var avatar_window = window.open('/gamepop_tipsa.aspx?gameid=106&gamename=ParadiseHotel&gametype=inc&gameheight=630&gamewidth=800&firstcolor=scribbleblue_1&secondcolor=couronne_blue_2&gameurl=/rsparadise/showgame.aspx', 'PH', 'width=955,height=644,location=0,toolbar=0');
	avatar_window.focus();
}

function OpenAvatarShop(){
	eval(window.open('/blipomat/blipomat_frameset.aspx?load=blipomat_awards.aspx!shopid=7','Blipomat','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=648,height=536'));
}

function DoRefresh(){
	/*
	if(document.getElementById('blipfriends_2')){
		if(document.getElementById('blipfriends_2').style.display == ''){
			location.href = 'Blipomat_Left.aspx?expand=1&rnd=' + Math.random(999999);
			return;
		}
	}
	if(document.getElementById('blipfav_2')){
		if(document.getElementById('blipfav_2').style.display == ''){
			location.href = 'Blipomat_Left.aspx?expand=2&rnd=' + Math.random(999999);
			return;
		}
	}

	location.href = 'Blipomat_Left.aspx?rnd=' + Math.random(999999);
	return;*/
	
	/*
	document.images['img_b'].src = '/images/blipomat2/bottom3.gif';
	*/
	document.images['reloadPic'].src = '/elements/images/buttons/blipomat/button-refresh-2.png';
	frames.loader_blipfriends.location.href = '/loader_blipfriends.aspx?load=1';
	
}

function hideFriends(){
	document.getElementById('bar_kompis').src = '/images/blipomat2/bar_kompislista_right.gif';
	document.getElementById('blipfriends_2').style.display = 'none';
}

function hideFavs(){
	document.getElementById('bar_favs').src = '/images/blipomat2/bar_favoritspel_right.gif';
	document.getElementById('blipfav_2').style.display = 'none';
}			

function toggleFav(){

	if(document.getElementById('blipfav_2').style.display == ''){
		hideFavs();
	}else{
		hideFriends();
		document.getElementById('bar_favs').src = '/images/blipomat2/bar_favoritspel_down.gif';
		document.getElementById('blipfav_2').style.display = '';
	}

}

function toggleFriends(){

	if(document.getElementById('blipfriends_2').style.display == ''){
		hideFriends();
	}else{
		hideFavs();
		document.getElementById('bar_kompis').src = '/images/blipomat2/bar_kompislista_down.gif';
		document.getElementById('blipfriends_2').style.display = '';
	}

}			
function HideContent(d) {
	document.getElementById(d).style.display = "none";
	document.getElementById('friendsandgamebuttons').style.display = "block";
	document.getElementById('avatarImgAndMembername').style.display = "block";
}
function ShowContent(d) {
	document.getElementById(d).style.display = "block";
	document.getElementById('friendsandgamebuttons').style.display = "none";
	document.getElementById('avatarImgAndMembername').style.display = "none";
}
function popNote(){
	eval(window.open('/blipomat/Blipomat_Note.aspx','BlipNote','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=580,height=190'));
}