function myPopUp(url,myname,wd,ht,mytop,myleft,mn,to,lo,dr,st,sc,re,pos,siz) {
var mdbPopUp;
	if(siz == "full") {wd = screen.width; ht = screen.height;}
	if(siz == "qtr") {wd = screen.width/2; ht = screen.height/2;}
	if(siz == "half") {wd = (screen.width/4)*3; ht = (screen.height/4)*3;}
	if(siz == "3qtr") {wd= (screen.width/8)*7; ht = (screen.height/8)*7;}				
	if(pos == "cen") {myleft = ((screen.width-wd)/2); mytop = ((screen.height-ht)/2);}	
	if(pos == "tprt") {myleft = ((screen.width-wd)-10); mytop = 0;}	
	if(pos == "tplf") {myleft = 0; mytop = 0;}		
	if(pos == "tpctr") {myleft = ((screen.width-wd)/2) ; mytop = 0;}	
	
settings="width=" + wd + ",height=" + ht + ",top=" + mytop + ",left=" + myleft + ",menubar=" + mn + ",toolbar=" + to + ",location=" + lo + ",directories=" + dr + ",status=" + st + ",scrollbars=" + sc + ",resizable=" + re;

	mdbPopUp = window.open(url,myname,settings);
    mdbPopUp.focus();
}

function CopyCode(codeName) {
	codeName.focus();
	codeName.select();
}

function copyColor(fontname, size, color, colorWindow, weight, decoration, preview) {
	if (document.hexdisp.hexvalnum.value == "")  {
    	alert("Please select a color from either palette before selecting the Copy button.");
     } else {
var source = document.hexdisp.hexvalnum.value;
preview.style.fontFamily = fontname;
preview.style.fontSize = size;
if (navigator.appName != "Microsoft Internet Explorer") {
	preview.style.fontWeight = weight;
	preview.style.textDecoration = decoration;
}
preview.style.color = source;
color.value = source;
colorWindow.style.backgroundColor = source;
preview.value = fontname;
}}

function PutFocus(fontname, size, color, colorWindow, weight, decoration, preview) {
	var source = color.value;
	preview.style.fontFamily = fontname;
	preview.style.fontSize = size;
if (navigator.appName != "Microsoft Internet Explorer") {
	preview.style.fontWeight = weight;
	preview.style.textDecoration = decoration;
}
	preview.style.color = source;
//	color.value = source;
	colorWindow.style.backgroundColor = source;
	preview.value = fontname;
}

function copyValues(focusName, focusColor) {
	if (document.hexdisp.hexvalnum.value == "")  {
    	alert("Please select a color from either palette before selecting the Copy button.");
     } else {
	var source = document.hexdisp.hexvalnum.value;
	focusColor.style.backgroundColor = source;
	focusName.value = source;
	var fontname = document.links.link_font.value;
	var size = document.links.link_font_size.value;
	var weight = document.links.link_bold.value;
	PutFocus(fontname, size, weight, 'none', source);
	
	focusName.focus();
	focusName.select();
	}
}

function scrollCopy(focusName, focusColor, display) {
	if (document.hexdisp.hexvalnum.value == "")  {
    	alert("Please select a color from either palette before selecting the Copy button.");
     } else {
	var source = document.hexdisp.hexvalnum.value;
	focusName.value = source;
	focusColor.style.backgroundColor = source;
	if (display == "light") {
		document.body.style.scrollbar3dLightColor = source;
	}
	if (display == "arrow") {
		document.body.style.scrollbarArrowColor = source;
	}
	if (display == "track") {
		document.body.style.scrollbarTrackColor = source;
	}
	if (display == "face") {
		document.body.style.scrollbarFaceColor = source;
	}
	if (display == "shadow") {
		document.body.style.scrollbarShadowColor = source;
	}
	if (display == "highlight") {
		document.body.style.scrollbarHighlightColor = source;
	}
	if (display == "dark") {
		document.body.style.scrollbarDarkShadowColor = source;
	}
}}

function refreshScroll(light, arrow, track, face, shadow, highlight, dark) { 
	document.body.style.scrollbar3dLightColor = light;
	document.body.style.scrollbarArrowColor = arrow;
	document.body.style.scrollbarTrackColor = track;
	document.body.style.scrollbarFaceColor = face;
	document.body.style.scrollbarShadowColor = shadow;
	document.body.style.scrollbarHighlightColor = highlight;
	document.body.style.scrollbarDarkShadowColor = dark;
}

function copyFocus(focusName) {
	if (document.hexdisp.hexvalnum.value == "")  {
    	alert("Please select a color from either palette before selecting the radio button.");
     } else {
	var source = document.hexdisp.hexvalnum.value;
	focusName.value = source;
	focusName.focus();
	focusName.select();
	}
}

function Msg_Alert(msg) {
	alert(msg);
}

function showColor(field, colorValue) {
document.scroll.lightcolor.style.backgroundColor = colorValue;
}

function WinOpen(page) {
   alert('\nPage will load to full screen.\n\nUse View/Document Source from menu bar to view source.\n\nClose new window to return to this page. ');
   window.open('page',"DisplayWindow","menubar=yes");
}

function setPointer(field, action, colorValue) {
	if (action == 'over') {
		 document.hexdisp.hexover.style.backgroundColor = colorValue;
		 document.hexdisp.hexovernum.value = colorValue;
		 window.status = "Click color " + colorValue + " to select it.";
	}
	if (action == 'out') {
		document.hexdisp.hexover.style.backgroundColor = "";
	 	document.hexdisp.hexovernum.value = "";
		window.status= "Move mouse cursor over a color...";
	}
	if (action == 'focus') {
// 		field.style.backgroundColor = document.style3Form.hexval.value;
		field.style.backgroundColor = colorValue;
	}
	if (action == 'click') {
		document.hexdisp.hexval.style.backgroundColor = colorValue;
		document.hexdisp.hexvalnum.value = colorValue;
		document.hexdisp.hexvalnum.select(); 
	}
}

function bookmark(){
var url = "http://www.mdbscripts.com";
var title = "Web Development Tools";
if(document.all)
window.external.AddFavorite(url,title)
}

function button( buttonName, imgUrl ) {
		buttonNameReset = new Image();
		buttonNameReset.src = imgUrl;
    document[buttonName].src = buttonNameReset.src;
}




