if ( use_popups == undefined ) {
	var use_popups = true;
}

function freesitedemo ( loginname )
{
	window.location.href = 'free-sitedemo.php?login=' + loginname;
}

function thisImg ( vid, vgender, vdisplayname, vage )
{

	imgstr = "";
/*

//	imgstr +=  "this.T_TEMP=0;this.T_SHADOWWIDTH=0;this.T_OPACITY=100;this.T_ABOVE=true;this.T_LEFT=true;this.T_WIDTH=0;this.T_OFFSETY=32;this.T_FONTWEIGHT='bold';this.T_FONTCOLOR='SlateGray';this.T_BGCOLOR='#ffffff'";
	imgstr += ";return escape('";
	imgstr += "<img src=getsnap.php";
	imgstr += "?id=" + vid;
	imgstr += "&gender=" + vgender;
	imgstr += "&typ=pic";
	imgstr += "><br>" + vdisplayname;
	imgstr += "&nbsp" + vage;
	imgstr += "')";
*/


	imgstr += "return escape('";
	imgstr += "<img src=getsnap.php";
	imgstr += "?id=" + vid;
	imgstr += "&gender=" + vgender;
	imgstr += "&typ=pic";
	imgstr += "><br>" + vdisplayname;
	imgstr += "&nbsp" + vage;
	imgstr += "')";


//alert( imgstr);

	return imgstr;
}


function gotoURL( vPhp, value ) 
{
      window.location.href = vPhp + value;
	return false;
}

function SetColorHex(string) {                   // select color
  var color = ValidateColor(string);
  if (color == null) { alert("Please set the correct color code: " + string); }        // invalid color
  else {                                                                // valid color
                          // show selected color
  document.getElementById("ColorPreview").style.backgroundColor = '#' + color;
  document.getElementById("ColorHex").value = '#' + color;
  }
}

function ValidateColor(string) {                // return valid color code
  string = string || '';
  string = string + "";
  string = string.toUpperCase();
  var chars = '0123456789ABCDEF';
  var out   = '';

  for (var i=0; i<string.length; i++) {             // remove invalid color chars
    var schar = string.charAt(i);
    if (chars.indexOf(schar) != -1) { out += schar; }
  }

  if (out.length != 6) { return null; }            // check length
  return out;
}

function SetCookie (name,value,expires,path,domain,secure) {
   document.cookie = name + "=" + escape (value) +
                     ((expires) ? "; expires=" + expires.toGMTString() : "") +
                     ((path) ? "; path=" + path : "") +
                     ((domain) ? "; domain=" + domain : "") +
                     ((secure) ? "; secure" : "");
}
