/* Tag */

function v5_tags_show(tag_name)
{
	var reg = new RegExp("(_)", "g");
	return (tag_name.replace(reg," "));	
}
function v5_tags_internal(tag_name)
{
	var reg = new RegExp("( )", "g");
	return (tag_name.replace(reg,"_"));	
}

/* Profile page */

function profile_send()
{
	$('profile_result0').style.display = 'none';
	new Effect.Fade( $('profile_result0'), {duration:1.0} );
	
	var dyn_txt = $('profile_free').value;
	makeRequestUTF3('/lib/lib_post__profile.php?func=set_freebox', 'free', urlEncode(dyn_txt), 'profile_result', 'profile_wait(0)' );
}

function profile_wait(mode)
{
	if ( mode == '0' )
	{
		new Effect.Appear( $('profile_result'), {duration:1.0} );
		setInterval("profile_wait(1)", 3000);
	}
	else {
		new Effect.Fade( $('profile_result') );
		new Effect.Appear( $('profile_result0') );
	}
}

/* **************** */

var regExpBeginning = /^\s+/;
var regExpEnd       = /\s+$/;

// Supprime les espaces inutiles en début et fin de la chaîne passée en paramètre.
function trim(aString) {
  return aString.replace(regExpBeginning, "").replace(regExpEnd, "");
}

// Supprime les espaces inutiles en début de la chaîne passée en paramètre.
function ltrim(aString) {
  return aString.replace(regExpBeginning, "");
}

// Supprime les espaces inutiles en fin de la chaîne passée en paramètre.
function rtrim(aString) {
  return aString.replace(regExpEnd, "");
} 


function tagtrim(tag) {
	var reg = new RegExp("(,)", "g");
	return trim(tag.replace(reg,""));	
}

function doNothing() { }



/********************/



function meetBar_send()
{
	var dyn_txt = document.getElementById('kinode_txt').value;
	makeRequestXML('/lib/lib_post__meetbar.php?func=send_kinode&kinode_txt='+urlEncode(dyn_txt)+'&kinode_to='+$('kinode_to').value+'&kinode_unames='+$('kinode_unames').value , 'empty');
	document.getElementById('kinode_txt').value = '';
}

function meetBar_get()
{
	makeRequestUTF_Call('/lib/lib_post__meetbar.php?func=getMeetBox&fck_ie='+Math.random(), 'MeetBox_GetMsg', 'doNothing');	
}

function meetBar_launch()
{
	meetBar_get();
	setInterval("meetBar_get()", 30000);
}

//

// Show a waiting animation
function prepare_ajax_js(div_id)
{
	document.getElementById(div_id).innerHTML = '<p align="center"><img src="/img/loading.gif" /></p>';
}

// Removes all options from a select
function clearOptions(field_name)
{
	var field_length = document.getElementById(field_name).length;
	for (i=0 ; i<field_length ; i++)
	{
		document.getElementById(field_name).remove(0);
		//document.getElementById(field_name).options[0] = null;
	}
	document.getElementById(field_name).length = 0;
}

// Add an option to a select
function addOption(field_name, num, valeur, text)
{
	var elOptNew = document.createElement('option'); 
	elOptNew.text = text;
	elOptNew.value = valeur; 	
	var elOptOld = document.getElementById(field_name).options[num]; 
	
	try
	{
		document.getElementById(field_name).add(elOptNew, elOptOld);
	}
	catch(ex) // for IE
	{
		document.getElementById(field_name).add(elOptNew, num);
	}
}

function encode_utf8( s )
{
  return unescape( encodeURIComponent( s ) );
}

function decode_utf8( s )
{
  return decodeURIComponent( escape( s ) );
}


// This code was written by Tyler Akins and has been placed in the
// public domain.  It would be nice if you left this header intact.
// Base64 code from Tyler Akins -- http://rumkin.com





function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function giveMsg(val){
  document.getElementById("messageNotify").innerText=val;
}


//
//
//


var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

