function getImageWidth(imgID) {
	return eval(imgID).width;
}

function getImageHeight(imgID) {
	return eval(imgID).height;
}

var banimg; //Placeholder for the bannerpicker so we can switch from the image selected to the bgcolor.


upArrow = 38; dnArrow = 40;  // names for important keys
pgUp = 33; pgDown = 34;  // names for important keys

function resize(e,val,orient) {

	var thiskey = (document.all) ? e.keyCode : e.which;
	var layerStyle = (document.all) ? document.all.header.style : document.getElementById('header').style;
	val = parseInt(val);

	if(isNaN(val)) val = 0;

	if(thiskey == upArrow) val++;
	else if(thiskey == dnArrow) val--;
	else if(thiskey == pgUp) val += 10;
	else if(thiskey == pgDown) val -= 10;

	if(orient == 1) layerStyle.width = val;
	else if(orient == 2) layerStyle.height = val;
	return val;
}

function rotate(e,val) {

	var thiskey = (document.all) ? e.keyCode : e.which;
	var layerStyle = (document.all) ? document.all.header.style : document.getElementById('header').style;
	val = parseInt(val);

	if(isNaN(val)) val = 0;

	if(thiskey == upArrow) val++;
	else if(thiskey == dnArrow) val--;
	else if(thiskey == pgUp) val += 10;
	else if(thiskey == pgDown) val -= 10;

	if(val > 359) val=0;
	if(val < 0) val=359;

	//layerStyle.width = val;
	document.images.image.src = "images/refimages/"+val+".png";

	return val;
}

function validate(){
	var test_text = (document.all) ? document.all.line2.value: document.getElementById('line2').value;

	if(test_text == ""){
		alert("Please enter text to sample");
		return false
	}
	return true;
}

var confirmWin= null;

function oContent(page,name,w,h,scroll,resize,bottom,left){

var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
var settings = 'height='+h+',';
	settings += 'width='+w+',';
	settings += 'scrollbars='+scroll+',';
	settings += 'resizable='+resize+',';
	settings += 'bottom='+wint+',';
    settings += 'left='+winl+' ';

	var confirmWin = window.open(page,name,settings);

  	if(confirmWin.opener==null){
		confirmWin.opener = self;
	}
	if(parseInt(navigator.appVersion) >= 4){
		confirmWin.window.focus();
	}
}

function process_a(re_url){
	// Refresh Parent Window
	opener.window.focus();
	opener.window.location = re_url;

	//self.close();
}

function process_b(re_url){
	// Refresh Parent Window
	opener.window.focus();
	opener.window.location = re_url;

	//self.close();
}
