s_formerrors='Debe escribir algún texto para enviar un mensaje';s_gen_error=':: Error ::\n\n';s_url_insert='Inserte la URL (por ejemplo, http://www.phpbb.com/)';s_url_insert_tip='http://';s_url_error='No ha introducido ninguna URL';s_url_title_insert='Escriba el título para el enlace';s_url_title_insert_tip='Enlace';s_url_title_error='No ha escrito el nombre de la página';s_email_insert='Escriba la dirección de correo';s_email_insert_tip='sunombre@sudominio.com';s_email_error='No ha escrito la dirección de correo';s_img_insert='Escriba la URL de la imagen';s_img_error='No ha escrito la URL de la imagen';s_albumimg_insert='Escriba la ID de la imagen del Álbum';s_albumimg_insert_tip='ID';s_albumimg_error='No ha escrito la ID de la imagen del Álbum';s_ram_insert='Por favor, escriba la URL del archivo Real Media';s_stream_insert='Por favor, escriba la URL del archivo de audio';s_video_insert='Por favor, escriba la URL del archivo de vídeo';s_video_w_insert='Por favor, especifique la anchura del vídeo';s_video_w_error='No ha especificado la anchura del vídeo';s_video_h_insert='Por favor, especifique la altura del vídeo';s_video_h_error='No ha especificado la altura del vídeo';s_googlevideo_insert='Por favor, escriba la ID del archivo de Google Vídeo';s_youtube_insert='Por favor, escriba la ID del archivo de YouTube';s_emff_insert='Por favor, escriba la URL del archivo mp3';s_flash_insert='Por favor, escriba la URL de la película Flash';s_flash_w_insert='Por favor, escriba la anchura de la película Flash';s_flash_w_error='No ha especificado la anchura de la película Flash';s_flash_h_insert='Por favor, escriba la altura de la película Flash';s_flash_h_error='No ha especificado la altura de la película Flash';s_id_insert_tip='ID';s_id_insert_error='No ha especificado ninguna ID';s_file_insert_error='No ha especificado la URL del archivo';s_grad_select='Por favor, seleccione primero el texto';s_grad_error='Esta opción sólo trabaja con menos de 120 letras';s_grad_path='includes/grad.htm';s_view_more_code='Ver más código';s_image_upload='Subir una imagen a PostImage.org y añadir al mensaje';s_posticyimage='Subir una imagen y añadirla al mensaje';s_a_help='Cerrar todas la etiquetas abiertas';s_b_help='Texto en Negrita: [b]texto[/b]';s_i_help='Texto en Cursiva: [i]texto[/i]';s_u_help='Texto Subrayado: [u]texto[/u]';s_strike_help='Texto Tachado: [strike]texto[/strike]';s_quote_help='Citar texto: [quote]texto[/quote]';s_code_help='Mostrar código: [code]código[/code]';s_phpbbmod_help='phpBB Mod Template';s_highlight_help='Toque de Luz (Highlight): [highlight=#FFFFAA]texto[/highlight]';s_img_help='Insertar imagen: [img]http://imagen_url[/img]';s_imgl_help='Insertar imagen alineada a la izquierda: [img align=left]http://imagen_url[/img]';s_imgr_help='Insertar imagen alineada a la derecha: [img align=right]http://imagen_url[/img]';s_albumimg_help='Insertar imagen del Álbum: [albumimg]ID Imagen Álbum[/albumimg]';s_albumimgl_help='Insertar imagen desde el Álbum alineada a la izquierda: [albumimg align=left]ID de la imagen del Álbum[/albumimg]';s_albumimgr_help='Insertar imagen desde el Álbum alineada a la derecha: [albumimg align=right]ID de la imagen del Álbum[/albumimg]';s_url_help='Insertar URL: [url]http://url[/url] o [url=http://url]Texto URL[/url]';s_fc_help='Color de Fuente: [color=red]texto[/color] (Nota: Puede usar color=#FF0000)';s_fs_help='Tamaño de Fuente: [size=9]texto[/size]';s_ft_help='Tipo de Fuente: [font=Andalus]texto[/font]';s_table_help='Insertar Tabla: [table]texto[/table]';s_td_help='Insertar Columna de Tabla: [td]texto[/td]';s_mail_help='Insertar Correo: [email]correo aquí[/email]';s_grad_help='Insertar Texto Multicolor';s_right_help='Alinear texto alineado a la derecha: [align=right]texto[/align]';s_left_help='Alineas texto alineado a la izquierda: [align=left]texto[/align]';s_center_help='Centrar texto alineado al centro: [align=center]texto[/align]';s_justify_help='Justificar Texto: [align=justify]texto[/align]';s_marqr_help='Desplazar texto hacia la Derecha: [marquee direction=right]texto[/marquee]';s_marql_help='Desplazar texto hacia la Izquierda: [marquee direction=left]texto[/marquee]';s_marqu_help='Desplazar texto hacia Arriba: [marquee direction=up]texto[/marquee]';s_marqd_help='Desplazar texto hacia Abajo: [marquee direction=down]texto[/marquee]';s_sup_help='Superíndice: [sup]texto[/sup]';s_sub_help='Subíndice: [sub]texto[/sub]';s_hr_help='Insertar línea horizontal [hr]';s_bullet_help='Insertar punto [*]';s_video_help='Insertar archivo de Vídeo: [video width=# height=#]URL Archivo[/video]';s_googlevideo_help='Introduzca un archivo de Google Vídeo: [googlevideo]ID Google Vídeo[/googlevideo]';s_youtube_help='Introduzca un archivo de YouTube: [youtube]ID YouTube[/youtube]';s_quick_help='QuickTime Vídeo: [quick]http://quicktime_video_url/[/quick]';s_flash_help='Insertar película Flash: [flash width=# height=#]URL Flash[/flash]';s_ram_help='Introduzca un archivo Real Media: [ram]URL Archivo[/ram]';s_stream_help='Introduzca un archivo Stream: [stream]URL Archivo[/stream]';s_emff_help='Introduzca un archivo mp3: [emff]URL Archivo[/emff]';s_fade_help='Decolorar (Fade): [opacity]texto[/opacity] o [opacity][img]http://image_url/[/img][/opacity]';s_spoiler_help='Spoiler: [spoiler]texto[/spoiler]';s_cell_help='Celda: [cell]texto[/cell]';s_list_help='Lista Ordenada: [list|=1|a]texto[/list] (Nota: puede usar [*] para insertar un punto)';s_listo_help='Lista Ordenada: [list=1|a]texto[/list] (Nota: puede usar [*] para insertar un punto)';s_help_help='Abrir ayuda de BBCode';s_image_upload_help='Subir imagen a PostImage.org y añadir al mensaje';s_posticyimage_help='Subir imagen y añadirla al mensaje';s_smiley_creator='Creador de Emoticonos: [smiley=1]Texto[/smiley] insertar un Emoticono con texto';var Quote=0;var Bold=0;var Italic=0;var Underline=0;var Strikeout=0;var Code=0;var flash=0;var fc=0;var fs=0;var ft=0;var center=0;var right=0;var left=0;var justify=0;var fade=0;var marqd=0;var marqu=0;var marql=0;var marqr=0;var mail=0;var video=0;var googlevideo=0;var youtube=0;var quicktime=0;var ram=0;var emff=0;var hr=0;var bullet=0;var rainbow=0;var superscript=0;var subscript=0;var List=0;var Spoiler=0;var Cell=0;var Table=0;var Td=0;bbcode=new Array();bbtags=new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[align=]','[/align]','[center]','[/center]','[color=]','[/color]','[img]','[/img]','[img align=left]','[/img]','[img align=right]','[/img]','[albumimg]','[/albumimg]','[albumimg align=left]','[/albumimg]','[albumimg align=right]','[/albumimg]','[url]','[/url]','[email]','[/email]','[blur]','[/blur]','[fade]','[/fade]','[spoiler]','[/spoiler]','[cell]','[/cell]','[marquee=]','[/marquee]','[highlight=]','[/highlight]','[flipv]','[/flipv]','[fliph]','[/fliph]','[swf width=200 height=200]','[/swf]','[php]','[/php]','[wave]','[/wave]','[stream]','[/stream]','[real]','[/real]','[video width=320 height=240]','[/video]','[googlevideo]','[/googlevideo]','[youtube]','[/youtube]','[emff]','[/emff]');var imageTag=false;var theSelection=false;var clientPC=navigator.userAgent.toLowerCase();var clientVer=parseInt(navigator.appVersion);var is_ie=((clientPC.indexOf("msie")!=-1)&&(clientPC.indexOf("opera")==-1));var is_nav=((clientPC.indexOf('mozilla')!=-1)&&(clientPC.indexOf('spoofer')==-1)&&(clientPC.indexOf('compatible')==-1)&&(clientPC.indexOf('opera')==-1)&&(clientPC.indexOf('webtv')==-1)&&(clientPC.indexOf('hotjava')==-1));var is_moz=0;var is_win=((clientPC.indexOf("win")!=-1)||(clientPC.indexOf("16bit")!=-1));var is_mac=(clientPC.indexOf("mac")!=-1);var uAgent=navigator.userAgent;var ns4=(document.layers)?true:false;var ie4=(document.all)?true:false;var dom=(document.getElementById)?true:false;var ope=uAgent.indexOf("Opera")>-1&&dom?true:false;var ie5=(dom&&ie4&&!ope)?true:false;var ns6=(dom&&uAgent.indexOf("Netscape")>-1)?true:false;var khtml=uAgent.indexOf("khtml")>-1?true:false;var baseHeight;function initInsertions()
{document.post.message.focus();if(is_ie&&typeof(baseHeight)!='number')
{baseHeight=document.selection.createRange().duplicate().boundingHeight;}}
function mozWrap(txtarea,open,close)
{var selLength=txtarea.textLength;var selStart=txtarea.selectionStart;var selEnd=txtarea.selectionEnd;var scrollTop=txtarea.scrollTop;if(selEnd==1||selEnd==2)
{selEnd=selLength;}
var s1=(txtarea.value).substring(0,selStart);var s2=(txtarea.value).substring(selStart,selEnd)
var s3=(txtarea.value).substring(selEnd,selLength);txtarea.value=s1+open+s2+close+s3;txtarea.selectionStart=selEnd+open.length+close.length;txtarea.selectionEnd=txtarea.selectionStart;txtarea.focus();txtarea.scrollTop=scrollTop;return;}
function mozInsertOld(txtarea,openTag,closeTag)
{if(txtarea.selectionEnd>txtarea.value.length)
{txtarea.selectionEnd=txtarea.value.length;}
var startPos=txtarea.selectionStart;var endPos=txtarea.selectionEnd+openTag.length;txtarea.value=txtarea.value.slice(0,startPos)+openTag+txtarea.value.slice(startPos);txtarea.value=txtarea.value.slice(0,endPos)+closeTag+txtarea.value.slice(endPos);txtarea.selectionStart=startPos+openTag.length;txtarea.selectionEnd=endPos;txtarea.focus();}
function mozInsert(txtarea,openTag,closeTag)
{var sel_start=txtarea.selectionStart;var sel_end=txtarea.selectionEnd;mozWrap(txtarea,openTag,closeTag)
txtarea.selectionStart=sel_start+openTag.length;txtarea.selectionEnd=sel_end+openTag.length;txtarea.focus();}
function storeCaret(textEl)
{if(textEl.createTextRange)
{textEl.caretPos=document.selection.createRange().duplicate();}}
function bbcbmg_insert(text,spaces,popup)
{var txtarea;if(!popup)
{txtarea=document.post.message;}
else
{txtarea=opener.document.post.message;}
if(spaces)
{text=' '+text+' ';}
if(!isNaN(txtarea.selectionStart))
{var sel_start=txtarea.selectionStart;var sel_end=txtarea.selectionEnd;mozWrap(txtarea,text,'')
txtarea.selectionStart=sel_start+text.length;txtarea.selectionEnd=sel_end+text.length;}
else if(txtarea.createTextRange&&txtarea.caretPos)
{if(baseHeight!=txtarea.caretPos.boundingHeight)
{txtarea.focus();storeCaret(txtarea);}
var caret_pos=txtarea.caretPos;caret_pos.text=caret_pos.text.charAt(caret_pos.text.length-1)==' '?caret_pos.text+text+' ':caret_pos.text+text;}
else
{txtarea.value=txtarea.value+text;}
txtarea.focus();return;}
function PostWrite(text)
{bbcbmg_insert(text,false,false);}
function emoticon(text)
{bbcbmg_insert(text,true,false);}
function helpline(help)
{document.post.helpbox.value=eval("s_"+help+"_help");document.post.helpbox.readOnly="true";}
function getarraysize(thearray)
{for(i=0;i<thearray.length;i++)
{if((thearray[i]=="undefined")||(thearray[i]=="")||(thearray[i]==null))
{return i;}}
return thearray.length;}
function arraypush(thearray,value)
{thearray[getarraysize(thearray)]=value;}
function arraypop(thearray)
{thearraysize=getarraysize(thearray);retval=thearray[thearraysize-1];delete thearray[thearraysize-1];return retval;}
function checkForm()
{formErrors=false;if(document.post.message.value.length<2)
{formErrors=s_formerrors;}
if(formErrors)
{alert(formErrors);return false;}
else
{return true;}}
function bbfontstyle(bbopen,bbclose)
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(!theSelection)
{if(txtarea.createTextRange&&txtarea.caretPos)
{if(baseHeight!=txtarea.caretPos.boundingHeight)
{txtarea.focus();storeCaret(txtarea);}
var caretPos=txtarea.caretPos;var text=bbopen+bbclose;caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==' '?caretPos.text+text+' ':caretPos.text+text;}
else
{txtarea.value+=bbopen+bbclose;}
txtarea.focus();return;}
document.selection.createRange().text=bbopen+theSelection+bbclose;txtarea.focus();return;}
else if((txtarea.selectionEnd|txtarea.selectionEnd==0)&&(txtarea.selectionStart|txtarea.selectionStart==0))
{mozInsert(txtarea,bbopen,bbclose);return;}
else
{txtarea.value+=bbopen+bbclose;txtarea.focus();}
storeCaret(txtarea);}
function bbstyle(bbnumber)
{var txtarea=document.post.message;donotinsert=false;theSelection=false;bblast=0;if(bbnumber==-1)
{while(bbcode[0])
{butnumber=arraypop(bbcode)-1;if(txtarea.createTextRange&&txtarea.caretPos)
{if(baseHeight!=txtarea.caretPos.boundingHeight)
{txtarea.focus();storeCaret(txtarea);}
var caretPos=txtarea.caretPos;var text=bbtags[butnumber+1];caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==' '?caretPos.text+text+' ':caretPos.text+text;}
else if((txtarea.selectionEnd|txtarea.selectionEnd==0)&&(txtarea.selectionStart|txtarea.selectionStart==0))
{mozInsert(txtarea,bbtags[butnumber+1],"");}
else
{txtarea.value+=bbtags[butnumber+1];}
buttext=eval('document.post.addbbcode'+butnumber+'.value');eval('document.post.addbbcode'+butnumber+'.value ="'+buttext.substr(0,(buttext.length-1))+'"');}
imageTag=false;txtarea.focus();return;}
if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection)
{document.selection.createRange().text=bbtags[bbnumber]+theSelection+bbtags[bbnumber+1];txtarea.focus();theSelection='';return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,bbtags[bbnumber],bbtags[bbnumber+1]);return;}
for(i=0;i<bbcode.length;i++)
{if(bbcode[i]==bbnumber+1)
{bblast=i;donotinsert=true;}}
if(donotinsert)
{while(bbcode[bblast])
{butnumber=arraypop(bbcode)-1;if(txtarea.createTextRange&&txtarea.caretPos)
{if(baseHeight!=txtarea.caretPos.boundingHeight)
{txtarea.focus();storeCaret(txtarea);}
var caretPos=txtarea.caretPos;var text=bbtags[butnumber+1];caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==' '?caretPos.text+text+' ':caretPos.text+text;}
else if((txtarea.selectionEnd|txtarea.selectionEnd==0)&&(txtarea.selectionStart|txtarea.selectionStart==0))
{mozInsert(txtarea,bbtags[butnumber+1],"");}
else
{txtarea.value+=bbtags[butnumber+1];}
buttext=eval('document.post.addbbcode'+butnumber+'.value');eval('document.post.addbbcode'+butnumber+'.value ="'+buttext.substr(0,(buttext.length-1))+'"');imageTag=false;}
txtarea.focus();return;}
else
{if(imageTag&&(bbnumber!=14))
{if(txtarea.createTextRange&&txtarea.caretPos)
{if(baseHeight!=txtarea.caretPos.boundingHeight)
{txtarea.focus();storeCaret(txtarea);}
var caretPos=txtarea.caretPos;var text=bbtags[15];caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==' '?caretPos.text+text+' ':caretPos.text+text;}
else if((txtarea.selectionEnd|txtarea.selectionEnd==0)&&(txtarea.selectionStart|txtarea.selectionStart==0))
{mozInsert(txtarea,bbtags[15],"");}
else
{txtarea.value+=bbtags[15];}
lastValue=arraypop(bbcode)-1;document.post.addbbcode14.value="Img";imageTag=false;}
if(bbnumber==16)
{var url=prompt(s_url_insert,s_url_insert_tip);if(url==null)
{return;}
else if(!url)
{alert(s_gen_error+s_url_error);return;}
else
{var title=prompt(s_url_title_insert,s_url_title_insert_tip);if(title==null)
{return;}
else if(!title)
{var text="[url]"+url+"[/url]";}
else
{var text="[url="+url+"]"+title+"[/url]";}}
if(txtarea.createTextRange&&txtarea.caretPos)
{if(baseHeight!=txtarea.caretPos.boundingHeight)
{txtarea.focus();storeCaret(txtarea);}
var caretPos=txtarea.caretPos;caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==' '?caretPos.text+text+' ':caretPos.text+text;}
else if((txtarea.selectionEnd|txtarea.selectionEnd==0)&&(txtarea.selectionStart|txtarea.selectionStart==0))
{mozInsert(txtarea,text,"");}
else
{txtarea.value+=text;}}
else
{var text=bbtags[bbnumber];if(txtarea.createTextRange&&txtarea.caretPos)
{if(baseHeight!=txtarea.caretPos.boundingHeight)
{txtarea.focus();storeCaret(txtarea);}
var caretPos=txtarea.caretPos;caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==' '?caretPos.text+text+' ':caretPos.text+text;}
else if((txtarea.selectionEnd|txtarea.selectionEnd==0)&&(txtarea.selectionStart|txtarea.selectionStart==0))
{mozInsert(txtarea,bbtags[bbnumber],"");}
else
{txtarea.value+=bbtags[bbnumber];}
if((bbnumber==14)&&(imageTag==false))
{imageTag=1;}
arraypush(bbcode,bbnumber+1);eval('document.post.addbbcode'+bbnumber+'.value += "*"');}
txtarea.focus();return;}
storeCaret(txtarea);}
function copymetasearch()
{document.post.message.select();document.post.message.focus();if((navigator.appName=="Microsoft Internet Explorer")&&(parseInt(navigator.appVersion)>=4))
{textRange=document.post.message.createTextRange();textRange.execCommand("RemoveFormat");textRange.execCommand("Copy");}}
function BBCmail()
{var FoundErrors='';var entermail=prompt(s_email_insert,s_email_insert_tip);if(!entermail)
{FoundErrors+=s_email_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[email]"+entermail+"[/email]";PostWrite(ToAdd);}
function BBCurl()
{var FoundErrors='';var enterURL=prompt(s_url_insert,s_url_insert_tip);var enterTITLE=prompt(s_url_title_insert,s_url_title_insert_tip);if(!enterURL)
{FoundErrors+=s_url_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
if(enterTITLE==null)
{var ToAdd="[url]"+enterURL+"[/url]";}
else if(!enterTITLE)
{var ToAdd="[url]"+enterURL+"[/url]";}
else
{var ToAdd="[url="+enterURL+"]"+enterTITLE+"[/url]";}
PostWrite(ToAdd);}
function BBCimg()
{var FoundErrors='';var enterURL=prompt(s_img_insert,s_url_insert_tip);if(!enterURL)
{FoundErrors+=s_img_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[img width=640]"+enterURL+"[/img]";PostWrite(ToAdd);}
function BBCimgl()
{var FoundErrors='';var enterURL=prompt(s_img_insert,s_url_insert_tip);if(!enterURL)
{FoundErrors+=s_img_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[img align=left]"+enterURL+"[/img]";PostWrite(ToAdd);}
function BBCimgr()
{var FoundErrors='';var enterURL=prompt(s_img_insert,s_url_insert_tip);if(!enterURL)
{FoundErrors+=s_img_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[img align=right]"+enterURL+"[/img]";PostWrite(ToAdd);}
function BBCalbumimg()
{var FoundErrors='';var enterURL=prompt(s_albumimg_insert,s_albumimg_insert_tip);if(!enterURL)
{FoundErrors+=s_albumimg_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[albumimg]"+enterURL+"[/albumimg]";PostWrite(ToAdd);}
function BBCalbumimgl()
{var FoundErrors='';var enterURL=prompt(s_albumimg_insert,s_albumimg_insert_tip);if(!enterURL)
{FoundErrors+=s_albumimg_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[albumimg align=left]"+enterURL+"[/albumimg]";PostWrite(ToAdd);}
function BBCalbumimgr()
{var FoundErrors='';var enterURL=prompt(s_albumimg_insert,s_albumimg_insert_tip);if(!enterURL)
{FoundErrors+=s_albumimg_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[albumimg align=right]"+enterURL+"[/albumimg]";PostWrite(ToAdd);}
function BBCram()
{var FoundErrors='';var enterURL=prompt(s_ram_insert,s_url_insert_tip);if(!enterURL)
{FoundErrors+=s_file_insert_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[ram]"+enterURL+"[/ram]";PostWrite(ToAdd);}
function BBCvideo()
{var FoundErrors='';var enterFURL=prompt(s_video_insert,s_url_insert_tip);if(!enterFURL)
{FoundErrors+=s_file_insert_error;}
var enterW=prompt(s_video_w_insert,"320");if(!enterW)
{FoundErrors+=s_video_w_error;}
var enterH=prompt(s_video_h_insert,"240");if(!enterH)
{FoundErrors+=s_video_h_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[video width="+enterW+" height="+enterH+"]"+enterFURL+"[/video]";PostWrite(ToAdd);}
function BBCflash()
{var FoundErrors='';var enterFURL=prompt(s_flash_insert,s_url_insert_tip);if(!enterFURL)
{FoundErrors+=s_file_insert_error;}
var enterW=prompt(s_flash_w_insert,"320");if(!enterW)
{FoundErrors+=s_flash_w_error;}
var enterH=prompt(s_flash_h_insert,"240");if(!enterH)
{FoundErrors+=s_flash_h_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[flash width="+enterW+" height="+enterH+"]"+enterFURL+"[/flash]";PostWrite(ToAdd);}
function BBCstream()
{var FoundErrors='';var enterURL=prompt(s_stream_insert,s_url_insert_tip);if(!enterURL)
{FoundErrors+=s_file_insert_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[stream]"+enterURL+"[/stream]";PostWrite(ToAdd);}
function BBCgooglevideo()
{var FoundErrors='';var enterURL=prompt(s_googlevideo_insert,s_id_insert_tip);if(!enterURL)
{FoundErrors+=s_id_insert_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[googlevideo]"+enterURL+"[/googlevideo]";PostWrite(ToAdd);}
function BBCyoutube()
{var FoundErrors='';var enterURL=prompt(s_youtube_insert,s_id_insert_tip);if(!enterURL)
{FoundErrors+=s_id_insert_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[youtube]"+enterURL+"[/youtube]";PostWrite(ToAdd);}
function BBCemff()
{var FoundErrors='';var enterURL=prompt(s_emff_insert,s_url_insert_tip);if(!enterURL)
{FoundErrors+=s_file_insert_error;}
if(FoundErrors)
{alert(s_gen_error+FoundErrors);return;}
var ToAdd="[emff]"+enterURL+"[/emff]";PostWrite(ToAdd);}
function BBCbold()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[b]"+theSelection+"[/b]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[b]","[/b]");return;}
if(Bold==0)
{ToAdd="[b]";document.post.bold_img.src=bbcb_mg_img_path+"bold1"+bbcb_mg_img_ext;Bold=1;}
else
{ToAdd="[/b]";document.post.bold_img.src=bbcb_mg_img_path+"bold"+bbcb_mg_img_ext;Bold=0;}
PostWrite(ToAdd);}
function BBCitalic()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[i]"+theSelection+"[/i]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[i]","[/i]");return;}
if(Italic==0)
{ToAdd="[i]";document.post.italic.src=bbcb_mg_img_path+"italic1"+bbcb_mg_img_ext;Italic=1;}
else
{ToAdd="[/i]";document.post.italic.src=bbcb_mg_img_path+"italic"+bbcb_mg_img_ext;Italic=0;}
PostWrite(ToAdd);}
function BBCunder()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[u]"+theSelection+"[/u]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[u]","[/u]");return;}
if(Underline==0)
{ToAdd="[u]";document.post.under.src=bbcb_mg_img_path+"under1"+bbcb_mg_img_ext;Underline=1;}
else
{ToAdd="[/u]";document.post.under.src=bbcb_mg_img_path+"under"+bbcb_mg_img_ext;Underline=0;}
PostWrite(ToAdd);}
function BBCstrike()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[strike]"+theSelection+"[/strike]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[strike]","[/strike]");return;}
if(Strikeout==0)
{ToAdd="[strike]";document.strik.src=bbcb_mg_img_path+"strike1"+bbcb_mg_img_ext;Strikeout=1;}
else
{ToAdd="[/strike]";document.strik.src=bbcb_mg_img_path+"strike"+bbcb_mg_img_ext;Strikeout=0;}
PostWrite(ToAdd);}
function BBClist(){var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[list]"+theSelection+"[/list]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[list]","[/list]");return;}
if(List==0)
{ToAdd="[list]";document.listdf.src=bbcb_mg_img_path+"list1"+bbcb_mg_img_ext;List=1;}
else
{ToAdd="[/list]";document.listdf.src=bbcb_mg_img_path+"list"+bbcb_mg_img_ext;List=0;}
PostWrite(ToAdd);}
function BBClistO(){var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[list=1]"+theSelection+"[/list]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[list=1]","[/list]");return;}
if(List==0)
{ToAdd="[list=1]";document.listodf.src=bbcb_mg_img_path+"list_o1"+bbcb_mg_img_ext;List=1;}
else
{ToAdd="[/list]";document.listodf.src=bbcb_mg_img_path+"list_o"+bbcb_mg_img_ext;List=0;}
PostWrite(ToAdd);}
function BBCquick()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[quick]"+theSelection+"[/quick]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[quick]","[/quick]");return;}
if(quicktime==0)
{ToAdd="[quick]";document.quick.src=bbcb_mg_img_path+"quick1"+bbcb_mg_img_ext;quicktime=1;}
else
{ToAdd="[/quick]";document.quick.src=bbcb_mg_img_path+"quick"+bbcb_mg_img_ext;quicktime=0;}
PostWrite(ToAdd);}
function BBCsup()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[sup]"+theSelection+"[/sup]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[sup]","[/sup]");return;}
if(superscript==0)
{ToAdd="[sup]";document.supscript.src=bbcb_mg_img_path+"sup1"+bbcb_mg_img_ext;superscript=1;}
else
{ToAdd="[/sup]";document.supscript.src=bbcb_mg_img_path+"sup"+bbcb_mg_img_ext;superscript=0;}
PostWrite(ToAdd);}
function BBCsub()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[sub]"+theSelection+"[/sub]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[sub]","[/sub]");return;}
if(subscript==0)
{ToAdd="[sub]";document.subs.src=bbcb_mg_img_path+"sub1"+bbcb_mg_img_ext;subscript=1;}
else
{ToAdd="[/sub]";document.subs.src=bbcb_mg_img_path+"sub"+bbcb_mg_img_ext;subscript=0;}
PostWrite(ToAdd);}
function BBCgrad()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[rainbow]"+theSelection+"[/rainbow]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[rainbow]","[/rainbow]");return;}
if(rainbow==0)
{ToAdd="[rainbow]";document.rainb.src=bbcb_mg_img_path+"grad1"+bbcb_mg_img_ext;rainbow=1;}
else
{ToAdd="[/rainbow]";document.rainb.src=bbcb_mg_img_path+"grad"+bbcb_mg_img_ext;rainbow=0;}
PostWrite(ToAdd);}
function BBCgrad2(){var oSelect,oSelectRange;document.post.message.focus();oSelect=document.selection;oSelectRange=oSelect.createRange();if(oSelectRange.text.length<1)
{alert(s_grad_select);return;}
if(oSelectRange.text.length>120)
{alert(s_grad_error);return;}
showModalDialog(s_grad_path,oSelectRange,"help:no; center:yes; status:no; dialogHeight:50px; dialogWidth:50px");}
function BBChr()
{ToAdd="[hr]";PostWrite(ToAdd);}
function BBCbullet()
{ToAdd="[*]";PostWrite(ToAdd);}
function BBCmarqu()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[marquee direction=up]"+theSelection+"[/marquee]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[marquee direction=up]","[/marquee]");return;}
if(marqu==0)
{ToAdd="[marquee direction=up]";document.post.marqu.src=bbcb_mg_img_path+"marqu1"+bbcb_mg_img_ext;marqu=1;}
else
{ToAdd="[/marquee]";document.post.marqu.src=bbcb_mg_img_path+"marqu"+bbcb_mg_img_ext;marqu=0;}
PostWrite(ToAdd);}
function BBCmarqd()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[marquee direction=down]"+theSelection+"[/marquee]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[marquee direction=down]","[/marquee]");return;}
if(marqd==0)
{ToAdd="[marquee direction=down]";document.post.marqd.src=bbcb_mg_img_path+"marqd1"+bbcb_mg_img_ext;marqd=1;}
else
{ToAdd="[/marquee]";document.post.marqd.src=bbcb_mg_img_path+"marqd"+bbcb_mg_img_ext;marqd=0;}
PostWrite(ToAdd);}
function BBCmarql()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[marquee direction=left]"+theSelection+"[/marquee]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[marquee direction=left]","[/marquee]");return;}
if(marql==0)
{ToAdd="[marquee direction=left]";document.post.marql.src=bbcb_mg_img_path+"marql1"+bbcb_mg_img_ext;marql=1;}
else
{ToAdd="[/marquee]";document.post.marql.src=bbcb_mg_img_path+"marql"+bbcb_mg_img_ext;marql=0;}
PostWrite(ToAdd);}
function BBCmarqr()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[marquee direction=right]"+theSelection+"[/marquee]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[marquee direction=right]","[/marquee]");return;}
if(marqr==0)
{ToAdd="[marquee direction=right]";document.post.marqr.src=bbcb_mg_img_path+"marqr1"+bbcb_mg_img_ext;marqr=1;}
else
{ToAdd="[/marquee]";document.post.marqr.src=bbcb_mg_img_path+"marqr"+bbcb_mg_img_ext;marqr=0;}
PostWrite(ToAdd);}
function BBCdir(dirc)
{document.post.message.dir=(dirc);}
function BBCfade()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[opacity]"+theSelection+"[/opacity]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[opacity]","[/opacity]");return;}
if(fade==0)
{ToAdd="[opacity]";document.post.fade.src=bbcb_mg_img_path+"fade1"+bbcb_mg_img_ext;fade=1;}
else
{ToAdd="[/opacity]";document.post.fade.src=bbcb_mg_img_path+"fade"+bbcb_mg_img_ext;fade=0;}
PostWrite(ToAdd);}
function BBCspoiler()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[spoiler]"+theSelection+"[/spoiler]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[spoiler]","[/spoiler]");return;}
if(Spoiler==0)
{ToAdd="[spoiler]";document.post.spoiler.src=bbcb_mg_img_path+"spoiler1.gif";Spoiler=1;}
else
{ToAdd="[/spoiler]";document.post.spoiler.src=bbcb_mg_img_path+"spoiler.gif";Spoiler=0;}
PostWrite(ToAdd);}
function BBCcell()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[cell class=spoiler]"+theSelection+"[/cell]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[cell class=spoiler]","[/cell]");return;}
if(Cell==0)
{ToAdd="[cell class=spoiler]";document.post.cell.src=bbcb_mg_img_path+"cell1.gif";Cell=1;}
else
{ToAdd="[/cell]";document.post.cell.src=bbcb_mg_img_path+"cell.gif";Cell=0;}
PostWrite(ToAdd);}
function BBCjustify()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[align=justify]"+theSelection+"[/align]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[align=justify]","[/align]");return;}
if(justify==0)
{ToAdd="[align=justify]";document.post.justify.src=bbcb_mg_img_path+"justify1"+bbcb_mg_img_ext;justify=1;}
else
{ToAdd="[/align]";document.post.justify.src=bbcb_mg_img_path+"justify"+bbcb_mg_img_ext;justify=0;}
PostWrite(ToAdd);}
function BBCleft()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[align=left]"+theSelection+"[/align]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[align=left]","[/align]");return;}
if(left==0)
{ToAdd="[align=left]";document.post.left.src=bbcb_mg_img_path+"left1"+bbcb_mg_img_ext;left=1;}
else
{ToAdd="[/align]";document.post.left.src=bbcb_mg_img_path+"left"+bbcb_mg_img_ext;left=0;}
PostWrite(ToAdd);}
function BBCright()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[align=right]"+theSelection+"[/align]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[align=right]","[/align]");return;}
if(right==0)
{ToAdd="[align=right]";document.post.right.src=bbcb_mg_img_path+"right1"+bbcb_mg_img_ext;right=1;}
else
{ToAdd="[/align]";document.post.right.src=bbcb_mg_img_path+"right"+bbcb_mg_img_ext;right=0;}
PostWrite(ToAdd);}
function BBCcenter()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[align=center]"+theSelection+"[/align]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[align=center]","[/align]");return;}
if(center==0)
{ToAdd="[align=center]";document.post.center.src=bbcb_mg_img_path+"center1"+bbcb_mg_img_ext;center=1;}
else
{ToAdd="[/align]";document.post.center.src=bbcb_mg_img_path+"center"+bbcb_mg_img_ext;center=0;}
PostWrite(ToAdd);}
function BBCft()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[font="+document.post.ft.value+"]"+theSelection+"[/font]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[font="+document.post.ft.value+"]","[/font]");return;}
ToAdd="[font="+document.post.ft.value+"]"+" "+"[/font]";PostWrite(ToAdd);}
function BBCfs()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[size="+document.post.fs.value+"]"+theSelection+"[/size]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[size="+document.post.fs.value+"]","[/size]");return;}
ToAdd="[size="+document.post.fs.value+"]"+" "+"[/size]";PostWrite(ToAdd);}
function BBCfc()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[color="+document.post.fc.value+"]"+theSelection+"[/color]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[color="+document.post.fc.value+"]","[/color]");return;}
ToAdd="[color="+document.post.fc.value+"]"+" "+"[/color]";PostWrite(ToAdd);}
function BBChl()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[highlight=#FFFFAA]"+theSelection+"[/highlight]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[highlight=#FFFFAA]","[/highlight]");return;}
ToAdd="[highlight=#FFFFAA]"+" "+"[/highlight]";PostWrite(ToAdd);}
function BBCphpbbmod()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text=theSelection+"OPEN [b][/b]\nFIND\n[codeblock][/codeblock]\nREPLACE WITH\n[codeblock][/codeblock]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"","OPEN [b][/b]\nFIND\n[codeblock][/codeblock]\nREPLACE WITH\n[codeblock][/codeblock]");return;}
ToAdd="OPEN [b][/b]\nFIND\n[codeblock][/codeblock]\nREPLACE WITH\n[codeblock][/codeblock]";PostWrite(ToAdd);}
function BBCcode()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[code linenumbers=false]"+theSelection+"[/code]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[code linenumbers=false]","[/code]");return;}
if(Code==0)
{ToAdd="[code linenumbers=false]";document.post.code.src=bbcb_mg_img_path+"code1"+bbcb_mg_img_ext;Code=1;}
else
{ToAdd="[/code]";document.post.code.src=bbcb_mg_img_path+"code"+bbcb_mg_img_ext;Code=0;}
PostWrite(ToAdd);}
function BBCquote()
{var txtarea=document.post.message;if((clientVer>=4)&&is_ie&&is_win)
{theSelection=document.selection.createRange().text;if(theSelection!='')
{document.selection.createRange().text="[quote]"+theSelection+"[/quote]";document.post.message.focus();return;}}
else if(txtarea.selectionEnd&&(txtarea.selectionEnd-txtarea.selectionStart>0))
{mozInsert(txtarea,"[quote]","[/quote]");return;}
if(Quote==0)
{ToAdd="[quote]";document.post.quote.src=bbcb_mg_img_path+"quote1"+bbcb_mg_img_ext;Quote=1;}
else
{ToAdd="[/quote]";document.post.quote.src=bbcb_mg_img_path+"quote"+bbcb_mg_img_ext;Quote=0;}
PostWrite(ToAdd);}
function selectAll(elementId)
{var element=document.getElementById(elementId);if(document.selection)
{var range=document.body.createTextRange();range.moveToElementText(element);range.select();}
if(window.getSelection)
{var range=document.createRange();range.selectNodeContents(element);var blockSelection=window.getSelection();blockSelection.removeAllRanges();blockSelection.addRange(range);}}
function resizeLayer(layerId,newHeight)
{var myLayer=document.getElementById(layerId);myLayer.style.height=newHeight+'px';}
function codeDivStart()
{var randomId=Math.floor(Math.random()*2000);var imgSrc='images/bbcb_mg/images/';document.write('<div class="codetitle">Code:<img src="'+imgSrc+'nav_expand.gif" width="14" height="10" title="'+s_view_more_code+'" onclick="resizeLayer('+randomId+', 200)" onmouseover="this.style.cursor = \'pointer\'" /><img src="'+imgSrc+'nav_expand_more.gif" width="14" height="10" title="View Even More of this Code" onclick="resizeLayer('+randomId+', 500)" onmouseover="this.style.cursor = \'pointer\'" /><img src="'+imgSrc+'nav_contract.gif" width="14" height="10" title="View Less of this Code" onclick="resizeLayer('+randomId+', 50)" onmouseover="this.style.cursor = \'pointer\'" /><img src="'+imgSrc+'nav_select_all.gif" width="14" height="10" title="Select All of this Code" onclick="selectAll('+randomId+')" onmouseover="this.style.cursor = \'pointer\'" /></div><div class="codediv" id="'+randomId+'">');}
function ob(id)
{if(dom)
{obj=document.getElementById(id);}
else if(ie4)
{obj=document.all[id];}
else if(ns4)
{obj=document.anchors[id];}
else
{obj=false;}
return obj;}
Array.prototype.inArray=function(str)
{for(i=0;i<this.length;i++)
{if(this[i].toString()==str)
{return i;}}
return-1;}
String.prototype.exist=function()
{return(this=="undefined"?false:true);};function setOpacity(id,alpha,isObj)
{if(!dom)
{return;}
var object=isObj?id:ob(id);if(String(typeof object.filters).exist())
{object.filters.alpha.opacity=alpha;}
else if(String(typeof object.style.opacity).exist())
{object.style.opacity=(alpha/100);}
else if(String(typeof object.style.KhtmlOpacity).exist())
{object.style.KhtmlOpacity=(alpha/100);}
else if(String(typeof object.style.MozOpacity).exist())
{object.style.MozOpacity=(alpha/100);}}
function getOpacity(id,isObj)
{if(!dom)
{return;}
var object=isObj?id:ob(id),alpha=null;if(String(typeof object.filters).exist())
{alpha=object.filters.alpha.opacity;}
else if(String(typeof object.style.opacity).exist())
{alpha=object.style.opacity*100;}
else if(String(typeof object.style.KhtmlOpacity).exist())
{alpha=object.style.KhtmlOpacity*100;}
else if(String(typeof object.style.MozOpacity).exist())
{alpha=object.style.MozOpacity*100;}
return alpha;}
vit=5;add=4;nObj=0;fadeObjects=new Object();fadeTimers=new Object();fadeIds=new Array();function fade2(object,destOp)
{if(!dom)
{return;}
if(object.toString().indexOf("[object")==-1)
{setTimeout("fade2("+object+","+destOp+")",0);return;}
alpha=getOpacity(object,true);index=fadeIds.inArray(object.id);if(index>-1)
{clearTimeout(fadeTimers[index]);}
else
{index=nObj++;fadeIds[index]=object.id;}
diff=destOp-alpha;direction=1;if(alpha>destOp)
{direction=-1;}
alpha+=direction*Math.min(direction*diff,add);setOpacity(object,alpha,true);alpha=getOpacity(object,true);object.offsetLeft;if(Math.round(alpha)!=destOp)
{fadeObjects[index]=object;fadeTimers[index]=setTimeout("fade2(fadeObjects["+index+"],"+destOp+")",vit);}
return;}
var PreloadFlag=false;var expDays=90;var exp=new Date();var tmp='';var tmp_counter=0;var tmp_open=0;exp.setTime(exp.getTime()+(expDays*24*60*60*1000));function SetCookie(name,value)
{var argv=SetCookie.arguments;var argc=SetCookie.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=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");}
function getCookieVal(offset)
{var endstr=document.cookie.indexOf(";",offset);if(endstr==-1)
{endstr=document.cookie.length;}
return unescape(document.cookie.substring(offset,endstr));}
function GetCookie(name)
{var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen)
{var j=i+alen;if(document.cookie.substring(i,j)==arg)
{return getCookieVal(j);}
i=document.cookie.indexOf(" ",i)+1;if(i==0)
{break;}}
return null;}
function ShowHide(id1,id2,id3)
{var res=expMenu(id1);if(id2!='')
{expMenu(id2);}
if(id3!='')
{SetCookie(id3,res,exp);}}
function expMenu(id)
{var itm=null;if(document.getElementById)
{itm=document.getElementById(id);}
else if(document.all)
{itm=document.all[id];}
else if(document.layers)
{itm=document.layers[id];}
if(!itm)
{}
else if(itm.style)
{if(itm.style.display=="none")
{itm.style.display="";return 1;}
else
{itm.style.display="none";return 2;}}
else
{itm.visibility="show";return 1;}}
function showMenu(id)
{var itm=null;if(document.getElementById)
{itm=document.getElementById(id);}
else if(document.all)
{itm=document.all[id];}
else if(document.layers)
{itm=document.layers[id];}
if(!itm)
{}
else if(itm.style)
{if(itm.style.display=="none")
{itm.style.display="";return true;}
else
{return true;}}
else
{itm.visibility="show";return true;}}
function hideMenu(id)
{var itm=null;if(document.getElementById)
{itm=document.getElementById(id);}
else if(document.all)
{itm=document.all[id];}
else if(document.layers)
{itm=document.layers[id];}
if(!itm)
{}
else if(itm.style)
{if(itm.style.display=="none")
{return true;}
else
{itm.style.display="none";return true;}}
else
{itm.visibility="hide";return true;}}
function IsIEMac()
{var ua=String(navigator.userAgent).toLowerCase();if(document.all&&ua.indexOf("mac")>=0)
{return true;}
return false;}
function select_text(obj)
{var o=document.getElementById(obj)
if(!o)return;var r,s;if(document.selection&&!IsIEMac())
{r=document.body.createTextRange();r.moveToElementText(o);r.select();}
else if(document.createRange&&(document.getSelection||window.getSelection))
{r=document.createRange();r.selectNodeContents(o);s=window.getSelection?window.getSelection():document.getSelection();s.removeAllRanges();s.addRange(r);}}
function SetLangTheme()
{document.ChangeThemeLang.submit();return true;}
function img_popup(image_url,image_width,image_height,popup_rand)
{screenwidth=false;screenwidth=screen.Width;if(!screenwidth)
{screenwidth=window.outerWidth;}
screenheight=false;screenheight=screen.Height;if(!screenheight)
{screenheight=window.outerHeight;}
if(screenwidth<(image_width+30)||screenheight<(image_height+30)||image_width==null||image_height==null)
{window.open(image_url,'limit_image_mod_popup_img_'+popup_rand,'resizable=yes,top=0,left=0,screenX=0,screenY=0,scrollbars=yes',false);}
else
{window.open(image_url,'limit_image_mod_popup_img_'+popup_rand,'resizable=yes,top=0,left=0,screenX=0,screenY=0,height='+(image_height+30)+',width='+(image_width+30),false);}}
function Gk_PopTart(mypage,myname,w,h,scroll)
{LeftPosition=(screen.width)?(screen.width-w)/2:0;TopPosition=(screen.height)?(screen.height-h)/2:0;settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';win=window.open(mypage,myname,settings);}
function Trophy_Popup(mypage,myname,w,h,scroll)
{LeftPosition=(screen.width)?(screen.width-w)/2:0;TopPosition=(screen.height)?(screen.height-h)/2:0;settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';win=window.open(mypage,myname,settings);}
function rss_news_help()
{window.open("rss_news_help.php?",'_rss_news_help','height=550,width=700,resizable=no,scrollbars=yes');}
function links_me()
{window.open("links_popup.php",'_links_me','height=220, width=500,resizable=no, scrollbars=no');}
function hdr_ref(object)
{if(document.getElementById)
{return document.getElementById(object);}
else if(document.all)
{return eval('document.all.'+object);}
else
{return false;}}
function hdr_expand(object)
{var object=hdr_ref(object);if(!object.style)
{return false;}
else
{object.style.display='';}
if(window.event)
{window.event.cancelBubble=true;}}
function hdr_contract(object)
{var object=hdr_ref(object);if(!object.style)
{return false;}
else
{object.style.display='none';}
if(window.event)
{window.event.cancelBubble=true;}}
function hdr_toggle(object,open_close,open_icon,close_icon)
{var object=hdr_ref(object);var icone=hdr_ref(open_close);if(!object.style)
{return false;}
if(object.style.display=='none')
{object.style.display='';icone.src=close_icon;}
else
{object.style.display='none';icone.src=open_icon;}}
var baseopacity=70;function slowhigh(which2)
{imgobj=which2;browserdetect=which2.filters?"ie":((typeof which2.style.MozOpacity=="string")?"mozilla":"");instantset(baseopacity);highlighting=setInterval("gradualfade(imgobj)",50);}
function slowlow(which2)
{cleartimer();instantset(baseopacity);}
function instantset(degree)
{if(browserdetect=="mozilla")
{imgobj.style.MozOpacity=degree/100;}
else if(browserdetect=="ie")
{imgobj.filters.alpha.opacity=degree;}}
function cleartimer()
{if(window.highlighting)
{clearInterval(highlighting);}}
function gradualfade(cur2)
{if((browserdetect=="mozilla")&&(cur2.style.MozOpacity<1))
{cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1,0.99);}
else if((browserdetect=="ie")&&(cur2.filters.alpha.opacity<100))
{cur2.filters.alpha.opacity+=10;}
else if(window.highlighting)
{clearInterval(highlighting);}}
function set_rate(rate,max)
{document.getElementById('rating').selectedIndex=(rate-1);if(rate==0)
{for(i=1;i<=max;i++)
{document.getElementById('rate'+i).className='img-rate-off';}}
else
{for(i=1;i<=rate;i++)
{document.getElementById('rate'+i).className='img-rate-on';}
for(i=(rate+1);i<=max;i++)
{document.getElementById('rate'+i).className='img-rate-off';}}}
function submit_rate()
{document.ratingform.submit();return true;}
