/* give menus a SICK edge */

window.onload = function() {
 document.getElementById('menu').innerHTML = document.getElementById('menu').innerHTML.replace(/<\/li>/gim,'<span class="m2c l"></span><span class="m2c r"></span></li>');
}

function copy(inElement) {
  if (inElement.createTextRange) {
    var range = inElement.createTextRange();
    if (range && BodyLoaded==1)
      range.execCommand('Copy');
  } else {
    var flashcopier = 'flashcopier';
    if(!document.getElementById(flashcopier)) {
      var divholder = document.createElement('div');
      divholder.id = flashcopier;
      document.body.appendChild(divholder);
    }
    document.getElementById(flashcopier).innerHTML = '';
    var divinfo = '<embed src="_clipboard.swf" FlashVars="clipboard='+encodeURIComponent(inElement)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    document.getElementById(flashcopier).innerHTML = divinfo;
  }
}

/* Make Items */
function make_words (item)
{
 document.write('<div class="item_words" style="background-image:url(\''+item+'\');"><a href="#TB_inline?width=600&height=310&inlineId=preview&modal=true" onClick="show_words(\''+item+'\')" class="thickbox"></a></div>');
}
function make_pics (item)
{
 document.write('<div class="item_pics"><a href="#TB_inline?width=600&height=310&inlineId=preview&modal=true" onClick="show_pics(\''+item+'\')" class="thickbox"><img src="'+item+'" /></a></div>');
}

function show_words (item)
{
 copy('<a href="http://www.mypersonalbubble.com/"><img src="http://www.mypersonalbubble.com/'+item+'" border="0"/></a>');
 document.getElementById('preview').innerHTML = '<p class="showitem_words"><div style="display : block ; background : transparent url(\''+item+'\') no-repeat 50% 50% ; position : absolute ; width : 225px ; height : 120px ; top : 113px ; right : 64px ; "></div><input type="button" onClick="tb_remove()" class="pressok" /></p>';
}

function show_pics (item)
{
 copy('<a href="http://www.mypersonalbubble.com/"><img src="http://www.mypersonalbubble.com/'+item+'" border="0"/></a>');
 document.getElementById('preview').innerHTML = '<p class="showitem_pics"><div style="display : block ; background : transparent none ; position : absolute ; width : 187px ; height : 170px ; top : 64px ; right : 154px ; text-align : center ; vertical-align : middle ; "><img src="http://www.mypersonalbubble.com/'+item+'" onload="resize_img(this);" style="display:none;" border="0"/></div><input type="button" onClick="tb_remove()" class="pressok" /></p>';
}

function resize_img(i)
{
 var iW=(i.width/187);
 var iH=(i.height/170);
 if(iW>1||iH>1) (iW>iH) ? i.width=(i.width/iW) : i.width=(i.width/iH);
 i.style.display='';
}

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
/* alert(message); */
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
/* alert(message); */
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

document.oncontextmenu=new Function("return false;")