///////////////////////////////////////////////////////////////////////
//     This script is for use in e-StudioMax websites
//
//     It contains a couple of js files writen by other people
//     which can be copied and used. However, the jscript
//     in its entirity cannot be copied and used.
//
//     (c) e-StudioMax.com 2003. all rights reserved
///////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////
//
// Preload Images
//
///////////////////////////////////////////////////////////////////////

var e_StudioMax_images = [
	"/w/images/AddGroupbut.gif",
	"/w/images/AddImage.gif",
	"/w/images/AddStockbut.gif",
	"/w/images/Backbut.gif",
	"/w/images/BotSubMenu.gif",
	"/w/images/ChooseMenuDesignbut.gif",
	"/w/images/ChoosePageDesignbut.gif",
	"/w/images/EditContentsbut.gif",
	"/w/images/EditLogobut.gif",
	"/w/images/EditStockLayupbut.gif",
	"/w/images/Helpbut.gif",
	"/w/images/LeftSubMenu.gif",
	"/w/images/Logoutbut.gif",
	"/w/images/MenudivideLine.gif",
	"/w/images/menuunder.gif",
	"/w/images/menuunderend.gif",
	"/w/images/menuunderlng.gif",
	"/w/images/menuundermdl.gif",
	"/w/images/menuunderstart.gif",
	"/w/images/PageDelbut.gif",
	"/w/images/PageLinkbut.gif",
	"/w/images/PageNewbut.gif",
	"/w/images/PageNewSubbut.gif",
	"/w/images/PageOrderbut.gif",
	"/w/images/PageSecuritybut.gif",
	"/w/images/Pluginsbut.gif",
	"/w/images/RightSubMenu.gif",
	"/w/images/Savebut.gif",
	"/w/images/Tickbut.gif",
	"/w/images/TopSubMenu.gif",
	"/w/images/uploadfile.gif",
    "/w/htmlarea/images/ed_about.gif",
    "/w/htmlarea/images/ed_align_center.gif",
    "/w/htmlarea/images/ed_align_justify.gif",
    "/w/htmlarea/images/ed_align_left.gif",
    "/w/htmlarea/images/ed_align_right.gif",
    "/w/htmlarea/images/ed_blank.gif",
    "/w/htmlarea/images/ed_charmap.gif",
    "/w/htmlarea/images/ed_color_bg.gif",
    "/w/htmlarea/images/ed_color_fg.gif",
    "/w/htmlarea/images/ed_copy.gif",
    "/w/htmlarea/images/ed_custom.gif",
    "/w/htmlarea/images/ed_cut.gif",
    "/w/htmlarea/images/ed_delete.gif",
    "/w/htmlarea/images/ed_format_bold.gif",
    "/w/htmlarea/images/ed_format_italic.gif",
    "/w/htmlarea/images/ed_format_strike.gif",
    "/w/htmlarea/images/ed_format_sub.gif",
    "/w/htmlarea/images/ed_format_sup.gif",
    "/w/htmlarea/images/ed_format_underline.gif",
    "/w/htmlarea/images/ed_help.gif",
    "/w/htmlarea/images/ed_hr.gif",
    "/w/htmlarea/images/ed_html.gif",
    "/w/htmlarea/images/ed_image.gif",
    "/w/htmlarea/images/ed_indent_less.gif",
    "/w/htmlarea/images/ed_indent_more.gif",
    "/w/htmlarea/images/ed_left_to_right.gif",
    "/w/htmlarea/images/ed_link.gif",
    "/w/htmlarea/images/ed_list_bullet.gif",
    "/w/htmlarea/images/ed_list_num.gif",
    "/w/htmlarea/images/ed_paste.gif",
    "/w/htmlarea/images/ed_redo.gif",
    "/w/htmlarea/images/ed_right_to_left.gif",
    "/w/htmlarea/images/ed_save.gif",
    "/w/htmlarea/images/ed_show_border.gif",
    "/w/htmlarea/images/ed_splitcel.gif",
    "/w/htmlarea/images/ed_undo.gif",
    "/w/htmlarea/images/fullscreen_maximize.gif",
    "/w/htmlarea/images/fullscreen_minimize.gif",
    "/w/htmlarea/images/insert_table.gif",
    "/w/htmlarea/plugins/TableOperations/img/cell-delete.gif",
	"/w/htmlarea/plugins/TableOperations/img/cell-insert-after.gif",
	"/w/htmlarea/plugins/TableOperations/img/cell-insert-before.gif",
	"/w/htmlarea/plugins/TableOperations/img/cell-merge.gif",
	"/w/htmlarea/plugins/TableOperations/img/cell-prop.gif",
	"/w/htmlarea/plugins/TableOperations/img/cell-split.gif",
	"/w/htmlarea/plugins/TableOperations/img/col-delete.gif",
	"/w/htmlarea/plugins/TableOperations/img/col-insert-after.gif",
	"/w/htmlarea/plugins/TableOperations/img/col-insert-before.gif",
	"/w/htmlarea/plugins/TableOperations/img/col-split.gif",
	"/w/htmlarea/plugins/TableOperations/img/row-delete.gif",
	"/w/htmlarea/plugins/TableOperations/img/row-insert-above.gif",
	"/w/htmlarea/plugins/TableOperations/img/row-insert-under.gif",
	"/w/htmlarea/plugins/TableOperations/img/row-prop.gif",
	"/w/htmlarea/plugins/TableOperations/img/row-split.gif",
	"/w/htmlarea/plugins/TableOperations/img/table-prop.gif"
  ];

  // make sure not to end the last item with comma (,)
  // otherwise IE enters the twilight zone

  for (var i = 0; i < e_StudioMax_images.length; i++) {
    var src = e_StudioMax_images[i];
    var img = new Image();
    img.src = src;
    e_StudioMax_images[i] = img;
  }


///////////////////////////////////////////////////////////////////////
//
// CK Editor Javascript
//
///////////////////////////////////////////////////////////////////////
var LastZIndex = 0

function LoadFCK(idDiv){
	//alert("here: " + idDiv)
	var objLastEditDivID = getFrmObj('LastEditDivID')
	objLastEditDivID.value = idDiv
	var div = getFrmObj(idDiv);
	var objHeadlineDiv = getFrmObj('HeadlineDiv')
	if(objHeadlineDiv){
		LastZIndex = objHeadlineDiv.style.zIndex
		objHeadlineDiv.style.zIndex = "1"
	}
	var objLastEditDivContent = getFrmObj('LastEditDivContent')
	objLastEditDivContent.value = div.innerHTML
	var fck = new FCKeditor(idDiv);
	if(appServer == "element78"){
		fck.BasePath = '/fckeditor/'
	}else{
		fck.BasePath = '/w/fckeditor/'
	}
	fck.Config['ToolbarLocation'] = 'Out:FCKToobarDiv';
	var objFCKToobarDiv = getFrmObj('FCKToobarDiv')
	objFCKToobarDiv.style.width='100%'
	if(appServer == "element78"){
		fck.Config['EditorAreaCSS'] = '/FCKEDitorCSS.asp?PageNo=' + intPageNo;
	}else{
		fck.Config['EditorAreaCSS'] = '/w/FCKEDitorCSS.asp?PageNo=' + intPageNo;
	}
	fck.ToolbarSet = 'WooToolbar' ;
	fck.Height=500
	//fck.Config['SkinPath'] = '/w/FCKEditor/editor/skins/office2003/' ;
	fck.Value = div.innerHTML
	div.innerHTML = fck.CreateHtml();
	//alert(div.style.zIndex)
}

function close_fckeditor(){
	var objLastEditDivID = getFrmObj('LastEditDivID');
	//alert(objLastEditDivID.value);
	var objLastEditDivContent = getFrmObj('LastEditDivContent');
	var div = getFrmObj(objLastEditDivID.value);
	var objHeadlineDiv = getFrmObj('HeadlineDiv')
	if(objHeadlineDiv){
		objHeadlineDiv.style.zIndex = LastZIndex
	}
	//alert(objLastEditDivID.value);
	//alert(objLastEditDivContent.value);
	div.innerHTML = objLastEditDivContent.value;
	var ToolBarDiv = getFrmObj('FCKToobarDiv');
	ToolBarDiv.innerHTML="";
	ToolBarDiv.style.width='1'
}


