
function popup(url,name,width,height,wplus,hplus,focus,left,top,menubar,status,toolbar,scrollbar,resizable,scrx,scry,directories,loc) {
	if ( !url ) return false;
	if ( !name ) name = 'popupWin';
	if ( !width ) width = '';
	if ( !height ) height = '';
	if ( !directories ) directories = 'no';
	if ( !loc ) loc = 'no';
	if ( !menubar ) menubar = 'no';
	if ( !status ) status = 'no';
	if ( !toolbar ) toolbar = 'no';
	if ( !scrollbar ) scrollbar = 'no';
	if ( !resizable ) resizable = 'no';
	if ( !scrx ) scrx = '100';
	if ( !scry ) scry = '100';
	if ( !left ) left = '100';
	if ( !top ) top = '100';
	if ( wplus ) width  += wplus;
	if ( hplus ) height += hplus;

    var popupWin = window.open(url,name,'width='+width+'px,height='+height+'px,left='+left+',top='+top+',menubar='+menubar+',status='+status+',toolbar='+toolbar+',scrollbars='+scrollbar+',resizable='+resizable+',screenX='+scrx+',screenY='+scry+'directories='+directories+',location='+loc);

	if ( focus ) popupWin.focus();
}

function copyField(from, to) {
  document.getElementById(to).value = document.getElementById(from).value;
}

function set(input) {

  input.value = '';
}

function leave(input) {

  input.value = (input.value == '') ? input.defaultValue : input.value;
}
function changeImage(img, img_src) {

  img.src = img_src;
}

function rpc(str){
    head = document.getElementsByTagName('head').item(0);
    script=document.createElement('script');
    script.src= str;
    script.type='text/javascript';
    script.defer=true;
    void(head.appendChild(script));
}

function menuOver( img ) {
	document.getElementById(img).src = 'gfx/menu/' + img + '_hover.gif';
}

function menuOut( img ) {
	document.getElementById(img).src = 'gfx/menu/' + img + '.gif';
}

function menuOveren( img ) {
	document.getElementById(img).src = 'gfx/menu/en/' + img + '_hover.gif';
}

function menuOuten( img ) {
	document.getElementById(img).src = 'gfx/menu/en/' + img + '.gif';
}

function flashDetect () {
	var Flash_contentVersion = 8;
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if ( plugin ) {
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			for (var i = 0; i < words.length; ++i)
			{
			if (isNaN(parseInt(words[i])))
			continue;
			var Flash_PluginVersion = words[i]; 
			}
		var FlashCanPlay = Flash_PluginVersion >= Flash_contentVersion;

		choose( FlashCanPlay );

	} else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write('On Error resume next\n');
		document.write('FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & ' + Flash_contentVersion + ')))\n');
		document.write('choose( FlashCanPlay ) \n');
		document.write('<\/SCR' + 'IPT\> \n');
		
	}
}

function choose( MM_FlashCanPlay ) {
	for (i=0; i<15; i++){
		noFlash('noflash_title'+i, !MM_FlashCanPlay?'block':'none');
		noFlash('flash_title'+i, !MM_FlashCanPlay?'none':'block');
	}
	noFlash('noflash_title_error', !MM_FlashCanPlay?'block':'none');
	noFlash('flash_title_error', !MM_FlashCanPlay?'none':'block');

	for (i=1; i<3; i++){
		noFlash('noflash_top0'+i, !MM_FlashCanPlay?'block':'none');
		noFlash('flash_top0'+i, !MM_FlashCanPlay?'none':'block');
	}
}

function noFlash(id, type) {
	if (document.getElementById(id) !== null){
		document.getElementById(id).style.display = type;
	}
}

