// (c) Meetspot.com / Whimit.com //

///////////////////
// CMS Drop Down Changer
///////////////////

var arrItems1 = new Array();
var arrItemsGrp1 = new Array();

arrItems1[10] = "Lyrics";
arrItemsGrp1[10] = 1;
arrItems1[11] = "Poetry";
arrItemsGrp1[11] = 1;
arrItems1[12] = "Short Story";
arrItemsGrp1[12] = 1;

arrItems1[20] = "Art/Music ";
arrItemsGrp1[20] = 2;
arrItems1[21] = "English";
arrItemsGrp1[21] = 2;
arrItems1[22] = "History";
arrItemsGrp1[22] = 2;
arrItems1[23] = "Philosophy";
arrItemsGrp1[23] = 2;
arrItems1[24] = "Politics";
arrItemsGrp1[24] = 2;
arrItems1[25] = "Psychology";
arrItemsGrp1[25] = 2;
arrItems1[26] = "Religion";
arrItemsGrp1[26] = 2;
arrItems1[27] = "Science";
arrItemsGrp1[27] = 2;
arrItems1[28] = "Miscalaneous";
arrItemsGrp1[28] = 2;

arrItems1[30] = "Joke";
arrItemsGrp1[30] = 3;
arrItems1[31] = "Parody";
arrItemsGrp1[31] = 3;

arrItems1[40] = "Book";
arrItemsGrp1[40] = 4;
arrItems1[41] = "Game";
arrItemsGrp1[41] = 4;
arrItems1[42] = "Movie";
arrItemsGrp1[42] = 4;
arrItems1[43] = "Music";
arrItemsGrp1[43] = 4;
arrItems1[44] = "Television";
arrItemsGrp1[44] = 4;


arrItems1[50] = "No Emotion";
arrItemsGrp1[50] = 5;
arrItems1[51] = "Bored";
arrItemsGrp1[51] = 5;
arrItems1[52] = "Happy";
arrItemsGrp1[52] = 5;
arrItems1[53] = "Confused";
arrItemsGrp1[53] = 5;
arrItems1[54] = "Constipated";
arrItemsGrp1[54] = 5;
arrItems1[55] = "Crazy";
arrItemsGrp1[55] = 5;
arrItems1[56] = "Evil";
arrItemsGrp1[56] = 5;
arrItems1[57] = "Horny";
arrItemsGrp1[57] = 5;
arrItems1[58] = "In Love";
arrItemsGrp1[58] = 5;
arrItems1[59] = "High";
arrItemsGrp1[59] = 5;
arrItems1[60] = "Sick";
arrItemsGrp1[60] = 5;
arrItems1[61] = "Sad";
arrItemsGrp1[61] = 5;
arrItems1[62] = "Scared";
arrItemsGrp1[62] = 5;
arrItems1[63] = "Silly";
arrItemsGrp1[63] = 5;
arrItems1[64] = "Sleepy";
arrItemsGrp1[64] = 5;


arrItems1[70] = "Want to Buy";
arrItemsGrp1[70] = 6;
arrItems1[71] = "Want to Sell";
arrItemsGrp1[71] = 6;
arrItems1[72] = "Help Wanted";
arrItemsGrp1[72] = 6;

arrItems1[80] = "World";
arrItemsGrp1[80] = 7;
arrItems1[81] = "U.S.";
arrItemsGrp1[81] = 7;
arrItems1[82] = "Business";
arrItemsGrp1[82] = 7;
arrItems1[83] = "Sci/Tech";
arrItemsGrp1[83] = 7;
arrItems1[84] = "Sports";
arrItemsGrp1[84] = 7;
arrItems1[85] = "Entertainement";
arrItemsGrp1[85] = 7;
arrItems1[86] = "Health";
arrItemsGrp1[86] = 7;
arrItems1[87] = "Russian";
arrItemsGrp1[87] = 7;