// called on save
function doSave(){
        //alert('Saved.');
        btnSavePageAll()
        return false; //this disables default action (submitting the form)
}

// called when FCKeditor is done starting..
function FCKeditor_OnComplete( editorInstance ){
        editorInstance.LinkedField.form.onsubmit = doSave;
}


///////////////////////////////////////////////////////////////////////
//
// Login Box Edit Javascript
//
///////////////////////////////////////////////////////////////////////

function btnSaveLoginBoxClick(){
	var objFrm = getFrmObj('frmEditLoginBox');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=editLoginBox"
	objFrm.submit()
}

function btnLoginBoxClick(){
	var objLog = new getObj('LoginBoxFields');
	if (objLog.style.visibility=='visible'){
		objLog.style.visibility='hidden'
	}else{
		objLog.style.visibility='visible'
	}
}

///////////////////////////////////////////////////////////////////////
//
// Subscription Edit Javascript
//
///////////////////////////////////////////////////////////////////////

function btnDeleteSubscripClick(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=DeleteSubcrip&SubID=" + which
	objFrm.submit()
}

function btnAddSubscripClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=AddNewSubscrip"
	objFrm.submit()
}

///////////////////////////////////////////////////////////////////////
//
// Category Edit Javascript
//
///////////////////////////////////////////////////////////////////////

function CatDiv(which) {
	var c = getAnchorPosition("Anchor" + which);
	var o = new getObj('EditCatagoryFields' + which);
	//var o = eval("document.all['EditCatagoryFields" + which + "']");
	o.style.left = c.x-90;
	o.style.top = c.y-120;
}

function btnEditCatagoryClick(which){
	var objCat = new getObj('EditCatagoryFields' + which);
	//objCat=eval("document.all['EditCatagoryFields" + which + "'].style")
	if (objCat.style.visibility=='visible'){
		objCat.style.visibility='hidden'
	}else{
		objCat.style.visibility='visible'
	}
	CatDiv(which)
}

function btnSaveCatClick(which,GoPage){
	var objFrm = getFrmObj('frmEditCats');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=editCatagory&CatPageNo=" + which + "&PageTo=" + GoPage
	objFrm.submit()
}

function btnDeleteCatClick(which,GoPage){
	var iii=window.confirm('This command will delete all the sub categories and stock items that are relevant to this category page. \n\nAre you sure you want to delete this page?')
	if (iii){
		var objFrm = getFrmObj('frmEditCats');
		objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=DeletePage&CatPageNo=" + which + "&PageTo=" + GoPage
		objFrm.submit()
	}
}

///////////////////////////////////////////////////////////////////////
//
// Model Edit Javascript
//
///////////////////////////////////////////////////////////////////////

function btnAddModelClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=AddNewModel"
	objFrm.submit()
}

function btnDeleteModelClick(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=deleteModel&ModelID=" + which
	objFrm.submit()
}


///////////////////////////////////////////////////////////////////////
//
// Listing Edit Javascript
//
///////////////////////////////////////////////////////////////////////

function btnAddListingClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=AddNewListing"
	objFrm.submit()
}

function ListingDiv(which) {
	var c = getAnchorPosition("Anchor" + which);
	var o = new getObj('EditListingFields' + which);
	o.style.left = c.x-90;
	o.style.top = c.y-120;
}

function btnEditListingClick(which){
	var objImageG = new getObj('EditListingFields' + which);
	if (objImageG.style.visibility=='visible'){
		objImageG.style.visibility='hidden'
	}else{
		objImageG.style.visibility='visible'
	}
	ListingDiv(which)
}

function btnSaveListingClick(which){
	var objFrm = getFrmObj('frmEditListing');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=editListing&ListingID=" + which
	objFrm.submit()
}

function btnDeleteListingClick(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=deleteListing&ListingID=" + which
	objFrm.submit()
}

///////////////////////////////////////////////////////////////////////
//
// Event Edit Javascript
//
///////////////////////////////////////////////////////////////////////

function btnAddEventClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=AddNewEvent"
	objFrm.submit()
}

function btnAddActivityClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=AddNewActivity"
	objFrm.submit()
}

function EventDiv(which) {
	var c = getAnchorPosition("Anchor" + which);
	var o = new getObj('EditEventFields' + which);
	o.style.left = parseInt(c.x)-90 + "px";
	o.style.top = parseInt(c.y)-120 + "px";
}

function editHTMLEvent(id){
	window.open("EventHTMLEditor.asp?EventID=" + id + "&PageNo=" + intPageNo, "EventHTMLEditor","width=840,height=740,top=0,left=0,scrollbars=0,resizable=1")
}

function btnEditEventClick(which){
	var objImageG = new getObj('EditEventFields' + which);
	if (objImageG.style.visibility=='visible'){
		objImageG.style.visibility='hidden'
	}else{
		objImageG.style.visibility='visible'
	}
	EventDiv(which)
}

function btnSaveEventClick(which){
	var objFrm = getFrmObj('frmEditEvent');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=editEvent&EventID=" + which
	objFrm.submit()
}

function btnDeleteEventClick(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=deleteEvent&EventID=" + which
	objFrm.submit()
}

function btnDeleteActivityClick(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=deleteActivity&StockID=" + which
	objFrm.submit()
}


///////////////////////////////////////////////////////////////////////
//
// Image Gallery Edit Javascript
//
///////////////////////////////////////////////////////////////////////

function btnAddImageGClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + " &Save=AddNewImageG"
	objFrm.submit()
}

function ImageGDiv(which) {
	var c = getAnchorPosition("Anchor" + which);
	var o = new getObj('EditImageGFields' + which);
	//var o = eval("document.all['EditImageGFields" + which + "']");
	o.style.left = c.x-90;
	o.style.top = c.y-120;
}

function btnEditImageGClick(which){
	var objImageG = new getObj('EditImageGFields' + which);
	//objImageG=eval("document.all['EditImageGFields" + which + "'].style")
	if (objImageG.style.visibility=='visible'){
		objImageG.style.visibility='hidden'
	}else{
		objImageG.style.visibility='visible'
	}
	ImageGDiv(which)
}

function btnSaveImageGClick(which){
	var objFrm = getFrmObj('frmEditGallery');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=editImageG&ImageID=" + which
	objFrm.submit()
}

function btnDeleteImageGClick(which){
	var objFrm = getFrmObj('frmEditGallery');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=deleteImageG&ImageID=" + which
	objFrm.submit()
}

///////////////////////////////////////////////////////////////////////
//
// Custom Form Javascript
//
///////////////////////////////////////////////////////////////////////

function btnCustomFormClick(){
	var objCat = new getObj('divEditCustomForm');
	if (objCat.style.visibility=='visible'){
		objCat.style.visibility='hidden'
	}else{
		objCat.style.visibility='visible'
	}
}

function btnSaveCustomFormClick(){
	var objFrm = getFrmObj('frmEditCF');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=SaveCustomForm"
	objFrm.submit()
}


///////////////////////////////////////////////////////////////////////
//
// Main menu & toolbar javascript
//
///////////////////////////////////////////////////////////////////////

function MainMenuWidth(){
	var myWidth = 0
	if( typeof( window.innerWidth ) == 'number' ) {
    		//Non-IE
    		myWidth = window.innerWidth;
  	} else {
   	 	if( document.documentElement && ( document.documentElement.clientWidth) ) {
      		//IE 6+ in 'standards compliant mode'
      		myWidth = document.documentElement.clientWidth;
    	} else {
      		if( document.body && ( document.body.clientWidth) ) {
        		//IE 4 compatible
        		myWidth = document.body.clientWidth;
      		}
    	}
  	}
  	var obj = new getObj('MainMenuTB');
  	obj.style.width=parseInt(myWidth);

  	var obj = new getObj('MainToolbar');
  	obj.style.width=parseInt(myWidth);

  	var obj = new getObj('MainMenuTitle');
  	obj.style.width=parseInt(myWidth);

  	var obj = new getObj('loadingtoolbar');
  	obj.style.width=parseInt(myWidth);

  	var obj = new getObj('MainMenuTB');
  	obj.style.visibility='visible'

  	var obj = new getObj('MainToolbar');
  	obj.style.visibility='visible'

  	var obj = new getObj('MainMenuTitle');
  	obj.style.visibility='visible'

}

