// cache for getElementById
var elements_cache = new Object();

// functions for getElementById
function getElement(Id)
{
    if (! elements_cache[Id]) {
        elements_cache[Id] = document.getElementById(Id);
    }

    return elements_cache[Id];
}

function getValue(Id)
{
    return getElement(Id).value;
}

function setValue(Id, Value)
{
    getElement(Id).value = Value;
}

//******************************************************************************

function mailLink( strName, strDomain, strLinkText ){
	document.writeln('<a href="mailto:' + strName + '@' + strDomain + '">' + strLinkText + '</a>');
}

// simple email check
function is_valid_email(email) {
    return email.match(/^\s*[a-z0-9_\.\-\+]+\@([a-z0-9-]+\.)+[a-z0-9]{2,}\.?\s*$/i);
}

function crossBrowse(html_part){
	window.scroll(0,1)
	if(html_part==null) {
		if(document.body.scrollTop!='0'){document.body.style.height=''; window.scroll(0,0);  }
		else {document.body.style.height="100%"}
	}
	else {
		if(document.body.scrollTop!='0'){document.getElementById(html_part).style.height=''; window.scroll(0,0); }
		else {document.getElementById(html_part).style.height="100%"}
	}
}


// FLASH

function load_flash(){
	//size_flash=calc_flash_size(width())+''; // All screen
	draw_flash('300', '200', '#6F6F6F', '/content/Flash/pics3',false);
}

function draw_flash(flash_width, flash_height, flash_bgcolor, flash_name,where_flag){
	var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
	if(plugin){
	 plugin=(parseInt(plugin.description.substring(plugin.description.indexOf(".")-1))>=4);
	}
	else if((navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0)&&((navigator.userAgent.indexOf("Windows 95")>=0)||(navigator.userAgent.indexOf("Windows 98")>=0)||(navigator.userAgent.indexOf("Windows NT")>=0))){
	var vb = '<script language="vbscript">\n'
                   + 'if ScriptEngineMajorVersion >= 2 then\n'
                   + '  on error resume next\n'
                   + '  flash = IsObject(CreateObject('
                   + '     "ShockwaveFlash.ShockwaveFlash.'
                   +        5 + '"))\n'
                   + 'end if\n'
                   + '<' + '/script>';
	 if(!where_flag) document.write(vb);
	 else document.getElementById('td_flash').innerHTML=vb;
	 plugin=flash;

	}
	if(plugin){
		if(!where_flag){
			 document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" WIDTH=' + flash_width + ' HEIGHT=' + flash_height+'><PARAM NAME=movie VALUE="' + flash_name + '.swf"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=' + flash_bgcolor + '><PARAM NAME=menu VALUE=false>');
			 document.write('<EMBED src="' + flash_name + '.swf" menu=false quality=high bgcolor=' + flash_bgcolor + ' swLiveConnect=FALSE WIDTH=' + flash_width + '  HEIGHT=' + flash_height+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
			 document.write('</EMBED></OBJECT>');
		}
		else {
			document.getElementById('flash').innerHTML='';
			document.getElementById('flash').innerHTML='<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" WIDTH=' + flash_width + ' HEIGHT=' + flash_height+'><PARAM NAME=movie VALUE="' + flash_name + '.swf"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE=' + flash_bgcolor + '><PARAM NAME=menu VALUE=false>';
			document.getElementById('flash').innerHTML+='<EMBED src="' + flash_name + '.swf" menu=false quality=high bgcolor=' + flash_bgcolor + ' swLiveConnect=FALSE WIDTH=' + flash_width + '  HEIGHT=' + flash_height+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
			document.getElementById('flash').innerHTML+='</EMBED></OBJECT>';
		}
	}
	else {
	 document.write('<img src="/content/Image/flash.jpg" width="301" height="202" /><br />');
	}
}

//********************************************************************************