function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
  var myEle ;
  var x ;
  // Empty the second drop down box of any choices
  for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
  if (control.name == "section")
  // ADD Default Choice - in case there are no values
  myEle = document.createElement("option") ;
  myEle.value = 0 ;
  myEle.text = "Select Category" ;
  controlToPopulate.add(myEle) ;
  // Now loop through the array of individual items
  // Any containing the same child id are added to
  // the second dropdown box
  for ( x = 0 ; x < ItemArray.length  ; x++ )
    {
      if ( GroupArray[x] == control.value )
        {
          myEle = document.createElement("option") ;
          myEle.value = x ;
          myEle.text = ItemArray[x] ;
          controlToPopulate.add(myEle) ;
        }
    }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function P7_Snap() { //v2.67 by PVII
 var g,x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,tw,q0,xx,yy,w1,pa='px',args=P7_Snap.arguments;a=parseInt(a);
 if(document.layers||window.opera){pa='';}for(k=0;k<(args.length);k+=4){
 if((g=MM_findObj(args[k]))!=null){if((el=MM_findObj(args[k+1]))!=null){
 a=parseInt(args[k+2]);b=parseInt(args[k+3]);x=0;y=0;ox=0;oy=0;p="";tx=1;
 da="document.all['"+args[k]+"']";if(document.getElementById){
 d="document.getElementsByName('"+args[k]+"')[0]";if(!eval(d)){
 d="document.getElementById('"+args[k]+"')";if(!eval(d)){d=da;}}
 }else if(document.all){d=da;}if(document.all||document.getElementById){while(tx==1){
 p+=".offsetParent";if(eval(d+p)){x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
 }else{tx=0;}}ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);tw=x+ox+y+oy;
 if(tw==0||(navigator.appVersion.indexOf("MSIE 4")>-1&&navigator.appVersion.indexOf("Mac")>-1)){
  ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);}else{
  w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
  x=document.body.scrollLeft+event.clientX+bx;y=document.body.scrollTop+event.clientY;}}
 }else if(document.layers){x=g.x;y=g.y;q0=document.layers,dd="";for(var s=0;s<q0.length;s++){
  dd='document.'+q0[s].name;if(eval(dd+'.document.'+args[k])){x+=eval(dd+'.left');y+=eval(dd+'.top');
  break;}}}e=(document.layers)?el:el.style;xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
 if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
  xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);}
 e.left=xx+pa;e.top=yy+pa;}}}
}


<!-- //Begin

hue = 60;
adeg = 60;
sat = 1;
val = 1;
squarecolor = "#ffffff"; //starting hue
pickindex = 0;
pickarea = 'pcurrent';

threec = new Array("#ffffff", "#ffffff", "#ffffff"); // the three colors
prevc = threec[2];
picary = new Array("color_t, color_l");
picary = new Array("pa", "pb", "pc", "pd", "pe", "pf", "pg");
initary = new Array("#444444", "#777777", "#aaaaaa",  "#bbbbbb", "#cccccc", "#dddddd", "#eeeeee");

// code from Browser Detect Lite  v2.1
// http://www.dithered.com/javascript/browser_detect/index.html
// modified by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)
// modified by Michael Lovitt to include OmniWeb and Dreamcast
// modified by Jemima Pereira to detect only relevant browsers

function BrowserDetectXLite() {
	var ua = navigator.userAgent.toLowerCase(); 
	this.ua = ua;

	// browser name
	this.isIE        = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) ); 
        this.isSafari      = (ua.indexOf('safari') != - 1);

	// browser version
	this.versionMinor = parseFloat(navigator.appVersion); 
	
	// correct version number for IE4+ 
	if (this.isIE && this.versionMinor >= 4) {
		this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
	}
	
	this.versionMajor = parseInt(this.versionMinor); 
	
	// platform
	this.isWin   = (ua.indexOf('win') != -1);
	this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1) );
	this.isMac   = (ua.indexOf('mac') != -1);

	this.isIE4x = (this.isIE && this.versionMajor == 4);
	this.isIE4up = (this.isIE && this.versionMajor >= 4);
	this.isIE5x = (this.isIE && this.versionMajor == 5);
	this.isIE55 = (this.isIE && this.versionMinor == 5.5);
	this.isIE5up = (this.isIE && this.versionMajor >= 5);
	this.isIE6x = (this.isIE && this.versionMajor == 6);
	this.isIE6up = (this.isIE && this.versionMajor >= 6);
	
	this.isIE4xMac = (this.isIE4x && this.isMac);
}
var browser = new BrowserDetectXLite();
//end of browser detector


//fix for IE's png stupidity
//function deMoronize() {//now the onload function
// detect moronic browsers
//  if (!((browser.isIE55 || browser.isIE6up) && browser.isWin32)) {
     // demoronize div#wheel image if browser is non-moronic
//     thesmartversion = "<a href='javascript://' onclick='javascript:pickColor(); return false;'><img src='hsvwheel.png' alt='color wheel' width='553' height='257' border='0'></a>";
 // document.getElementById("wheel").innerHTML = thesmartversion;
 // }
  // keypress stuff
//  if (browser.isSafari) document.onkeypress = rotate; //safari repeat
//  else document.onkeydown = rotate;
  // start capturing the mouse
//  capture();
//}