var TimerIDMainTB;
var lastLayerTB = -1
function layerHandlerMainTB(whichLayer, roll_on) {
	if (roll_on=='on') {
    	clearTimeout(TimerIDMainTB);
    	if (lastLayerTB!= -1){
    		changeStateTB('TBsub' + lastLayerTB, 'off');
			mouseouttdMainTB('TBtdMain' + lastLayerTB);
		}
		changeZIndex('TBsub' + whichLayer);
		changeStateTB('TBsub' + whichLayer, 'on');
		mouseovertdMainTB('TBtdMain' + whichLayer);
		lastLayerTB= whichLayer
 	} else {
    	clearTimeout(TimerIDMainTB);
    	TimerIDMainTB = setTimeout('hideSubsTB()', 900);
  	}
}

function hideSubsTB() {
	if (lastLayerTB!= -1){
    	changeStateTB('TBsub' + lastLayerTB, 'off');
		mouseouttdMainTB('TBtdMain' + lastLayerTB);
	}
}

//change z-index
function changeZIndex(layerRef){
	if (navigator.family == 'nn4') {
		eval("document.layers['" + layerRef + "'].zIndex=2001");
	}
	else if (navigator.family == 'ie4') {
		eval("document.all['" + layerRef + "'].style.zIndex=2001");
	}
	else if (navigator.family == 'gecko') {
		eval("document.getElementById('" + layerRef + "').style.zIndex=2001");
	}
}

//change images
if (document.images) {
	imagtb = new Array()
	imagtb[0] = "/w/images/movecursor.gif"
	imagtb[1] = "/w/images/LockElements.gif"

	imtb = new Array()
	for (var v = 0; v < imagtb.length; v++){
		imtb[v] = new Image()
		imtb[v].src = imagtb[v]
	}
}

function swtchtb(imgname,imgname2) {
	var obj = getFrmObj("lockelements");
	var imgobj = getFrmObj(imgname);
	var imgobj2 = getFrmObj(imgname2);
	if (obj.value=="no"){
		obj.value="yes"
		if (document.images) {
			imgobj.src = imtb[1].src;
			imgobj2.src = imtb[1].src;
		}
		//alert(imgobj.src)
	}else{
		obj.value="no"
		if (document.images) {
			imgobj.src = imtb[0].src;
			imgobj2.src = imtb[0].src;
		}
		//alert(imgobj.src)
	}
}



// change visibility state
var displayTB= new String()
var nodisplayTB = new String()
displayTB= "visible";
nodisplayTB = "hidden";

function changeStateTB (layerRef, state) {
	if (state == "on") {
		var divState = displayTB;
	}else{
		var divState = nodisplayTB;
	}
	if (navigator.family == 'nn4') {
		eval("document.layers['" + layerRef + "'].visibility='" + divState +"'");
	}
	else if (navigator.family == 'ie4') {
		eval("document.all['" + layerRef + "'].style.visibility='" + divState + "'");
	}
	else if (navigator.family == 'gecko') {
		eval("document.getElementById('" + layerRef + "').style.visibility='" + divState + "'");
	}
}

//change background color
var activecolorMainTB="#477a7d"
var inactivecolorMainTB="buttonface"
var activecolorSubTB="#477a7d"
var inactivecolorSubTB="buttonface"

function mouseovertdMainTB(which) {
	if (activecolorMainTB!="none"){
		if (navigator.family == 'nn4') {
			eval("document.ids['" + which + "'].className='tdborder1'");
		}
		else if (navigator.family == 'ie4') {
			eval("document.all." + which + ".className='tdborder1'");
		}
		else if (navigator.family == 'gecko') {
			eval("document.getElementById('" + which + "').className='tdborder1'");
		}
	}
}

function mouseovertdSubTB(which) {
	if (activecolorSubTB!="none"){
		if (navigator.family == 'nn4') {
			eval("document.ids['" + which + "'].backgroundColor =activecolorSubTB");
		}
		else if (navigator.family == 'ie4') {
			eval("document.all." + which + ".style.backgroundColor =activecolorSubTB");
		}
		else if (navigator.family == 'gecko') {
			eval("document.getElementById('" + which + "').style.backgroundColor =activecolorSubTB");
		}
	}
}

function mouseouttdMainTB(which) {
	if (inactivecolorMainTB!="none"){
		if (navigator.family == 'nn4') {
			eval("document.ids['" + which + "'].className='tdborder0'");
		}
		else if (navigator.family == 'ie4') {
			eval("document.all." + which + ".className='tdborder0'");
		}
		else if (navigator.family == 'gecko') {
			eval("document.getElementById('" + which + "').className='tdborder0'");
		}
	}
}

function mouseouttdSubTB(which) {
	if (inactivecolorSubTB!="none"){
		if (navigator.family == 'nn4') {
			eval("document.ids['" + which + "'].backgroundColor =inactivecolorSubTB");
		}
		else if (navigator.family == 'ie4') {
			eval("document.all." + which + ".style.backgroundColor =inactivecolorSubTB");
		}
		else if (navigator.family == 'gecko') {
			eval("document.getElementById('" + which + "').style.backgroundColor =inactivecolorSubTB");
		}
	}
}

///////////////////////////////////////////////////////////////////////
//
// Color Picker Javascript
//
///////////////////////////////////////////////////////////////////////

