
//collapseing layers
function toggle(target) {

	obj=document.getElementById(target);
	obj.style.display=( (obj.style.display=='none') ? '' : 'none');
}

//hide layers
function hide(target) {

	obj=document.getElementById(target);
	obj.style.display = 'none';
}

//show layers
function show(target) {

	obj=document.getElementById(target);
	obj.style.display = 'block';
}

///////////

intstarted = '';
function starthide(target) {
	//alert(target);
	var thet = target;
	hidewin = setInterval('hide(\''+thet+'\')', 600);
	intstarted = 1;
}
function checkint() {
	if(intstarted) clearInterval(hidewin);
	intstarted = '';
}

function validateForm(contact){
	valid = true;
	err = '';
	if (contact.name.value == ''){
		contact.name.style.border = '1px solid #ff0000';
		//contact.name.style.borderColor = '#ff0000';
		valid = false;
		err = 'The Name Field Is Required!<br />';
	}
	
	if (contact.phone.value == ''){
		contact.phone.style.border = '1px solid #ff0000';
		valid = false;
		err += 'The Phone Field Is Required!<br />';
	}
	
	if (contact.email.value == ''){
		contact.email.style.border = '1px solid #ff0000';
		valid = false;
		err += 'The Email Field Is Required!<br />';
	}
	
	var str = contact.email.value;
	var filter=/^.+@.+\..{2,3}$/
	
	if (filter.test(str) == false) {
		contact.email.style.border = '1px solid #ff0000';
		err += 'The Email Address You entered Is Not Valid.<br />';
		valid = false;
	}
	
	if (contact.comment.value == ''){
		contact.comment.style.border = '1px solid #ff0000';
		valid = false;
		err += 'You forgot to leave a message!';
	}
		
	if(valid == false) {
		show('doall');
		document.getElementById('doall').innerHTML = err;
	}
	
	return valid;
}

////////////
////////////////////////Email////////////////////
function send()
{
var _u = "david";
var _d = "fineimaging";
var _s = ".com";
var _l = _u + "@" + _d + _s;
document.write("<a href='mailto:"+_l+"' class='linkWht'>"+_l+"</a>");
}
////////////////////////Pop Win////////////////////
function OpenBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
	  if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	  }
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth +',height='+myHeight);
}
///////////////////Text Edit Script///////////////
function text(type)
{
	var strText = document.f1.content.value;
	strText += '[';
	strText += type;
	strText += ']';
	strText += '[/';
	strText += type;
	strText += ']';
	document.f1.content.value = strText;
	document.f1.content.focus();
}
function nums(type)
{
	var strText = document.f1.content.value;
	strText += '[';
	strText += type;
	strText += ']';
	strText += '[/';
	strText += type;
	strText += ']';
	document.f1.content.value = strText;
	document.f1.content.focus();
}
function bulls(type)
{
	var strText = document.f1.content.value;
	strText += '[';
	strText += type;
	strText += ']';
	strText += '[/';
	strText += type;
	strText += ']';
	document.f1.content.value = strText;
	document.f1.content.focus();
}

/* admin header */

function validate_form ( )
{
	valid = true;
	if ( document.f1.quote.value == "" || document.f1.quoter.value == "")
	{
			alert ( "Please fill in all fields" );
			valid = false;
	}
	return valid;
}
function validate_form2 ( )
{
	valid = true;
	if (document.f2.faq_q.value == "" || document.f2.faq_a.value == "" || document.f2.price_item.value == "" || document.f2.price_amount.value == "")
	{
			alert ( "Please fill in all fields" );
			valid = false;
	}
	return valid;
}
function validate_form3 ( )
{
	valid = true;
	if (document.f3.price_item.value == "" || document.f3.price_amount.value == "")
	{
			alert ( "Please fill in all fields" );
			valid = false;
	}
	return valid;
}
function confirmIt() {
	if (confirm("This will delete the  user")) {
		return true;
	} else {
		return false;
	}
}

function validate(){
	var obj = document.f4;
	if (obj.username.value == "" || obj.password.value == ""){
		alert("username and password are required.");
		return false;
	}
	return true;
}