function verifemail2(email){         
	var a=email;         
	var test="" + a;         
	for(var k = 0; k < test.length;k++){             
		var c = test.substring(k,k+1);             
		if(c == "@"){
			return true;
		}
	}
	return false;
} 

function verifemail(email)
{
	var i = 0;
	
	if (email.length<4 && i<1) i++;
	if (email.search(/^[a-zA-Z0-9]+([._-]+[a-zA-Z0-9]+)*@[a-zA-Z0-9]+([._-][a-zA-Z0-9]+)*.[a-zA-Z]{2,4}$/)==-1 && i<1) i++;
	if (i>=1) return false;
	return true;
}


function verifcp(cp)
{
	var i = 0;
	if (cp.length!=5) i++;
	if (cp.search(/^[0-9][a-zA-Z0-9]([0-9]{3})/)==-1) i++;
	if (i>=1) return false;
	return true;
}


function Mouse_position_X(e)
{
	if(e.pageX){
		x = e.pageX ; 
	}else{
		x=e.x+document.documentElement.scrollLeft;
	}
	return x;
}

function Mouse_position_Y(e)
{
	if(e.pageY){
		y = e.pageY;
	}else{
		y=e.y+document.documentElement.scrollTop;
	}

	return y;
}

function popimgshow(url,e){
	x=Mouse_position_X(e);
	y=Mouse_position_Y(e);	
	document.getElementById("popimg").style.left=(x+15)+'px';
	document.getElementById("popimg").style.top=(y-10)+'px';
	document.getElementById("popimg").style.visibility='visible';
	document.getElementById("popimg").innerHTML='<img src="'+url+'">';

}
function popimghide(){
	document.getElementById("popimg").style.visibility='hidden';
	document.getElementById("popimg").innerHTML='';

}


//==========================================
// Show/hide toggle
//==========================================

function toggleview(id)
{
	if ( ! id ) return;
	
	if ( itm = my_getbyid(id) )
	{
		if (itm.style.display == "none")
		{
			my_show_div(itm);
		}
		else
		{
			my_hide_div(itm);
		}
	}
}

//==========================================
// Set DIV ID to hide
//==========================================

function my_hide_div(itm)
{
	if ( ! itm ) return;
	
	itm.style.display = "none";
}

//==========================================
// Set DIV ID to show
//==========================================

function my_show_div(itm)
{
	if ( ! itm ) return;
	
	itm.style.display = "";
}

function ShowHide(id1, id2)
{
	if (id1 != '') toggleview(id1);
	if (id2 != '') toggleview(id2);
}
//==========================================
// Get element by id
//==========================================

function my_getbyid(id)
{
	itm = null;
	
	if (document.getElementById)
	{
		itm = document.getElementById(id);
	}
	else if (document.all)
	{
		itm = document.all[id];
	}
	else if (document.layers)
	{
		itm = document.layers[id];
	}
	
	return itm;
}