var ColorPickerDiv
function ShowColorPicker(which){
	var ColorPicker
	ColorPickerDiv = which
	var SM = String.fromCharCode(34)
	ColorPicker = "<table border='0' cellspacing='0' cellpadding='0' width='120'><tr><td width='60' height='210'><table style='font-family: Arial; font-size: 8pt' cellpadding='0'>"
	ColorPicker += "<tr><td bgcolor='#000000' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#000000')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#000033' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#000033')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#000066' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#000066')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#000099' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#000099')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#0000cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#0000cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#0000ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#0000ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#003300' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#003300')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#003333' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#003333')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#003366' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#003366')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#003399' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#003399')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#0033cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#0033cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#0033ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#0033ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#006600' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#006600')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#006633' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#006633')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#006666' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#006666')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#006699' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#006699')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#0066cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#0066cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#0066ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#0066ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#009900' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#009900')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#009933' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#009933')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#009966' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#009966')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#009999' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#009999')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#0099cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#0099cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#0099ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#0099ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#00cc00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00cc00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#00cc33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00cc33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#00cc66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00cc66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#00cc99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00cc99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#00cccc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00cccc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#00ccff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00ccff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#00ff00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00ff00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#00ff33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00ff33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#00ff66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00ff66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#00ff99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00ff99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#00ffcc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00ffcc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#00ffff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#00ffff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#330000' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#330000')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#330033' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#330033')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#330066' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#330066')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#330099' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#330099')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#3300cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#3300cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#3300ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#3300ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#333300' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#333300')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#333333' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#333333')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#333366' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#333366')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#333399' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#333399')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#3333cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#3333cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#3333ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#3333ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#336600' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#336600')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#336633' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#336633')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#336666' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#336666')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#336699' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#336699')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#3366cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#3366cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#3366ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#3366ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#339900' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#339900')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#339933' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#339933')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#339966' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#339966')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#339999' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#339999')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#3399cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#3399cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#3399ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#3399ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#33cc00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33cc00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#33cc33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33cc33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#33cc66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33cc66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#33cc99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33cc99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#33cccc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33cccc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#33ccff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33ccff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#33ff00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33ff00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#33ff33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33ff33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#33ff66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33ff66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#33ff99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33ff99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#33ffcc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33ffcc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#33ffff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#33ffff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#660000' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#660033')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#660033' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#660033')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#660066' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#660066')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#660099' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#660099')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#6600cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#6600cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#6600ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#6600ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#663300' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#663300')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#663333' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#663333')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#663366' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#663366')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#663399' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#663399')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#6633cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#6633cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#6633ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#6633ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#666600' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#666600')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#666633' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#666633')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#666666' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#666666')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#666699' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#666699')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#6666cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#6666cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#6666ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#6666ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#669900' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#669900')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#669933' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#669933')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#669966' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#669966')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#669999' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#669999')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#6699cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#6699cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#6699ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#6699ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#66cc00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66cc00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#66cc33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66cc33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#66cc66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66cc66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#66cc99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66cc99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#66cccc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66cccc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#66ccff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66ccff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#66ff00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66ff00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#66ff33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66ff33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#66ff66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66ff66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#66ff99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66ff99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#66ffcc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66ffcc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#66ffff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#66ffff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr></table></td>"
	ColorPicker += "<td width='60' height='210'><table style='font-family: Arial; font-size: 8pt' cellpadding='0'>"
	ColorPicker += "<tr><td bgcolor='#990000' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#990000')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#990033' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#990033')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#990066' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#990066')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#990099' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#990099')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#9900cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#9900cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#9900ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#9900ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#993300' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#993300')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#993333' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#993333')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#993366' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#993366')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#993399' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#993399')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#9933cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#9933cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#9933ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#9933ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#996600' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#996600')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#996633' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#996633')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#996666' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#996666')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#996699' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#996699')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#9966cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#9966cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#9966ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#9966ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#999900' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#999900')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#999933' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#999933')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#999966' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#999966')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#999999' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#999999')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#9999cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#9999cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#9999ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#9999ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#99cc00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99cc00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#99cc33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99cc33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#99cc66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99cc66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#99cc99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99cc99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#99cccc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99cccc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#99ccff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99ccff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#99ff00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99ff00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#99ff33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99ff33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#99ff66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99ff66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#99ff99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99ff99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#99ffcc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99ffcc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#99ffff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#99ffff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#cc0000' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc0000')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc0033' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc0033')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc0066' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc0066')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc0099' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc0099')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc00cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc00cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc00ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc00ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#cc3300' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc3300')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc3333' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc3333')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc3366' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc3366')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc3399' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc3399')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc33cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc33cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc33ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc33ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#cc6600' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc6600')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc6633' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc6633')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc6666' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc6666')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc6699' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc6699')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc66cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc66cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc66ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc66ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#cc9900' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc9933')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc9933' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc9933')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc9966' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc9966')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc9999' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc9999')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc99cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc99cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cc99ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cc99ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#cccc00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cccc00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cccc33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cccc33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cccc66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cccc66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cccc99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cccc99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#cccccc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#cccccc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ccccff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ccccff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#ccff00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ccff00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ccff33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ccff33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ccff66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ccff66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ccff99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ccff99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ccffcc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ccffcc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ccffff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ccffff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#ff0000' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff0000')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff0033' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff0033')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff0066' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff0066')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff0099' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff0099')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff00cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff00cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff00ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff00ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#ff3300' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff3300')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff3333' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff3333')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff3366' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff3366')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff3399' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff3399')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff33cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff33cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff33ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff33ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#ff6600' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff6600')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff6633' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff6633')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff6666' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff6666')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff6699' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff6699')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff66cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff66cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff66ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff66ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#ff9900' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff9900')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff9933' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff9933')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff9966' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff9966')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff9999' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff9999')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff99cc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff99cc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ff99ff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ff99ff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#ffcc00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffcc00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ffcc33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffcc33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ffcc66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffcc66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ffcc99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffcc99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ffcccc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffcccc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ffccff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffccff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr><tr><td bgcolor='#ffff00' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffff00')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ffff33' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffff33')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ffff66' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffff66')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ffff99' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffff99')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ffffcc' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffffcc')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "<td bgcolor='#ffffff' height='10' style='border: 1 solid #000000'><a href='#' style='text-decoration:none' onclick=" + SM + "ReturnHex('#ffffff')" + SM + ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td>"
	ColorPicker += "</tr></table></td></tr></table>"

	if (navigator.family == 'nn4') {
		var divObj=eval("document.layers['div" + which + "']");
		var divObj2=eval("document.layers['div" + which + "']");
	}
	else if (navigator.family == 'ie4') {
		var divObj=eval("document.all['div" + which + "'].style");
		var divObj2=eval("document.all['div" + which + "']");
	}
	else if (navigator.family == 'gecko') {
		var divObj=eval("document.getElementById('div" + which + "').style");
		var divObj2=eval("document.getElementById('div" + which + "')");
	}
	//var divObj=eval("document.all['div" + which + "']")
	divObj2.innerHTML=ColorPicker
	if (divObj.visibility=="hidden"){
		divObj.visibility="visible"
	}
}

function ReturnHex(which){
	var txtObj=getFrmObj("txt" + ColorPickerDiv)
	txtObj.value=which
	var divObj=getFrmObj("div" + ColorPickerDiv)
	if (divObj.style.visibility=="visible"){
		divObj.style.visibility="hidden"
	}
}


///////////////////////////////////////////////////////////////////////
//
// PAGE EDITING JAVASCRIPT
//
///////////////////////////////////////////////////////////////////////

function btnShowPageActivity(){
	var objAct = getFrmObj('pageact');
	objAct.innerHTML = "<table border=0 bgcolor='white' style='border:1px solid black;'><tr><td><img src='/w/images/29.gif' width='30px' height='30px' border=0></td></tr></table>"
	if (objAct.style.visibility == "hidden"){
		OpenActPanel()
	}else{
		CloseActPanel()
	}
	httpRequest('GetPageVisits.asp?PageNo=' + intPageNo, DisplayAct, "data");
}

function DisplayAct(data){
	var objAct = getFrmObj('pageact');
	if (data != "None"){
		objAct.innerHTML = data
	}else{
		objAct.innerHTML = "<table bgcolor='white' style='border:1px solid black;'><tr><td>No Data</td></tr></table>"
	}
}

function OpenActPanel(){
	var objAct = getFrmObj('pageact');
	objAct.style.visibility = "visible"
	objAct.style.zIndex = "300"
	objAct.style.height = "25px"
	objAct.style.width = "50px"
	var c = getAnchorPosition("AnchorAct");
	objAct.style.left = (parseInt(c.x) -20) + "px"
	objAct.style.top = (parseInt(c.y) + 10) + "px";
}

function CloseActPanel(){
	var StockDetails = getFrmObj('pageact')
	StockDetails.style.visibility = "hidden"
	StockDetails.style.zIndex = "0"
	StockDetails.style.height = "0px"
	StockDetails.style.width = "0px"
	StockDetails.style.left = "-100px";
	StockDetails.style.top = "-100px";
}

function btnLogoutClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="Login.asp?PageNo=" + intPageNo + "&Login=logout"
	objFrm.submit()
}

function btnAddFlashGClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=AddFlashGallery"
	objFrm.submit()
}

function btnAddFBannerClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=AddFlashBanner"
	objFrm.submit()
}

function DeleteFBanner(id){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=deleteFlashB&FlashBannerID=" + id
	objFrm.submit()
}

function btnAddAudioPClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=AddAudioPlayer"
	objFrm.submit()
}


function buildAudioPlayer(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=UpdateAudioPlayer"
	objFrm.submit()
}

function delAudioPlayer(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=delAudioPlayer"
	objFrm.submit()
}

function EditFG(id){
	window.open('EditFlashGallery.asp?PageNo=' + intPageNo + '&FGID=' + id,'FlashGalleryEdiot','width=610, height=700, scrollbars=1,resizable=1')
}

function DeleteFG(id){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=deleteFlashG&FlashGalleryID=" + id
	objFrm.submit()
}

function btnAddCatagoryClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=AddNewCatagory"
	objFrm.submit()
}


function btnUploadImageClick(){
	var obj = new getObj('UploadImages');
	if (obj.style.visibility=='visible'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
	}
	if (obj.style.top<75){
		obj.style.top=80
	}
}

function btnEditPageBkClick(){
	window.open('PageFormatEdit.asp?PageNo=' + intPageNo,'PageFormatEdit','width=610, height=700, scrollbars=1,resizable=1')
}

function btnEditPageBkdblClick(){
	window.open('PageFormatEdit.asp?PageNo=' + intPageNo,'PageFormatEdit','width=610, height=700, scrollbars=1,resizable=1')
}

function StockManage(){
	var obj = new getObj('divStockManage');
	var obj1 = new getObj('txtStockManageTBOpen');
	if (obj1.value=='on'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
	}
	chkTickBox_click('txtStockManageTBOpen')
	if (obj.style.top<75){
		obj.style.top=80
	}
}

function PageDesign(){
	var obj = new getObj('divPageDesign');
	var obj1 = new getObj('txtPageDesignTBOpen');
	if (obj1.value=='on'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
	}
	if (obj.style.top<75){
		obj.style.top=80
	}
}

