function popup(width,height,url) {
	window.open(url,"pop","width="+width+",height="+height+",location=yes,menubar=yes,scrollbars=yes,status=yes,titlebar=yes,toolbar=yes,resizable=yes");
}

function strpos(haystack, needle, offset) {
	var i = (haystack+'').indexOf(needle, (offset ? offset : 0));
	alert(haystack+'-'+needle+'-'+i);
	return i === -1 ? false : i;
}
function in_array( what, where ){
	var a=false;
	for(var i=0;i<where.length;i++){
		if(what == where[i]){
			a=true;
			break;
		}
	}
	return a;
}

function displayWhenNeeded(elid, value, conditionsarray){
	var xdisplay = 'none';
	if(in_array(value, conditionsarray)){
		xdisplay = 'block';
	}
	document.getElementById(elid).style.display = xdisplay;
}
function swapDisplay(elid){
	if(document.getElementById(elid).style.display == 'none'){
		document.getElementById(elid).style.display = 'block';
	}else{
		document.getElementById(elid).style.display = 'none';
	}
}
function ShowLogin(){
	document.getElementById('header_box_default').style.display='none';
	document.getElementById('header_box_login').style.display='block';
}

function ClearWhenNeeded(inputelement, checkval, replaceval){
	if(inputelement.value == checkval){
		inputelement.value = replaceval;
	}
}