function encode64(input) {
   var output = "";
   var chr1, chr2, chr3;
   var enc1, enc2, enc3, enc4;
   var i = 0;

   do {
      chr1 = input.charCodeAt(i++);
      chr2 = input.charCodeAt(i++);
      chr3 = input.charCodeAt(i++);

      enc1 = chr1 >> 2;
      enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
      enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
      enc4 = chr3 & 63;

      if (isNaN(chr2)) {
         enc3 = enc4 = 64;
      } else if (isNaN(chr3)) {
         enc4 = 64;
      }

      output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + 
         keyStr.charAt(enc3) + keyStr.charAt(enc4);
   } while (i < input.length);
   
   return output;
}

function decode64(input) {
   var output = "";
   var chr1, chr2, chr3;
   var enc1, enc2, enc3, enc4;
   var i = 0;

   // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
   input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

   do {
      enc1 = keyStr.indexOf(input.charAt(i++));
      enc2 = keyStr.indexOf(input.charAt(i++));
      enc3 = keyStr.indexOf(input.charAt(i++));
      enc4 = keyStr.indexOf(input.charAt(i++));

      chr1 = (enc1 << 2) | (enc2 >> 4);
      chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
      chr3 = ((enc3 & 3) << 6) | enc4;

      output = output + String.fromCharCode(chr1);

      if (enc3 != 64) {
         output = output + String.fromCharCode(chr2);
      }
      if (enc4 != 64) {
         output = output + String.fromCharCode(chr3);
      }
   } while (i < input.length);

   return output;
}


//
//
//