function AddDelPages(){
	var obj = new getObj('divAddDelPages');
	var obj1 = getFrmObj('txtAddDelPagesTBOpen');
	if (obj1.value=='on'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
	}
	chkTickBox_click('txtAddDelPagesTBOpen')
}

function ExtraFunctions(){
	var obj = getFrmObj('DivExtraFunctions');
	var obj1 = getFrmObj('txtExtraFunctionsTBOpen');
	if (obj1.value=='on'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
	}
	if (obj.style.top<75){
		obj.style.top=80
	}
	chkTickBox_click('txtExtraFunctionsTBOpen')
}

function SiteEdit(){
	var obj = getFrmObj('SiteEditButtons');
	var obj1 = getFrmObj('txtSiteEditTBOpen');
	if (obj1.value=='on'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
	}
	if (obj.style.top<75){
		obj.style.top=80
	}
	chkTickBox_click('txtSiteEditTBOpen')
}

function HiddenPages(){
	var obj = new getObj('HiddenPagesMenu');
	var obj1 = new getObj('txtHiddenPagesMenuOpen');
	if (obj1.value=='on'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
	}
	chkTickBox_click('txtHiddenPagesMenuOpen')
}

function Plugins(){
	var obj = new getObj('PluginToolBar');
	var obj1 = new getObj('txtPluginTBOpen');
	if (obj1.value=='on'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
	}
	chkTickBox_click('txtPluginTBOpen')
}

//Let Only Numbers in
function checkIt(evt) {
    evt = (evt) ? evt : window.event
         var charCode = (evt.which) ? evt.which : evt.keyCode
              if (charCode > 31 && (charCode < 48 || charCode > 57)) {
				if (charCode!=46){
                   alert('This field only accepts numbers or decimal points.')
                   status = "This field accepts numbers only."
                   return false
                }
              }
              status = ""
         return true
}

var EditContent="no"

function btnManageURLClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="ManageURL.asp"
	objFrm.submit()
}

function btnViewHitsClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="SiteActivity.asp?ReportYear=" + dtYear + "&ReportMonth=" + dtMonth
	objFrm.submit()
}

function btnGotoPageClick(){
	var objFrm = getFrmObj('frmEdit');
	var obj = new getObj('txtGoToPage');
	if(obj.value!=""){
		objFrm.action="edit.asp?PageNo=" + document.all.txtGoToPage.value + "&save=GotoPage"
		objFrm.submit()
	}else{
		alert("You must enter the number of the page you want to go to into the box next to the Goto Page button!")
	}
}

function checkPageNameIT(evt,field){
	objPageName = getFrmObj(field)
	objPageName.value = "1"
}

function checkPageURLNameIT(evt,field){
	objPageName = getFrmObj(field)
	objPageName.value = "1"
}

function btnSavePageAll(){
	if (intUserLevel > 997){
		objCheckPageName = getFrmObj("checkPageName")
		objCheckPageURLName = getFrmObj("checkPageURLName")
		//alert("CheckPageURLName: " + parseInt(objCheckPageURLName.value) + ", CheckPageName: " + parseInt(objCheckPageName.value))
		if(parseInt(objCheckPageName.value)==1 || parseInt(objCheckPageURLName.value)==1){
			if(parseInt(objCheckPageName.value)==1 && parseInt(objCheckPageURLName.value)==0){
				objPageName = getFrmObj("txtPageName")
				//alert('FindPageName.asp?PageNo=' + intPageNo + "&PageName=" + objPageName.value)
				httpRequest('FindPageName.asp?PageNo=' + intPageNo + "&PageName=" + objPageName.value, SavePageData, "data");
			}else{
				if(parseInt(objCheckPageName.value)==1 && parseInt(objCheckPageURLName.value)==1){
					objPageName = getFrmObj("txtPageURLName")
					//alert('FindPageName.asp?PageNo=' + intPageNo + "&PageName=" + objPageName.value)
					httpRequest('FindPageName.asp?PageNo=' + intPageNo + "&PageName=" + objPageName.value, SavePageData, "data");
				}else{
					if(parseInt(objCheckPageName.value)==0 && parseInt(objCheckPageURLName.value)==1){
						objPageName = getFrmObj("txtPageURLName")
						//alert('FindPageName.asp?PageNo=' + intPageNo + "&PageName=" + objPageName.value)
						httpRequest('FindPageName.asp?PageNo=' + intPageNo + "&PageName=" + objPageName.value, SavePageData, "data");
					}
				}
			}

		}else{
			objPageName = getFrmObj("txtPageURLName")
			//alert('FindPageName.asp?PageNo=' + intPageNo + "&PageName=" + objPageName.value)
			httpRequest('FindPageName.asp?PageNo=' + intPageNo + "&PageName=" + objPageName.value, SavePageData, "data");
		}
	}else{
		var objFrm = getFrmObj('frmEdit');
		objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=saveContent"
		objFrm.submit()
	}
}

function btnSavePageAllLink(){
	objCheckPageName = getFrmObj("checkPageName")
	objCheckPageURLName = getFrmObj("checkPageURLName")
	if(parseInt(objCheckPageName.value)==1 || parseInt(objCheckPageURLName.value)==1){
		if(parseInt(objCheckPageName.value)==1 && parseInt(objCheckPageURLName.value)==0){
			objPageName = getFrmObj("txtPageName")
			httpRequest('FindPageName.asp?PageNo=' + intPageNo + "&PageName=" + objPageName.value, SavePageData, "data");
		}else{
			if(parseInt(objCheckPageName.value)==1 && parseInt(objCheckPageURLName.value)==1){
				objPageName = getFrmObj("txtPageURLName")
				httpRequest('FindPageName.asp?PageNo=' + intPageNo + "&PageName=" + objPageName.value, SavePageData, "data");
			}else{
				if(parseInt(objCheckPageName.value)==0 && parseInt(objCheckPageURLName.value)==1){
					objPageName = getFrmObj("txtPageURLName")
					httpRequest('FindPageName.asp?PageNo=' + intPageNo + "&PageName=" + objPageName.value, SavePageData, "data");
				}
			}
		}

	}else{
		var objFrm = getFrmObj('frmEdit');
		objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=yes"
		objFrm.submit()
	}
}

function SavePageData(data){
	//alert(data)
	if(data == "-1"){
		var objFrm = getFrmObj('frmEdit');
		objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=yes"
		objFrm.submit()
	}else{
		var cpn=window.confirm('This Page URL Name is currently being used. \n\nTo ensure you can navigate to this page, the Page Number will be added to the Page URL Name (i.e: PageURLName-PageNo). \n\nDo you want to continue?')
		if (cpn){
			objPageName = getFrmObj("txtPageURLName")
			objPageName.value = objPageName.value + "-" + intPageNo
			var objFrm = getFrmObj('frmEdit');
			objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=yes"
			objFrm.submit()
		}else{
			alert("Please change the Page URL Name! \n\nNOTE: To edit Page URL Name, go to Page>Page Properties.")
		}
	}
}

function btnSavePageContentClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=saveContent"
	objFrm.submit()
}

function btnSaveClick2(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=" + which
	objFrm.submit()
}

function btnSaveClick3(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=yes"
	objFrm.submit()
}

function btnSaveUploadClick(which){
	var objFrm = getFrmObj('frmEditUpload');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=" + which
	objFrm.submit()
}

function btnSaveUpload2Click(which){
	var objFrm = getFrmObj('frmEditUpload2');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=" + which
	objFrm.submit()
}

function btnSaveClick4(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=" + which + "&HoriVert=" + intHori_Vert_Menu
	objFrm.submit()
}

function btnSaveMenuClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=SaveMenu"
	objFrm.submit()
}

function btnAddSubPageClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=AddNewPage&SubPage=yes&FromPageNo=" + intPageNo + "&ThisPageLevel=" + intPageLevel + "&ParentPageNo=" + intPageParentNo
	objFrm.submit()
}

function btnPageDesign(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=ChangePageFormat&NewFormat=" + which
	objFrm.submit()
}

function btnMenuDesign(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=ChangeMenuDesign&NewFormat=" + which
	objFrm.submit()
}

function btnDeletePageClick(){
	var objFrm = getFrmObj('frmEdit');
	var iii=window.confirm('This command will delete all the sub pages and stock items that are relevant to this page. \n\nAre you sure you want to delete this page?')
	if (iii){
		objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=DeletePage"
		objFrm.submit()
	}
}

