PositionX = 100;
PositionY = 100;
defaultWidth  = 500;
defaultHeight = 500;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=FFFFFF scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src="'+imageURL+'" style="display:block"></body></html>');
close();		
}}

String.prototype.toLocalURL=function(){
return 'file:///'+this.replace(/\\/g,'/')
};

String.prototype.ext=function(){
return this.slice(this.lastIndexOf('.')+1)
};

var validImages=['bmp','jpg','jpeg','gif','png'];

String.prototype.isImg=function(){
return validImages.hasMember(this.ext().toLowerCase())
};

Array.prototype.hasMember=function(testItem){
var i=this.length;
while(i--)if(testItem==this[i])return 1;
return 0
};

var testresults

function checkemail(email_value){
 var str=email_value
 var filter=/^.+\..{2,3}$/

 if (filter.test(str))
    testresults=true
 else {
    alert("Please input a valid domain that the tutorials will be viewed on (e.g. support.mydomain.com, www.mydomain.com, etc)")
    testresults=false
}
 return (testresults)
}


function checkUploadForm() {
 document.getElementById('domain_field').value=document.getElementById('mydomain').value;
 
 if (document.getElementById('domain_field').value == '') { alert('Please enter a domain before clicking submit'); return false; }
 if (document.getElementById('logo_field').value == '') { alert('Please choose a logo before clicking submit'); return false; }

 // imgPathUpload = document.upload.userfile.value;
 // if (!imgPathUpload) { alert('Please use the BROWSE button to find a logo prior to clicking this button.'); return false; }
}

function ValidateImg(imgPatha){
imgPath = imgPatha.value;
if(!imgPath.isImg()){
alert('The file:\n\n'+imgPath+'\n\nIs not a supported image.  The following image formats are supported:\n\n'+validImages.join('  '));
 document.upload.userfile.value = "";
return false;

}
}
function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		gen_Layer_1_copy_over = newImage("images/gen_Layer-1-copy-over.gif");
		continue_01_over = newImage("/images/continue_01-over.gif");
		continue_01_down = newImage("/images/continue_01-down.gif");
		preloadFlag = true;
	}
}






function popUpWinder(url,width,height) {
 show=window.open(url,'_blank','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=auto,resizable=no,width='+width+',height='+height);
}
function switchDiv(elementId, bolVisible) {if( document.getElementById ) { var theElement = document.getElementById(elementId); } else {if( document.all ) { var theElement = document.all[ elementId ]; } else { var theElement = new Object(); } }if( !theElement ) { return; }if( theElement.style ) { theElement = theElement.style; }if( typeof( theElement.display ) == 'undefined' && !( window.ScriptEngine && ScriptEngine().indexOf( 'InScript' ) + 1 ) ) { window.alert( 'The hidden divs in this page will not work with your browser. Please upgrade to a newer generation browser.' ); return; }if (bolVisible == true) {theElement.display = 'block';} else {theElement.display = 'none';}}
function showHide(elementId) {
switchDiv('cp_', false)
switchDiv('cm_', false)
switchDiv('em_', false)
switchDiv('sb_', false)
switchDiv('mi_', false)


var theElement = document.getElementById(elementId)
if (theElement.style.display == 'none') { switchDiv(elementId, true); }
else { switchDiv(elementId, false); }
}
function disableSubmit(whichButton)
{
    if (document.getElementById)
    {
        // this is the way the standards work
        document.getElementById(whichButton).disabled = true;
    }
    else if (document.all)
    {
        // this is the way old msie versions work
        document.all[whichButton].disabled = true;
    }
    else if (document.layers)
    {
        // this is the way nn4 works
        document.layers[whichButton].disabled = true;
    }
}

function enableSubmit(whichButton)
{
    if (document.getElementById)
    {
        // this is the way the standards work
        document.getElementById(whichButton).disabled = false;
    }
    else if (document.all)
    {
        // this is the way old msie versions work
        document.all[whichButton].disabled = false;
    }
    else if (document.layers)
    {
        // this is the way nn4 works
        document.layers[whichButton].disabled = false;
    }
}