// HSV conversion algorithm adapted from easyrgb.com
function hsv2rgb(Hdeg,S,V) {
  H = Hdeg/360;     // convert from degrees to 0 to 1
  if (S==0) {       // HSV values = From 0 to 1
    R = V*255;     // RGB results = From 0 to 255
    G = V*255;
    B = V*255;}
  else {
    var_h = H*6;
    var_i = Math.floor( var_h );     //Or ... var_i = floor( var_h )
    var_1 = V*(1-S);
    var_2 = V*(1-S*(var_h-var_i));
    var_3 = V*(1-S*(1-(var_h-var_i)));
    if (var_i==0)      {var_r=V ;    var_g=var_3; var_b=var_1}
    else if (var_i==1) {var_r=var_2; var_g=V;     var_b=var_1}
    else if (var_i==2) {var_r=var_1; var_g=V;     var_b=var_3}
    else if (var_i==3) {var_r=var_1; var_g=var_2; var_b=V}
    else if (var_i==4) {var_r=var_3; var_g=var_1; var_b=V}
    else               {var_r=V;     var_g=var_1; var_b=var_2}
    R = Math.round(var_r*255);   //RGB results = From 0 to 255
    G = Math.round(var_g*255);
    B = Math.round(var_b*255);
  }
  return new Array(R,G,B);
}

function rgb2hex(rgbary) {
  cary = new Array; 
  cary[3] = "#";
  for (i=0; i < 3; i++) {
    cary[i] = parseInt(rgbary[i]).toString(16);
    if (cary[i].length < 2) cary[i] = "0"+ cary[i];
    cary[3] = cary[3] + cary[i];
    cary[i+4] = rgbary[i]; //save dec values for later
  }

  // function returns hex color as an array of three two-digit strings
  // plus the full hex color and original decimal values
  return cary;
}

function webRounder(c,d) {//d is the divisor
  //safe divisor is 51, smart divisor is 17 
  thec = "#";
  for (i=0; i<3; i++) {
      num = Math.round(c[i+4]/d) * d; //use saved rgb value
      numc = num.toString(16);
      if (String(numc).length < 2) numc = "0" + numc;
      thec += numc;
  }
  return thec;
}

function hexColorArray(c) { //now takes string hex value with #
    threec[2] = c[3];
    threec[1] = webRounder(c,17);
    threec[0] = webRounder(c,51);
    return false;
}

function capture() {
 hoverColor();
 initColor();
 if(document.layers) {
  layobj = document.layers['wheel'];
  layobj.document.captureEvents(Event.MOUSEMOVE);
  layobj.document.onmousemove = mouseMoved;
 }
 else if (document.all) {
  layobj = document.all["wheel"];
  layobj.onmousemove = mouseMoved;
   }
 else if (document.getElementById) {
  window.document.getElementById("wheel").onmousemove = mouseMoved;
 }
}

function greyMoved(x,y) {
    adeg = hue;
    xside = (x<=411)?x - 230:180;
    yside = (y<=180)?y:180;
    sat = xside/180;
    val = 1 - (yside/180);
    c = rgb2hex(hsv2rgb(hue,sat,val));
    hexColorArray(c);
    hoverColor();
    return false;
	
}

function mouseMoved(e) {
 if (document.layers) {
  x = e.layerX;
  y = e.layerY;
 }
 else if (document.all) {
  x = event.offsetX;
  y = event.offsetY;
 }
 else if (document.getElementById) {
  x = (e.pageX - document.getElementById("wheel").offsetLeft);
  y = (e.pageY - document.getElementById("wheel").offsetTop);
 }
 if (x >= 230) {greyMoved(x,y);
   return false;}
 if (y > 180) {return false;}

    cartx = x - 90;
    carty = 90 - y;
    cartx2 = cartx * cartx;
    carty2 = carty * carty;
    cartxs = (cartx < 0)?-1:1;
    cartys = (carty < 0)?-1:1;
    cartxn = cartx/128;                      //normalize x
    rraw = Math.sqrt(cartx2 + carty2);       //raw radius
    rnorm = rraw/90;                        //normalized radius
    if (rraw == 0) {
      sat = 0;
      val = 0;
      rgb = new Array(0,0,0);
      }
    else {
      arad = Math.acos(cartx/rraw);            //angle in radians 
      aradc = (carty>=0)?arad:2*Math.PI - arad;  //correct below axis
      adeg = 360 * aradc/(2*Math.PI);  //convert to degrees
      if (rnorm > 1) {    // outside circle
            rgb = new Array(255,255,255);
            sat = 1;
            val = 1;            
            }
      //else rgb = hsv2rgb(adeg,1,1);
            else if (rnorm >= .5) {
	      sat = 1 - ((rnorm - .5) *2);
              val = 1;
	      rgb = hsv2rgb(adeg,sat,val);
	      }
              else {
                   sat = 1;
	      	   val = rnorm * 2;
	      	   rgb = hsv2rgb(adeg,sat,val);}
   }
   c = rgb2hex(rgb);
   hexColorArray(c);
   hoverColor();
   return false;
}