function btnDeleteStockClick(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=deleteStock&StockID=" + which
	objFrm.submit()
}

function btnDeleteStockFromPageClick(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=deleteStockFromPage&StockID=" + which
	objFrm.submit()
}

function btnAddStockClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=addStock"
	objFrm.submit()
}

function btnAddSurveyClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=addSurvey"
	objFrm.submit()
}

function btnDelSurveyClick(){
	v=confirm("WARNING! You must ensure that all the questions are deleted first!\n\nHave you deleted all the Questions?")
	if(v){
		var objFrm = getFrmObj('frmEdit');
		objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=deleteSurvey"
		objFrm.submit()
	}
}

function deleteQ(which){
	var frmObj=getFrmObj('frmEdit');
	frmObj.action="edit.asp?PageNo=" + intPageNo + "&save=DeleteQ&QID=" + which
	frmObj.submit();
}

function editQ(which, comp){
	var iii=window.confirm("When you edit this question it will delete all previous client's answers! \n\nAre you sure you want to proceed?")
	if (iii){
		window.open("AddCustomQuestions.asp?fromPage=" + intPageNo + "&QID=" + which + "&CompID=" + comp,"EditQ","width=550,height=600,top=0,left=0,scrollbars=1,resizable=1")
	}
}

function createStandard(which){
	var frmObj=getFrmObj('frmEdit');
	frmObj.action="edit.asp?PageNo=" + intPageNo + "&save=createStandard&QID=" + which
	frmObj.submit();
}

function AddProductItem(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=addExistingStock&StockID=" + which
	objFrm.submit()
}

function btnAddAdvert(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=AddAdvert"
	objFrm.submit()
}

function btnEditAdStockFields(stockid){
	var objX = getFrmObj('txtBannerAd' + stockid + 'X');
	var objY = getFrmObj('txtBannerAd' + stockid + 'Y');
	window.open('EditAdStockFields.asp?StockID=' + stockid + '&PageNo=' + intPageNo + '&X=' + objX.value + '&Y=' + objY.value,'StockEditor','width=400,height=700,scrollbars=1,resizable=1, status=1')
}

function btnEditUsersClick(){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="Register.asp"
	objFrm.submit()
}

var ContentHelpOff="no"
function btnEditContentClick(){
	e_StudioMax_edit_remoteCall('editable-1')
}

function btnEditContentClick2(){
	e_StudioMax_edit_remoteCall('editable-2')
}


//**********************

function btnMicroEditSet(){
	var obj = getFrmObj('txtMicroEditTop1');
	var TopValue=obj.value
	var obj = getFrmObj('txtMicroEditLeft1');
	var LeftValue=obj.value
	var PanelOb = getFrmObj(MoveObjectID);
	//alert ("TopValue: " + (parseInt(TopValue) + 74))
	PanelOb.style.top=(parseInt(TopValue) + 74);
	PanelOb.style.left=LeftValue;
	var PanelOb3 = getFrmObj('txt' + MoveObjectID + 'Y');
	var PanelOb4 = getFrmObj('txt' + MoveObjectID + 'X');
	PanelOb3.value=parseInt(TopValue);
	PanelOb4.value=LeftValue;
}

function btnEditPageTemp(){
	window.open('PageFormatEdit.asp?PageNo=' + intPageNo,'PageFormatEdit','width=610, height=700, scrollbars=1,resizable=1')
	//var obj = new getObj('PageFieldsEditDiv');
	//if (obj.style.visibility=='visible'){
	//	obj.style.visibility='hidden'
	//}else{
	//	obj.style.visibility='visible'
	//}
	var obj1 = new getObj('ChoosePageDesign');
	obj1.style.visibility='hidden'
	//if (obj.style.top<75){
	//	obj.style.top=80
	//}
}

function btnEditPageTempdblClick(){
	window.open('PageFormatEdit.asp?PageNo=' + intPageNo,'PageFormatEdit','width=610, height=700, scrollbars=1,resizable=1')
	//var obj = new getObj('PageFieldsEditDiv');
	//if (obj.style.visibility=='hidden' || obj.style.visibility==''){
	//	obj.style.visibility='visible'
	//}
	//if (obj.style.top<75){
	//	obj.style.top=80
	//}
}

function btnShowMenuFields(){
	var obj = new getObj('MenuFieldsEditDiv');
	if (intHori_Vert_Menu==0){
		window.open('HorizontalMenuEdit.asp?PageNo=' + intPageNo,'HoriMenuEdit','width=580, height=700, scrollbars=1,resizable=1')
		//if (obj.style.visibility=='visible'){
		//	obj.style.visibility='hidden'
		//}else{
		//	obj.style.visibility='visible'
		//	if (obj.style.top<75){
		//		obj.style.top=80
		//	}
		//}
		var obj1 = new getObj('MenuDesign');
		obj1.style.visibility='hidden'
	}else{
		window.open('VerticleMenuEdit.asp?PageNo=' + intPageNo,'HoriMenuEdit','width=580, height=700, scrollbars=1,resizable=1')
		//var obj2 = new getObj('VertMenuFieldsEditDiv');
		//if (obj2.style.visibility=='visible'){
		//	obj2.style.visibility='hidden'
		//}else{
		//	obj2.style.visibility='visible'
		//	if (obj2.style.top<75){
		//		obj2.style.top=80
		//	}
		//}
		var obj1 = new getObj('MenuDesign');
		obj1.style.visibility='hidden'
	}
}

function btnVertMenuShowClick(){
	var obj2 = new getObj('VertMenuFieldsEditDiv');
	obj2.style.visibility='visible'
	var obj1 = new getObj('MenuFieldsEditDiv');
	obj1.style.visibility='hidden'
	var obj3 = getFrmObj('txtHori_Vert_Menu');
	obj3.value="on"
	if (obj2.style.top<75){
		obj2.style.top=80
	}
}

function btnHoriMenuShowClick(){
	var obj2 = new getObj('VertMenuFieldsEditDiv');
	obj2.style.visibility='hidden'
	var obj1 = new getObj('MenuFieldsEditDiv');
	obj1.style.visibility='visible'
	var obj3 = getFrmObj('txtHori_Vert_Menu');
	obj3.value="off"
	if (obj1.style.top<75){
		obj1.style.top=80
	}
}

function btnEditPageClick(){
	window.open('ChoosePageFormat.asp?PageNo=' + intPageNo,'ChoosePageDesign','width=300, height=600, scrollbars=1,resizable=1')
	//var obj = new getObj('ChoosePageDesign');
	//if (obj.style.visibility=='visible'){
	//	obj.style.visibility='hidden'
	//}else{
	//	obj.style.visibility='visible'
	//}
	//if (obj.style.top<75){
	//	obj.style.top=80
	//}
}

function btnEditPagedblClick(){
	window.open('ChoosePageFormat.asp?PageNo=' + intPageNo,'ChoosePageDesign','width=300, height=600, scrollbars=1,resizable=1')
	//var obj = new getObj('ChoosePageDesign');
	//if (obj.style.visibility=='hidden'|| obj.style.visibility==''){
	//	obj.style.visibility='visible'
	//	var obj1 = new getObj('txtLogoDivY');
	//	obj1.value="NaN"
	//	var obj1 = new getObj('txtLogoDivX');
	//	obj1.value="NaN"
	//	var obj1 = new getObj('txtMicroEditLeft1');
	//	obj1.value=0
	//	var obj1 = new getObj('txtMicroEditTop1');
	//	obj1.value=0
	//}
	//if (obj.style.top<75){
	//	obj.style.top=80
	//}
}

function btnEditStockFormatClick(){
	var obj = new getObj('divStockFormatEdit');
	if (obj.style.visibility=='visible'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
	}
	if (obj.style.top<75){
		obj.style.top=80
	}
}

function btnEditMenuClick(){
	window.open('ChooseMenuFormat.asp?PageNo=' + intPageNo + '&intHori_Vert_Menu=' + intHori_Vert_Menu,'ChooseMenu','width=400, height=600, scrollbars=1,resizable=1')
	//var obj = new getObj('MenuDesign');
	//if (obj.style.visibility=='visible'){
	//	obj.style.visibility='hidden'
	//}else{
	//	obj.style.visibility='visible'
	//}
	//if (obj.style.top<75){
	//	obj.style.top=80
	//}
}

