/* <form name="test"> <input type="text" maxlength="3" onkeyup="tab(this,test.second);"> <input type="text" maxlength="3" name="second"> */
function tab(doc,tab){
//doc=document.doc;
	if(doc.getAttribute("maxlength") && doc.value.length==doc.getAttribute("maxlength")) tab.focus()
}

// break out of outside frames
function framebreak(){
	if(window!=top) top.location.href=location.href;
}

function empty(){
 if(document.search.query.value=='Enter Search Phrase') document.search.query.value='';
}

function fill(){
	if(document.search.query.value=='') document.search.query.value='Enter Search Phrase';
}

function cancel(url){
location.href=url;
}

function href(url){
location.href=url;
}

function quick_profile(href){
window.open(href,'view_profile','scrollbars=yes,toolbar=no,location=no,status=no,resizable=yes');
}

function quick_blook(href){
window.open(href,'view_blook','scrollbars=yes,toolbar=no,location=no,status=no,resizable=yes');
}

function quick_art(href){
window.open(href,'view_art','scrollbars=yes,toolbar=no,location=no,status=no,resizable=yes');
}

function quick_film(href){
window.open(href,'view_film','scrollbars=yes,toolbar=no,location=no,status=no,resizable=yes');
}

function quick_band(href){
window.open(href,'view_band','scrollbars=yes,toolbar=no,location=no,status=no,resizable=yes');
}

function del(href,msg){
var is_confirmed=confirm(msg);
	if(is_confirmed){
	document.location.href=href;
	}
}

function zoom($href,$width,$height){
	if(!$width){ $width=parseInt(400); }
	if(!$height){ $height=parseInt(400); }
	$width=parseInt($width) + 50;
	$height=parseInt($height) + 50;
	window.open($href,'zoom','width='+$width+',height='+$height+',toolbars=no,status=no,scrollbars=yes');
}

function splash($url,$sec){
setTimeout('location.href="'+$url+'";',$sec);
}

function selected(obj, val) {
var x;
var len=obj.options.length;
	for (x=0;x<len;x++) {
		if (obj.options[x].value==val) {
		obj.selectedIndex=x;
		break;
		}
	}
}

function input(obj,val){
obj.value=val;
}

function invite(type){
	if(type=='band_invite'){ window.open('invite.html?invite=band','invite','width=400,height=400,toolbars=no,status=no,scrollbars=yes'); }
	else{ window.open('invite.html?invite=friend','invite','width=400,height=400,toolbars=no,status=no,scrollbars=yes'); }
}
