//*******************************************
//FULLSCREEN POPUP
//*******************************************
function OpenFullWindow(targeturl){
	window.open(targeturl,"","fullscreen")
}

//*******************************************
//POP-UP WINDOW
//*******************************************
function OpenBrWindow(theURL,winName,features) {
	Window = window.open(theURL,winName,features);
}

function checkLength(which){
	document.getElementById("lblCommentLen").innerHTML = "Total Length: " + which.value.length;
	if(which.value.length > which.limit-1) {
		return false;
	}else{
		return true;
	}
}

function display(myimage,title) {
	html = "" +
	"<HTML>\n" +
	"<HEAD>\n" + 
	"<TITLE>" + title + "</TITLE>\n" +
	"</HEAD>\n" + 
	"<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>\n" +
	"<TABLE style='width:100%;height:100%'>\n" +
	"	<TR>\n" +
	"		<TD align=center><IMG SRC='" + myimage + "' BORDER=0 NAME=image onload='window.resizeTo(document.image.width+50,document.image.height+80)'></TD>\n" +
	"	</TR>\n" +
	"</TABLE>\n" +
	"</BODY>\n" + 
	"</HTML>\n";
	
	popup=window.open('','image','top=20,left=20,toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
	popup.document.open();
	popup.document.write(html);
	popup.document.focus();
	popup.document.close()
}


function Confirmation(str){
	return confirm(str);
}

RollOff = new Array()
RollOn = new Array()
	
RollOff[1] = "images/tabProductsOff.gif";
RollOff[2] = "images/tabFinklTourOff.gif";
RollOff[3] = "images/tabAboutFinklOff.gif";
RollOff[4] = "images/tabGreenThumbOff.gif";
RollOff[5] = "images/tabLoginOff.gif";

RollOn[1] = "images/tabProductsOn.gif"; 
RollOn[2] = "images/tabFinklTourOn.gif";
RollOn[3] = "images/tabAboutFinklOn.gif";
RollOn[4] = "images/tabGreenThumbOn.gif";
RollOn[5] = "images/tabLoginOn.gif";

function swap(type,objname,id){
	var obj = document.getElementById(objname);
	if(type == 1){
		obj.src = RollOn[id];
	}else{
		obj.src = RollOff[id];
	}
}

function CreateArray(){
	var AllNames = Array('divHome','divProjects','divStrategy','divBlog','divAbout');
	var FinalArray = Array(AllNames.length);
	for(var i=0;i<AllNames.length;i++){
		FinalArray[i] = document.getElementById(AllNames[i]);
	}
	return FinalArray;
}


function show(num){
	for(var i=0;i<CreateArray().length;i++){
		var obj = CreateArray()[i];
		if(i == num){
			obj.style.display = 'block';
		}else{
			obj.style.display = 'none';
		}
	}
}

function FocusClear(which,str){
	if(which.value == str){
		which.value = "";
	}
}
function BlurClear(which,str){
	if(which.value == ""){
		which.value = str;
	}
}

function Toggle(layer){
	Restart();
	var theLayer = document.getElementById(layer);
	theLayer.style.display = (theLayer.style.display == "none" || theLayer.style.display == "") ? "block" : "none";
}

function ToggleFAFA(){
	var theDivs = Array("fafa01","fafa02","fafa03","fafa04","fafa05","fafa06");
	for(var i=0;i<theDivs.length;i++){
		var obj = document.getElementById(theDivs[i]);
		obj.style.display = (obj.style.display == "none" || obj.style.display == "") ? "block" : "none";
	}
}