function btnEditSMenuClick(){
	window.open('ChooseMenuFormat2.asp?PageNo=' + intPageNo + '&intHori_Vert_Menu=1','ChooseMenu','width=400, height=600, scrollbars=1,resizable=1')
}

function btnEditMenudblClick(){
	var obj = new getObj('MenuDesign');
	if (obj.style.visibility=='hidden'|| obj.style.visibility==''){
		obj.style.visibility='visible'
		var obj1 = new getObj('txtSecMenuY');
		obj1.value="NaN"
		var obj1 = new getObj('txtSecMenuX');
		obj1.value="NaN"
		var obj1 = new getObj('txtMainMenuY');
		obj1.value="NaN"
		var obj1 = new getObj('txtMainMenuX');
		obj1.value="NaN"
		var obj1 = new getObj('txtMicroEditLeft1');
		obj1.value=0
		var obj1 = new getObj('txtMicroEditTop1');
		obj1.value=0
	}
	if (obj.style.top<75){
		obj.style.top=80
	}
}

function btnMetaTagsEditClick(){
	var obj = new getObj('MetaTagsEditDiv');
	if (obj.style.visibility=='visible'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
	}
	if (obj.style.top<75){
		obj.style.top=80
	}
}

function btnEditLogoClick(){
	var obj = new getObj('LogoEditDiv');
	if (obj.style.visibility=='visible'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
	}
	if (obj.style.top<75){
		obj.style.top=80
	}
}

function btnEditLogodblClick(){
	var obj = new getObj('LogoEditDiv');
	if (obj.style.visibility=='hidden'|| obj.style.visibility==''){
		obj.style.visibility='visible'
		var obj1 = new getObj('txtLogoImageDivY');
		obj1.value="NaN"
		var obj1 = new getObj('txtLogoImageDivX');
		obj1.value="NaN"
		var obj1 = new getObj('txtMicroEditLeft1');
		obj1.value=0
		var obj1 = new getObj('txtMicroEditTop1');
		obj1.value=0
	}
	if (obj.style.top<75){
		obj.style.top=80
	}
}

function btnGettingStartedClick(){
	window.open('HelpFiles.asp?HelpID=15','HelpFiles','width=650,height=500,top=0,left=0,scrollbars=1,resizable=1')
}

function btnSecurityClick(){
	var obj = new getObj('SecurityEditDiv');
	if (obj.style.visibility=='visible'){
		obj.style.visibility='hidden'
	}else{
		obj.style.visibility='visible'
		obj.style.zIndex=54
	}
	if (obj.style.top<75){
		obj.style.top=80
	}
}

function btnDeletePageDesignClick(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=DeletePageTmpl&DesignId=" + which
	objFrm.submit()
}

function btnDeleteMenuDesignClick(which){
	var objFrm = getFrmObj('frmEdit');
	objFrm.action="edit.asp?PageNo=" + intPageNo + "&Save=DeleteMenuTmpl&DesignId=" + which
	objFrm.submit()
}

// turn on and off check boxes
function chkTickBox_click(chkId){
	var chkObj = getFrmObj(chkId);

	if(chkObj.value=="on"){
		chkObj.value="off"
	}else{
		chkObj.value="on"
	}

	if (chkId=="txtTurnOffSalesTax"){
		btnSaveClick2('TurnOffSalesTax')
	}

	if (chkId=="txtForceSideMenu"){
		btnSaveClick2('ForceSideMenu')
	}

	if (chkId=="txtPageHidden"){
		btnSavePageAll()
	}

	if (chkId=="txtHideLogin"){
		btnSavePageAll()
	}

	if (chkId=="txtHideSearch"){
		btnSavePageAll()
	}

	if (chkId=="txtShowRateMe"){
		btnSavePageAll()
	}

	if (chkId=="txtModelSearchShow"){
		btnSavePageAll()
	}

	if (chkId=="txtHideBreadCrumb"){
		btnSavePageAll()
	}

	if (chkId=="txtDisplaySideMenu"){
		btnSavePageAll()
	}

	if (chkId=="txtShowAll"){
		btnSavePageAll()
	}
	if (chkId=="txtCurrencySelectShow"){
		btnSaveClick2('CurrencySelectShow')
	}
}

///////////////////////////////////////////////////////////////////////
//
// Element Drag & Drop
//
///////////////////////////////////////////////////////////////////////

// Determine browser and version.

function Browser() {

  var ua, s, i;

  this.isIE    = false;
  this.isNS    = false;
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();

function UnlockMainMenu(){
	var ButtonObj = getFrmObj("LockMainContent");
	var Lockobj = getFrmObj("lockelements");
	if (Lockobj.value == "yes"){
		Lockobj.value = "main"
		ButtonObj.innerHTML = "Lock Main Content"
	}else{
		Lockobj.value = "yes"
		ButtonObj.innerHTML = "Unlock Main Content"
	}

}

// Global object to hold drag information.

var dragObj = new Object();
dragObj.zIndex = 0;
var xM, yM;
var MoveObjectID
var MainContentObj

var ArrowID = 0

function dragStart(event, id) {
  var Lockobj = getFrmObj("lockelements");
  MainContentObj = "no"
  if (Lockobj.value=="no" || Lockobj.value=="main" || id=="EditImageGFields" || id=="EditCatagoryFields" || id=="EditListingFields" || id=="EditEventFields" || id=="TrolleyDiv"  || id=="ArrowDiv" || id=="WooObjFieldsDiv" || id=="AllWooObjectsDiv" || id=="PageWooObjectsDiv" || id=="FieldEditWooObjDiv" || id=="ExistWOFieldDiv" || id=="TextAreaEditorDiv"){
	  var el;
	  MoveObjectID=id
	  ArrowID = id

	  // If an element id was given, find it. Otherwise use the element being
	  // clicked on.

	  if (id)
		dragObj.elNode = document.getElementById(id);
	  else {
		if (browser.isIE)
		  dragObj.elNode = window.event.srcElement;
		if (browser.isNS)
		  dragObj.elNode = event.target;

		// If this is a text node, use its parent element.

		if (dragObj.elNode.nodeType == 3)
		  dragObj.elNode = dragObj.elNode.parentNode;
	  }

	  // Get cursor position with respect to the page.

	  if (browser.isIE) {
		xM = window.event.clientX + document.documentElement.scrollLeft
		  + document.body.scrollLeft;
		yM = window.event.clientY + document.documentElement.scrollTop
		  + document.body.scrollTop;
	  }
	  if (browser.isNS) {
		xM = event.clientX + window.scrollX;
		yM = event.clientY + window.scrollY;
	  }

	  // Save starting positions of cursor and element.

	  dragObj.cursorStartX = xM;
	  dragObj.cursorStartY = yM;
	  dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);
	  dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);

	  //alert(id)

	  if (id == "Content1Div"){
		  MainContentObj = "yes";
	  }

	  var oTop = getFrmObj('txt' + id + 'Y');
	  var oLeft = getFrmObj('txt' + id + 'X');

	  if (MainContentObj == "yes"){

		var oTop = getFrmObj('txtMainContentTop');
		var oLeft = getFrmObj('txtMainContentLeft');

	  }else{

		var oTop = getFrmObj('txt' + id + 'Y');
	  	var oLeft = getFrmObj('txt' + id + 'X');
	  }


	  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = parseInt(oLeft.value, 10);
	  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = parseInt(oTop.value,  10) + 74;

	  if (Lockobj.value=="no"){

		  var Obj1 = getFrmObj('txtMicroEditTop1');
			Obj1.value=parseInt(dragObj.elStartTop);
		  var Obj2 = getFrmObj('txtMicroEditLeft1');
			Obj2.value=parseInt(dragObj.elStartLeft);
	  }

	  if (MainContentObj == "yes"){

	  	var ObjMCT = getFrmObj('txtMainContentTop');
			ObjMCT.value=parseInt(dragObj.elStartTop);
		var ObjMCL = getFrmObj('txtMainContentLeft');
			ObjMCL.value=parseInt(dragObj.elStartLeft);

	  }

	  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
	  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 74;

	  if (Lockobj.value=="no"){

		  var Obj1 = getFrmObj('txtMicroEditTop1');
			Obj1.value=parseInt(dragObj.elStartTop);
		  var Obj2 = getFrmObj('txtMicroEditLeft1');
			Obj2.value=parseInt(dragObj.elStartLeft);
	  }


	  if (MainContentObj == "yes"){

		var ObjMCT = getFrmObj('txtMainContentTop');
			ObjMCT.value=parseInt(dragObj.elStartTop);
		var ObjMCL = getFrmObj('txtMainContentLeft');
			ObjMCL.value=parseInt(dragObj.elStartLeft);

	  }

	  // Update element's z-index.

	  //dragObj.elNode.style.zIndex = ++dragObj.zIndex;

	  // Capture mousemove and mouseup events on the page.

	  if (browser.isIE) {
		document.attachEvent("onmousemove", dragGo);
		document.attachEvent("onmouseup",   dragStop);
		window.event.cancelBubble = true;
		window.event.returnValue = false;
	  }
	  if (browser.isNS) {
		document.addEventListener("mousemove", dragGo,   true);
		document.addEventListener("mouseup",   dragStop, true);
		event.preventDefault();
	  }
   }
}

