// jQuery script to handle band fans page



function searchTextBoxOnBlur() {

	if(document.getElementById('search_text').value == '') {
		//document.getElementById('search_text').value='Search for Band, Venue and City';
	}
	jQuery('#search_text').css({color:'#999999'});
	//document.getElementById('list_box').style.display="none";
}
function enterButton(url) {
		jQuery('#search_text').bind('keypress', function(e) {

        if(e.keyCode==13){
            submitForm(url);
        }
		jQuery('#search_text').css({color:'#000000'});

});
}
function submitForm(url) {
//alert(url);
	var type 	= 	jQuery('#selected_item').val();
	//var type	=	jQuery('#search_list :selected').val();
	var text	=	jQuery('#search_text').val();
	//alert(text);

	if(text=='Search for Band, Venue, Company or User' || text=='') {

		return false;
	} else {
		var res		=	'';
		if(type==0) {
			res	=	'band';
		} else if(type==1) {
			res	=	'venue';
		} else if(type==2) {
			res	=	'company';
		}
		else if(type==3) {
			res	=	'user';
		}

		window.location		=	url + 'search/'+ res +'/'+text + '/';
	}
}



function hide_block() {
	document.getElementById('list_box').style.display="none";
}

function show_image() {

	 document.getElementById("cloth_list").style.background = 'url(../../images/bg_dropdown_hover.png)';

}
function hide_image() {
	if(document.getElementById("cloth_list").className == "active")
		document.getElementById("cloth_list").style.background = 'url(../../images/bg_dropdown_hover.png)';
	else
		document.getElementById("cloth_list").style.background = "";
}


function getPosition(obj){
    var topValue= 0,leftValue= 0;
    while(obj){
	leftValue+= obj.offsetLeft;
	topValue+= obj.offsetTop;
	obj= obj.offsetParent;
    }
    finalvalue = leftValue + "," + topValue;
    return finalvalue;
}

