function pageSize()
{
	if ( document.title == 'flirttown.net - SexyVote' ) return true;
	var parentObject = parent.document.getElementById('mainFrame');
	if ( !parentObject ) return false;
	var pageSize = document.getElementById('content').offsetHeight;
	if (pageSize > 1500)	{ 
		parentObject.height=(pageSize)+ 50 + "px"; 
		parent.document.getElementById('leftFrame').height=(pageSize)+ 60 + "px";
	}
	else { 
	parentObject.height="1500px"; 
	parent.document.getElementById('leftFrame').height="1500px";
	}
	return true;
}

function setpageSize(x)
{
	var parentObject = parent.document.getElementById('mainFrame');
	if ( !parentObject ) return false;
	parentObject.height=x+"px";
	return true;
}

function pageLoad()
{
	parent.window.scrollTo(0,0);
	if ( !pageSize() )
	{
		//$('m_box').innerHTML='<iframe id="banner_frame" name="banner_frame" src="banner_fullbanner.html" width="468" height="60" scrolling="no" frameborder="0"></iframe>';
		//$('m_box').show();
		if (window.name) 
		{
			var ua = navigator.userAgent.toLowerCase();
			if ( $('inbox_count') ) $('inbox_count').hide();
			if ( ua.indexOf("msie 6") != -1 && $('banner') ) $('banner').style.marginTop="0px"; else $('content').style.top="11px";
			$('content').insert({before:'<a href="#" onclick="self.close()" id="window_close" class="window_close">[Fenster schliessen]</a>'});
			return;
		}
		window.scrollTo(0,0);
		//var uri = window.location.href.split("/");
		//uri = uri[uri.length-1];
		//if ( confirm("Diese Seite geh"+unescape("%F6")+"rt zur www.flirttown.net Hauptseite!\nKlicke auf OK um die korrekte Seite zu "+unescape("%F6")+"ffnen!") ) self.location.href='index.php?ref='+uri;
		return;
	}
	//var dt = document.title;
	//dt = dt.replace(/-/g, '- 21 Mail -');
	//parent.document.title = dt;
	return true;
}

function pageWaitShow() 
{	
	$('overlay').show();
	if ( parent.$('mainFrame') ) {
	var topadd = parent.document.documentElement.scrollTop ? parent.document.documentElement.scrollTop : parent.document.body.scrollTop;
	if ( topadd==0 ) topadd=200;
	} else {
	var topadd = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
	topadd=topadd+200; }
	$('overlay').style.top=topadd+'px';
}

function pageWait(id)
{
	//opacity: 0.6; -moz-opacity: 0.6; filter: alpha(opacity=60);
	if ( id == true ) {	waitTimer = setTimeout("pageWaitShow()", 1500); return; }
	window.clearTimeout(waitTimer);
	$('overlay').hide();
}

function pic_big(id,nr)
{
	var win = window.open('picture_show_big.php?id='+id+'&nr='+nr, 'pic_big', 'width=550,height=600,left=20,top=20,status=no,scrollbars=no,resizable=no');	
	win.focus();
	return false;
}

function pic_big2(id)
{
	var win = window.open('picture_show_big.php?pic='+id, 'pic_big', 'width=550,height=600,left=20,top=20,status=no,scrollbars=no,resizable=no');	
	win.focus();
	return false;
}

function partypics(url)
{
	var fenster = window.open(url, "partypics", "width=890,height=590,status=no,scrollbars=yes,resizable=no,top=0,left=0");
	fenster.focus();
	return false;
}

function party_resize()
{
	if ( window.name == 'partypics' )
	{
		var right = $('pmain').offsetHeight;
		var left = $('pleft').offsetHeight;
		if ( left > right )
		{
			window.resizeTo(900,left+220);
		}
		else
		{
			window.resizeTo(900,right+220);		
		}
	}
}

function profil(url)
{
	var flirttown = window.open(url, "flirttown", "width=600,height=700,status=no,scrollbars=yes,resizable=no,top=0,left=0");
	flirttown.focus();
	return false;
}

function advertise(url)
{
	var flirttown_ad = window.open(url, "flirttown_ad", "width=650,height=750,status=no,scrollbars=yes,resizable=no,top=0,left=0");
	flirttown_ad.focus();
	return false;
}

function window_full(url)
{
	window.open(url, "ext", "width=800,height=600");
}

function load_js(url,name)
{
	name = 'js_'+name;
	if ( $(name) ) return;
	var newScript = document.createElement('script');
	newScript.setAttribute('id',name);
	newScript.setAttribute('language','javascript');
	newScript.setAttribute('type','text/javascript');
	newScript.setAttribute('src',url);
	document.getElementsByTagName('head')[0].appendChild(newScript);
}

function no_login() { pageWait(false); alert('Bitte einloggen oder registrieren!'); }

function page_refresh() 
{
	parent.leftFrame.location.reload();
	parent.rightFrame.location.reload();
}

function page_reload() 
{
	pageWaitShow();
	self.location.href=window.location.href;
}

function page_reload_ref() 
{
	parent.self.location.href='index.php'
}

function a()
{
	if ( par = parent.window ) 
	{
		//par.scrollTo(0,0);
		pageWait(true);
	}
}