function dragStart2(event, id, locked) {
  var Lockobj = getFrmObj("lockelements");
  MainContentObj = "no"
  if (Lockobj.value=="no" || Lockobj.value=="main" || id=="TrolleyDiv" || id=="WooObjFieldsDiv" || id=="AllWooObjectsDiv" || id=="PageWooObjectsDiv" || id=="FieldEditWooObjDiv" || id=="ExistWOFieldDiv" || id=="TextAreaEditorDiv" || locked == "off"){
	  var el;
	  MoveObjectID=id

	  // If an element id was given, find it. Otherwise use the element being
	  // clicked on.

	  if (id)
		dragObj.elNode = document.getElementById(id);
	  else {
		if (browser.isIE)
		  dragObj.elNode = window.event.srcElement;
		if (browser.isNS)
		  dragObj.elNode = event.target;

		// If this is a text node, use its parent element.

		if (dragObj.elNode.nodeType == 3)
		  dragObj.elNode = dragObj.elNode.parentNode;
	  }

	  // Get cursor position with respect to the page.

	  if (browser.isIE) {
		xM = window.event.clientX + document.documentElement.scrollLeft
		  + document.body.scrollLeft;
		yM = window.event.clientY + document.documentElement.scrollTop
		  + document.body.scrollTop;
	  }
	  if (browser.isNS) {
		xM = event.clientX + window.scrollX;
		yM = event.clientY + window.scrollY;
	  }

	  // Save starting positions of cursor and element.

	  dragObj.cursorStartX = xM;
	  dragObj.cursorStartY = yM;
	  dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);
	  dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);

	  //alert(id)

	  if (id == "Content1Div"){
		  MainContentObj = "yes";
	  }

	  var oTop = getFrmObj('txt' + id + 'Y');
	  var oLeft = getFrmObj('txt' + id + 'X');

	  if (MainContentObj == "yes"){

		var oTop = getFrmObj('txtMainContentTop');
		var oLeft = getFrmObj('txtMainContentLeft');

	  }else{

		var oTop = getFrmObj('txt' + id + 'Y');
	  	var oLeft = getFrmObj('txt' + id + 'X');
	  }


	  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = parseInt(oLeft.value, 10);
	  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = parseInt(oTop.value,  10) + 74;

	  if (Lockobj.value=="no"){

		  var Obj1 = getFrmObj('txtMicroEditTop1');
			Obj1.value=parseInt(dragObj.elStartTop);
		  var Obj2 = getFrmObj('txtMicroEditLeft1');
			Obj2.value=parseInt(dragObj.elStartLeft);
	  }

	  if (MainContentObj == "yes"){

	  	var ObjMCT = getFrmObj('txtMainContentTop');
			ObjMCT.value=parseInt(dragObj.elStartTop);
		var ObjMCL = getFrmObj('txtMainContentLeft');
			ObjMCL.value=parseInt(dragObj.elStartLeft);

	  }

	  if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
	  if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 74;

	  if (Lockobj.value=="no"){

		  var Obj1 = getFrmObj('txtMicroEditTop1');
			Obj1.value=parseInt(dragObj.elStartTop);
		  var Obj2 = getFrmObj('txtMicroEditLeft1');
			Obj2.value=parseInt(dragObj.elStartLeft);
	  }


	  if (MainContentObj == "yes"){

		var ObjMCT = getFrmObj('txtMainContentTop');
			ObjMCT.value=parseInt(dragObj.elStartTop);
		var ObjMCL = getFrmObj('txtMainContentLeft');
			ObjMCL.value=parseInt(dragObj.elStartLeft);

	  }

	  // Update element's z-index.

	  //dragObj.elNode.style.zIndex = ++dragObj.zIndex;

	  // Capture mousemove and mouseup events on the page.

	  if (browser.isIE) {
		document.attachEvent("onmousemove", dragGo);
		document.attachEvent("onmouseup",   dragStop);
		window.event.cancelBubble = true;
		window.event.returnValue = false;
	  }
	  if (browser.isNS) {
		document.addEventListener("mousemove", dragGo,   true);
		document.addEventListener("mouseup",   dragStop, true);
		event.preventDefault();
	  }
   }
}

function dragGo(event) {

  // Get cursor position with respect to the page.

  if (browser.isIE) {
    xM = window.event.clientX + document.documentElement.scrollLeft
      + document.body.scrollLeft;
    yM = window.event.clientY + document.documentElement.scrollTop
      + document.body.scrollTop;
  }
  if (browser.isNS) {
    xM = event.clientX + window.scrollX;
    yM = event.clientY + window.scrollY;
  }

  // Move drag element by the same amount the cursor has moved.

  dragObj.elNode.style.left = (dragObj.elStartLeft + xM - dragObj.cursorStartX) + "px";
  if(MoveObjectID!="mainDiv"){
  	dragObj.elNode.style.top  = (dragObj.elStartTop  + yM - dragObj.cursorStartY) + "px";
  }

  if (ArrowID=="ArrowDiv"){
  	httpRequest('SetArrowVis.asp?top=' + (dragObj.elStartTop  + yM - dragObj.cursorStartY) + '&left=' + (dragObj.elStartLeft + xM - dragObj.cursorStartX), DisplayHelpArrow, "data");
  }

  if (browser.isIE) {
    window.event.cancelBubble = true;
    window.event.returnValue = false;
  }
  if (browser.isNS)
    event.preventDefault();
}

function dragStop(event) {

  var Lockobj = getFrmObj("lockelements");

  // Stop capturing mousemove and mouseup events.

  if (browser.isIE) {
    document.detachEvent("onmousemove", dragGo);
    document.detachEvent("onmouseup",   dragStop);
  }
  if (browser.isNS) {
    document.removeEventListener("mousemove", dragGo,   true);
    document.removeEventListener("mouseup",   dragStop, true);
  }

  if (MoveObjectID!=-1 || MoveObjectID!='' || MoveObjectID!='NaN'){

	if (Lockobj.value=="no"){

		var InputTop = getFrmObj('txt' + MoveObjectID + 'Y');
		var InVal1=parseInt(dragObj.elNode.style.top)-74;
		if (!isNaN(InVal1)) InputTop.value=parseInt(dragObj.elNode.style.top)-74;

		var InputLeft = getFrmObj('txt' + MoveObjectID + 'X');
		var InVal2=parseInt(dragObj.elNode.style.left);
		if (!isNaN(InVal2)) InputLeft.value=parseInt(dragObj.elNode.style.left);

		var ThisObj1 = getFrmObj('txtMicroEditTop1');
		ThisObj1.value=parseInt(dragObj.elNode.style.top)-74;
		var ThisObj2 = getFrmObj('txtMicroEditLeft1');
		ThisObj2.value=parseInt(dragObj.elNode.style.left);
	}

	//alert(MoveObjectID)

	if (MainContentObj == "yes"){

		var ObjMCT = getFrmObj('txtMainContentTop');
			ObjMCT.value=parseInt(dragObj.elNode.style.top)-74;
		var ObjMCL = getFrmObj('txtMainContentLeft');
			ObjMCL.value=parseInt(dragObj.elNode.style.left);

  	}

  }
}

document.write("<style>");
document.write(".moveme		{cursor: move;}");
document.write(".handle		{cursor: move;}");
document.write("</style>");