function hoverColor() {
 if (document.layers) {
  document.layers["democ"].bgColor = threec[2];
 } else if (document.all) {
  document.all["democ"].style.backgroundColor = threec[2];
 } else if (document.getElementById) {
  document.getElementById("democ").style.backgroundColor = threec[2];
 }
 return false;
}
function pickArea(area) {
  pickarea = area;
}
function pickColor() {
    pickareaval = pickarea + "_color";
  document.getElementById(pickarea).style.backgroundColor = threec[1];
  document.getElementById(pickarea + "_color").value = threec[1];

  if (threec[2] == prevc) return false; // prevent duplicate entries in list
  prevc = threec[2];
  thecontents = "";
  thecolors = "";
//  document.getElementById("fulllist").innerHTML += thecolors;
  switch (pickindex) {
   case 0:
   document.getElementById("pa").innerHTML = thecontents;
   document.getElementById("pa").style.backgroundColor = threec[1];
   break;
   case 1:
   document.getElementById("pb").innerHTML = thecontents;
   document.getElementById("pb").style.backgroundColor = threec[1];
   break;
   case 2:
   document.getElementById("pc").innerHTML = thecontents;
   document.getElementById("pc").style.backgroundColor = threec[1];
   break;
   case 3:
   document.getElementById("pd").innerHTML = thecontents;
   document.getElementById("pd").style.backgroundColor = threec[1];
   break;
   case 4:
   document.getElementById("pe").innerHTML = thecontents;
   document.getElementById("pe").style.backgroundColor = threec[1];
   break;
   case 5:
   document.getElementById("pf").innerHTML = thecontents;
   document.getElementById("pf").style.backgroundColor = threec[1];
   break;
   case 6:
   document.getElementById("pg").innerHTML = thecontents;
   document.getElementById("pg").style.backgroundColor = threec[1];
   break;
  }
  pickindex += 1;
  if (pickindex >= picary.length) pickindex = 0;
  setSquare(adeg);
  return false;
}

function setSquare(deg) {
  hue = deg;
  adeg = deg;
  c = rgb2hex(hsv2rgb(hue,1,1));
  squarecolor = c[3];
  if (document.layers) {
     document.layers["wheel"].bgColor = squarecolor;
  } else if (document.all) {
     document.all["wheel"].style.backgroundColor = squarecolor;
  } else if (document.getElementById) {
     document.getElementById("wheel").style.backgroundColor = squarecolor;
  }
}

function initColor() {
 for (i=0; i<7; i++) {
  thecontents = "";
  switch (i) {
   case 0:
   document.getElementById("pa").innerHTML = thecontents;
   document.getElementById("pa").style.backgroundColor = initary[i];
   break;
   case 1:
   document.getElementById("pb").innerHTML = thecontents;
   document.getElementById("pb").style.backgroundColor = initary[i];
   break;
   case 2:
   document.getElementById("pc").innerHTML = thecontents;
   document.getElementById("pc").style.backgroundColor = initary[i];
   break;
   case 3:
   document.getElementById("pd").innerHTML = thecontents;
   document.getElementById("pd").style.backgroundColor = initary[i];
   break;
   case 4:
   document.getElementById("pe").innerHTML = thecontents;
   document.getElementById("pe").style.backgroundColor = initary[i];
   break;
   case 5:
   document.getElementById("pf").innerHTML = thecontents;
   document.getElementById("pf").style.backgroundColor = initary[i];
   break;
   case 6:
   document.getElementById("pg").innerHTML = thecontents;
   document.getElementById("pg").style.backgroundColor = initary[i];
   break;
  }
 }
}

//  End -->


//var mtoggle =  {
  
//  showCode: function(a, id) {
//    a.innerHTML = $(id + "_codediv").visible() ? "Edit" : "Done!"
//    $(id + "_codediv").toggle();
//  },


//Forum BBcode Helpbox messages
bold_help = "Bold text example: [b]your text[/b]";
italic_help = "Italic text example: [i]your text[/i]";
underline_help = "Underline text example: [u]your text[/u]";
quote_help = "Quote text example: [quote=name]text[/quote]";
code_help = "Code display: [code]code[/code]";
img_help = "Insert image example: [img]http://image_url[/img]";
url_help = "URL Example: [url]http://url[/url] or [url=http://url]Link Name[/url]";
fontcolor_help = "Font color example: [color=red]your text[/color]";
fontsize_help = "Font size example: [size=50%]your text[/size]";