
view1=0;
view2=0;
view3=0;
view4=0;
view5=0;

isIE5 = false;
isNS4 = (document.layers) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;
/* This is the start of the code for the layers */
function show(object){
   if (isIE5 || isNS6)
      document.getElementById(object).style.visibility = "visible";
   if (isNS4)
      eval('document.' + object + '.visibility = "visible"');
}
/*function hide(object){
   if (isIE5 || isNS6){
   document.getElementById(object).style.visibility = "hidden";}
   if (isNS4){
      eval('document.' + object + '.visibility = "hidden"');}
}*/
function hide(object){
   if (isIE5 || isNS6){
   document.getElementById(object).style.display = "none";}
   if (isNS4){
      eval('document.' + object + '.display = "none"');}
}

function checka(){
	if(view1==0) {
	hide('look');
	hide('lookRO');
	}
}

function checkb(){
	if(view2==0) {
	hide('select');
	hide('selectRO');
	}
}

function checkc(){
	if(view3==0) {
	hide('review');
	hide('reviewRO');
	}
}

function checkd(){
	if(view4==0) {
	hide('profile');
	}
}

function checke(){
	if(view5==0) {
	hide('products');
	}
}

//function showp(object){
//	if(document.getElementById(object).style.visibility != "visible"){
//		hideportfolio();
//		if (isIE5 || isNS6)
//		document.getElementById(object).style.visibility = "visible";
//		if (isNS4)
//		eval('document.' + object + '.visibility = "visible"');
//	}

function showp(object){
	if(document.getElementById(object).style.display != "block"){
		hideportfolio();
		if (isIE5 || isNS6) {			
			document.getElementById(object).style.display = "block";
			//alert(document.getElementById(object).style.display);
		}
		if (isNS4)
		eval('document.' + object + '.display = "block"');
	}
}



function hideportfolio(){
	hide('infoa');
	hide('infob');
	hide('infoc');
	hide('infod');
	hide('infoe');
	hide('infof');
	hide('infog');
	hide('infoh');
	hide('infoi');
	hide('infoj');
	hide('infok');
	hide('infol');
	hide('infom');
	hide('infon');
	hide('infoo');
	hide('infop');
	hide('infoq');
	hide('infor');
	hide('infos');
	hide('infot');
}

/*
function newcontent(pageid){
	document.getElementById('folio').src = 'folio_detail.htm?pageid='+pageid;
}
*/
function newcontent(pageid){
	window.frames["folio"].ChangeContent(pageid);
}


function showhide(clearpw, encpw){
	if (document.getElementById(clearpw).style.display == 'none'){
		document.getElementById(clearpw).style.display = 'inline';
		document.getElementById(encpw).style.display = 'none';
	}
	else{
		document.getElementById(clearpw).style.display = 'none';
		document.getElementById(encpw).style.display = 'inline';
	}
}

/* Function that swaps images. */

function di20(id, newSrc) {
    //var theImage = FWFindImage(document, id, 0);
    //if (theImage) {
        document.getElementById(id).src = newSrc;
    //}
}

/* Functions that track and set toggle group button states. */

function FWFindImage(doc, name, j) {
    var theImage = false;
    if (doc.images) {
        theImage = doc.images[name];
    }
    if (theImage) {
        return theImage;
    }
    if (doc.layers) {
        for (j = 0; j < doc.layers.length; j++) {
            theImage = FWFindImage(doc.layers[j].document, name, 0);
            if (theImage) {
                return (theImage);
            }
        }
    }
    return (false);
}

function popMore(source){
	newView = window.open(source,"popup","width=700,height=500,resizable=1,scrollbars=1,toolbar=0,menubar=0,location=0")
	newView.focus();
}

function popPort(source){
	newView = window.open(source,"pic","width=400,height=530,resizable=0,scrollbars=0,toolbar=0,menubar=0,location=0")
	newView.focus();
}

function popLand(source){
	newView = window.open(source,"landscp","width=530,height=400,resizable=0,scrollbars=0,toolbar=0,menubar=0,location=0")
	newView.focus();
}

function popLegal(source){
	newView = window.open(source,"legal","width=400,height=300,resizable=0,scrollbars=1,toolbar=0,menubar=0,location=0")
	newView.focus();
}

function popExt(source){
	newView = window.open(source,"out","width=800,height=600,resizable=1,scrollbars=1,toolbar=1,menubar=1,location=1")
	newView.focus();
}

function popGal(source){
	newView = window.open(source,"gallery","width=600,height=550,resizable=0,scrollbars=0,toolbar=0,menubar=0,location=0")
	newView.focus();
}

function SubNav(subID, subButtonID) {
	var oSubNav = document.getElementById(subID);
	var oSubButton = document.getElementById(subButtonID);	
	if (oSubNav.style.display == "none") {
		oSubNav.style.display = "block";
		oSubButton.src = "images/btn_collapse.gif";
		oSubButton.alt = "collapse";
	}
	else {
		oSubNav.style.display = "none";
		oSubButton.src = "images/btn_expand.gif";
		oSubButton.alt = "expand";		
	}
}

function SubNav2(subID, subButtonID) {
	var oSubNav = document.getElementById(subID);
	var oSubButton = document.getElementById(subButtonID);	
	if (oSubNav.style.display == "none") {
		oSubNav.style.display = "block";
		oSubButton.src = "images/btn_collapse_blue.gif";
		oSubButton.alt = "collapse";
	}
	else {
		oSubNav.style.display = "none";
		oSubButton.src = "images/btn_expand_blue.gif";
		oSubButton.alt = "expand";		
	}
}

function ValidateEmail(sEmail)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(sEmail)) {
		return false;
	}
	
	return true;
}