function base64_encodeUrl(input) {
   var output = "";
   var chr1, chr2, chr3;
   var enc1, enc2, enc3, enc4;
   var i = 0;

   do {
      chr1 = input.charCodeAt(i++);
      chr2 = input.charCodeAt(i++);
      chr3 = input.charCodeAt(i++);

      enc1 = chr1 >> 2;
      enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
      enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
      enc4 = chr3 & 63;

      if (isNaN(chr2)) {
         enc3 = enc4 = 64;
      } else if (isNaN(chr3)) {
         enc4 = 64;
      }

      output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + 
         keyStr.charAt(enc3) + keyStr.charAt(enc4);
   } while (i < input.length);
   
   output = output.replace(/\+/g,"*");
   output = output.replace(/\//g,"-");
   output = output.replace(/\=/g,"");
   
   return output;
}

function base64_decodeUrl(input) {
   var output = "";
   var chr1, chr2, chr3;
   var enc1, enc2, enc3, enc4;
   var i = 0;

   input = input.replace(/\*/g,"+");
   input = input.replace(/\-/g,"/");

   // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
   input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

   do {
      enc1 = keyStr.indexOf(input.charAt(i++));
      enc2 = keyStr.indexOf(input.charAt(i++));
      enc3 = keyStr.indexOf(input.charAt(i++));
      enc4 = keyStr.indexOf(input.charAt(i++));

      chr1 = (enc1 << 2) | (enc2 >> 4);
      chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
      chr3 = ((enc3 & 3) << 6) | enc4;

      output = output + String.fromCharCode(chr1);

      if (enc3 != 64) {
         output = output + String.fromCharCode(chr2);
      }
      if (enc4 != 64) {
         output = output + String.fromCharCode(chr3);
      }
   } while (i < input.length);

   return output;
}



function urlDecode(str){
    str=str.replace(new RegExp('\\+','g'),' ');
    return unescape(str);
}
function urlEncode(str){
    str=escape(str);
    str=str.replace(new RegExp('\\+','g'),'%2B');
    return str.replace(new RegExp('%20','g'),'+');
}






function askConfirm(msg)
{
	if ( window.confirm(msg) )
	{
		return true;
	}
	else
	{
		return false;
	}
}



function communities__toggleModify(way,g,cid)
{
	if ( way == 'modify' ) {
		document.getElementById('currentPanel'+g).style.visibility = "hidden";
		document.getElementById('modifyPanel'+g).style.visibility = "";
		document.getElementById('currentPanel'+g).style.height = "0px";
		document.getElementById('modifyPanel'+g).style.height = "20px";
	}
	else
	{
		document.getElementById('currentPanel'+g).style.visibility = "";
		document.getElementById('modifyPanel'+g).style.visibility = "hidden";
		document.getElementById('currentPanel'+g).style.height = "20px";
		document.getElementById('modifyPanel'+g).style.height = "0px";
		document.getElementById('modifyPanelButton'+g).innerHTML = "Wait...";
		//makeRequest('/var/www/kiweo/lib/lib_post.php?func=betaUpdateRow&tableName=eurowave_communities' + 
		//			'&column=community_desc&whereColumn=community_code&whereValue=' + cid ,'modifyPanelButton'+g)
		// '' , '' , '' 
		
		
	}
}




function getCookie(name) {
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
    return unescape(dc.substring(begin + prefix.length, end));
}


function setCookieOption(cookieName,cookieVal)
{
	var argv=setCookieOption.arguments;
	var argc=setCookieOption.arguments.length;
	var expires=(argc > 2) ? argv[2] : null;
	var path=(argc > 3) ? argv[3] : null;
	var domain=(argc > 4) ? argv[4] : null;
	var secure=(argc > 5) ? argv[5] : false;
	document.cookie=cookieName+"="+escape(cookieVal)+
		((expires==null) ? "" : ("; expires="+expires.toGMTString()))+
		((path==null) ? "" : ("; path="+path))+
		((domain==null) ? "" : ("; domain="+domain))+
		((secure==true) ? "; secure" : "");	
	
}




function showLayerInCollection(collection, display_id)
{
	
	collection = collection + '_';
	var divArray = document.getElementsByTagName('div');
	var ns = collection.length;
	for (var i = 0; i < divArray.length; i++)
	{			
		if ( divArray[i].getAttribute('id') != null )
		{	
			dnm  = divArray[i].getAttribute('id').substr(0, ns);
			did  = divArray[i].getAttribute('id').substr(ns, 2);	
			
			if ( ( dnm == collection ) && ( did != display_id ) )
				divArray[i].style.display = 'none';
			else if ( ( dnm == collection ) && ( did == display_id ) )
				divArray[i].style.display = '';
			
		}
	}
	
	return false;
	
}


function highlighLayerInCollection(collection, button_id)
{


	collection = collection + '_';
	var divArray = document.getElementsByTagName('div');
	var ns = collection.length;
	for (var i = 0; i < divArray.length; i++)
	{			
		if ( divArray[i].getAttribute('id') != null )
		{	
			dnm  = divArray[i].getAttribute('id').substr(0, ns);
			did  = divArray[i].getAttribute('id').substr(ns, 2);	
			
			if ( ( dnm == collection ) && ( did != button_id ) )
			{
				divArray[i].style.borderWidth = '';
				divArray[i].style.borderStyle = '';
				divArray[i].style.borderColor = '';
				divArray[i].style.backgroundColor = '';
				divArray[i].style.padding = '0px';	
			}
			else if ( ( dnm == collection ) && ( did == button_id ) )
			{
				divArray[i].style.borderWidth = '1px';
				divArray[i].style.borderStyle = 'solid';
				divArray[i].style.borderColor = globalHighColor;
				divArray[i].style.backgroundColor = '#FFFFFF';
				divArray[i].style.padding = '1px';	
			}
			
		}
	}
	
	return false;

}



function showLayerInCollection2(collection, display_id, callurl)
{
	
	collection = collection + '_';
	var divArray = document.getElementsByTagName('div');
	var ns = collection.length;
	for (var i = 0; i < divArray.length; i++)
	{			
		if ( divArray[i].getAttribute('id') != null )
		{	
			dnm  = divArray[i].getAttribute('id').substr(0, ns);
			did  = divArray[i].getAttribute('id').substr(ns, 2);	
			
			if ( ( dnm == collection ) && ( did != display_id ) )
				divArray[i].style.display = 'none';
			else if ( ( dnm == collection ) && ( did == display_id ) )
			{
				divArray[i].style.display = '';
				if ( callurl != '' )
					makeRequestUTF('/lib_post.php?func='+callurl+'&fck_ie='+Math.random(), divArray[i].getAttribute('id'));	
			}
			
		}
	}
	
	return false;
	
}










/*
function showThemeXChanger()
{
	document.getElementById('ThemeXChanger').style.display = '';
	var posX = globalPosX-355;
	var posY = globalPosY-40;
	document.getElementById('ThemeXChanger').style.left = posX+'px';
	document.getElementById('ThemeXChanger').style.top  = posY+'px';
}
function closeThemeXChanger()
{
	parent.document.getElementById('ThemeXChanger').style.display = 'none';
}
*/

function imStillHere()
{	
	setTimeout( 'imStillHere()', 30000);
	ajax_StillHere('/lib/lib_post__online.php?func=im_online&fck_ie='+Math.random());
}



var http_request_b = false;
function ajax_StillHere(url)
{
	//alert('wake up');
	
	http_request_b = false;

	if (window.XMLHttpRequest)
	{ // Mozilla, Safari,...
		http_request_b = new XMLHttpRequest();
		if (http_request_b.overrideMimeType)
		{
			http_request_b.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject)
	{ // IE
		try
		{
			http_request_b = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				http_request_b = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if (!http_request_b)
	{
		alert('Sorry, unable to create the page. Please update your browser (www.getfirefox.com). (Error with XMLHTTP)');
		return false;
	}
	http_request_b.open('GET', url, true);
	http_request_b.onreadystatechange = processNewMessages; //alertContentsURL;
	http_request_b.send(null);

}

		
function processNewMessages()
{
	if (http_request_b.readyState == 4)
	{
		if (http_request_b.status == 200)
		{			
			var xmldoc = http_request_b.responseXML;
			var root_node = xmldoc.getElementsByTagName('root').item(0);
			if ( document.getElementById('NewMsgBox') != undefined )
				document.getElementById('NewMsgBox').innerHTML = '';
			if ( root_node != undefined )
			{
				var rcvd = decode_utf8( root_node.firstChild.data );
				if ( ( rcvd != 'no' ) && ( rcvd != undefined ) )
				{
					if ( document.getElementById('NewMsgBox') != undefined )
						document.getElementById('NewMsgBox').innerHTML = ' ('+rcvd+'!)';
				}
			}				
		} else {
			//alert('Sorry, an error has been detected. Please try again later...');
		}
	}
}


function togglePlopH(plop)
{
	if ( document.getElementById(plop).style.visibility == 'hidden' )
		document.getElementById(plop).style.visibility = 'block';
	else
		document.getElementById(plop).style.visibility = 'hidden';
}

function togglePlop(plop)
{
	if ( document.getElementById(plop).style.display == 'none' )
		document.getElementById(plop).style.display = '';
	else
		document.getElementById(plop).style.display = 'none';
}


function togglePlopv4(plop)
{
	if ( document.getElementById(plop).style.display == 'none' )
		new Effect.BlindDown( document.getElementById(plop) );
	else
		new Effect.Fade( document.getElementById(plop) );
		
	return false;
}




function sd(dn)
{
	document.getElementById(dn).style.display = '';
}



var global_ad_it = 0;


function lopt(flash)
{

}








var KiweoHelper = 'KiweoHelper';
var Opacify = true;
var Top = true;
var g_size_width = 400;
var g_size_height = 400;
var g_size_changed=0;
function goHelper(p,e)
{
	size_width = 400;
	size_height = 400;

	if ( p == 'themev4' )
	{
		size_width = 400;
		size_height = 400;
		KiweoHelper = 'KiweoHelper';
		document.getElementById('KiweoHelper').innerHTML = '<iframe src="/fr/change_theme_k.php?default_bgcolor='+encodeURIComponent(e[0])+'&default_stylep='+e[1]+'&baseUrl='+e[2]+'" frameborder="0" width="400" height="400" scrolling="no"></iframe>';
	}
	else if ( p == 'helperv4' )
	{
		size_width = 450;
		size_height = 400;
		KiweoHelper = 'KiweoHelper';
		document.getElementById('KiweoHelper').innerHTML = '<iframe src="/fr/change_helper.php'+(e)+'" frameborder="0" width="450" height="400" scrolling="auto"></iframe>';
	}
	else if ( p == 'spaces' ) 
	{
		size_width = 400;
		size_height = 400;
		KiweoHelper = 'KiweoHelper';
		document.getElementById('KiweoHelper').innerHTML = '<iframe src="/fr/change_space.php" frameborder="0" width="400" height="400" scrolling="no"></iframe>';
	}
	else if ( p == 'space_freetext' )
	{
		size_width = 550;
		size_height = 430;
		KiweoHelper = 'KiweoHelper';
		document.getElementById('KiweoHelper').innerHTML = '<iframe src="/fr/change_space_text.php" frameborder="0" width="550" height="430" scrolling="no"></iframe>';
	}
	else if ( p == 'blog_comment' )
	{
		size_width = 550;
		size_height = 400;
		KiweoHelper = 'comments_div';
	}
	else if ( p == 'blog_comment2' )
	{
		size_width = 700;
		size_height = 300;
		document.getElementById('KiweoHelper').innerHTML = '<iframe src="/fr/change_comments.php?aid='+e[0]+'&blog_id='+e[1]+'&sid='+e[2]+'" frameborder="0" width="700" height="300" scrolling="no"></iframe>';
	}
	else if ( p == 'music_comment2' )
	{
		size_width = 700;
		size_height = 300;
		document.getElementById('KiweoHelper').innerHTML = '<iframe src="/fr/change_comments.php?music_id='+e[0]+'" frameborder="0" width="700" height="300" scrolling="no"></iframe>';	
	}

	else if ( p == 'friends' )
	{
		size_width = 400;
		size_height = 200;
		document.getElementById('KiweoHelper').innerHTML = '<iframe src="/fr/change_friends.php?action='+e[0]+'&uid='+e[1]+'&uname='+e[2]+'" frameborder="0" width="400" height="200" scrolling="no"></iframe>';
	}

	else if ( p == 'msg' )
	{
		size_width = 400;
		size_height = 200;
		document.getElementById('KiweoHelper').innerHTML = '<iframe src="/fr/change_msg.php?action='+e[0]+'&p1='+e[1]+'&p2='+e[2]+'" frameborder="0" width="400" height="200" scrolling="no"></iframe>';
	}
	
	
	else if ( p == 'profile_ident' )
	{
		size_width = 600;
		size_height = 400;
		document.getElementById('KiweoHelper').innerHTML = '<iframe src="/fr/ident_modify.php?ajax=true" frameborder="0" width="600" height="400" scrolling="yes"></iframe>';
	}
	else if ( p == 'profile_geo' )
	{
		size_width = 600;
		size_height = 420;
		document.getElementById('KiweoHelper').innerHTML = '<iframe src="/fr/home_modify.php?ajax=true&ajax_close_reload=true" frameborder="0" width="600" height="420" scrolling="yes"></iframe>';
	}
	else if ( p == 'profile_school' )
	{
		size_width = 600;
		size_height = 420;
		document.getElementById('KiweoHelper').innerHTML = '<iframe src="/fr/meet_school.php?ajax=true&ajax_close_reload=true" frameborder="0" width="600" height="420" scrolling="yes"></iframe>';
	}
	
	
	g_size_width = size_width;
	g_size_height = size_height;
	
	shadowType=2;
	shadow_showImg();
	
}

function exitHelper()
{
    var D = getFramePageDimensions();
	pageWidth = D[0];
	pageHeight = D[1];
	
	window.onresize = doNothing; // function() { return true; }
	
	document.getElementById('KiweoHelper').style.position = '';
	document.getElementById('KiweoHelper').style.width = '';
	document.getElementById('KiweoHelper').style.height = '';
	document.getElementById('KiweoHelper').style.marginTop = '';
	document.getElementById('KiweoHelper').style.marginLeft = '';
	document.getElementById('KiweoHelper').style.left = '';
	document.getElementById('KiweoHelper').style.top = '';
	document.getElementById('KiweoHelper').style.display = '';
	document.getElementById('KiweoHelper').style.backgroundColor = '';
	document.getElementById('KiweoHelper').style.display = 'none';
	

	document.getElementById('MainContenerDiv').style.backgroundColor = '';	
	document.getElementById('MainContenerDiv').style.height = '';
	document.getElementById('MainContenerDiv').style.position = 'relative';
	document.getElementById('MainContenerDiv').style.width = (pageWidth-20) + 'px';
	document.getElementById('CommonStream').style.width = (pageWidth-20) + 'px';
	
	SetOpacity( document.getElementById('CommonStream'), 100);
	
	var h1Array = document.getElementsByTagName('h1');
	for (var i=0; i<h1Array.length; i++)
	{					
		dynid = h1Array[i].style.display = '';
	}
	

	if ( document.getElementById('flashcontent1') != null )
		document.getElementById('flashcontent1').style.display = '';
	
}
function frameExitHelper()
{

	parent.shadow2_cacherImage();
	
	return;
}

function frameExitHelperReload()
{
	//parent.shadow2_cacherImage();
	parent.frameReload();
	return;
}
function frameReload()
{
window.location.replace(window.location);	
}

function frameHideElem(eid)
{
	new Effect.Fade( $(eid) );
}




function getPageDimensions() {
    var xScroll, yScroll;
    if (window.innerHeight && window.scrollMaxY) {
        xScroll = document.body.scrollWidth;
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight > document.body.offsetHeight) {
        xScroll = document.body.scrollWidth;
        yScroll = document.body.scrollHeight;
    } else {
        xScroll = document.body.offsetWidth;
        yScroll = document.body.offsetHeight;
    }
    var windowWidth, windowHeight;
    if (self.innerHeight) {
        windowWidth = self.innerWidth;
        windowHeight = self.innerHeight;
    } else if (document.documentElement && document.documentElement.clientHeight) {
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;
    } else if (document.body) {
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;
    }
    if (yScroll < windowHeight) {
        pageHeight = windowHeight;
    } else {
        pageHeight = yScroll;
    }
    if (xScroll < windowWidth) {
        pageWidth = windowWidth;
    } else {
        pageWidth = xScroll;
    }
	//return Array(pageWidth, pageHeight);
	return Array(windowWidth, windowHeight);
}


function getFramePageDimensions() {
    var xScroll, yScroll;
    if (window.innerHeight && window.scrollMaxY) {
        xScroll = parent.document.body.scrollWidth;
        yScroll = window.innerHeight + window.scrollMaxY;
    } else if (parent.document.body.scrollHeight > parent.document.body.offsetHeight) {
        xScroll = parent.document.body.scrollWidth;
        yScroll = parent.document.body.scrollHeight;
    } else {
        xScroll = parent.document.body.offsetWidth;
        yScroll = parent.document.body.offsetHeight;
    }
    var windowWidth, windowHeight;
    if (self.innerHeight) {
        windowWidth = self.innerWidth;
        windowHeight = self.innerHeight;
    } else if (parent.document.documentElement && parent.document.documentElement.clientHeight) {
        windowWidth = parent.document.documentElement.clientWidth;
        windowHeight = parent.document.documentElement.clientHeight;
    } else if (parent.document.body) {
        windowWidth = parent.document.body.clientWidth;
        windowHeight = parent.document.body.clientHeight;
    }
    if (yScroll < windowHeight) {
        pageHeight = windowHeight;
    } else {
        pageHeight = yScroll;
    }
    if (xScroll < windowWidth) {
        pageWidth = windowWidth;
    } else {
        pageWidth = xScroll;
    }
	return Array(pageWidth, pageHeight);
}


function InlayHelper_Close()
{
	document.getElementById('KiweoInlayHelper').style.display = 'none';	
}
function InlayHelperParent_Close()
{
	parent.document.getElementById('KiweoInlayHelper').style.display = 'none';	
}
function InlayHelper_Open()
{
	var posLeft = Math.round((windowW-600)/2);
	var posTop  = scrollH + Math.round((windowH-300)/2) - 30;
	document.getElementById('KiweoInlayHelper').style.display = '';
	document.getElementById('KiweoInlayHelper').style.width = '600px';
	document.getElementById('KiweoInlayHelper').style.height= '300px';
	document.getElementById('KiweoInlayHelper').style.top = posTop + 'px';
	document.getElementById('KiweoInlayHelper').style.left = posLeft + 'px';
}


function ctgmp()
{
	g_size_changed=0;	
}

doNothing = function()
{
	return true;	
}


function enlargePicture(sPicURL) {
	window.open("/enlarge.php?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}