/*
function hpfxAccordion(cls) {
	
	$('.'+cls+' .main-heading').click(function(e) {
		
		$(this).siblings(".panel").not($(this).next()).slideUp('fast');

		$(this).next().slideDown('fast');
	
		return false;
		
	}).next().hide();
	
	$('.'+cls+' .main-heading:first').next().show();
	
}

function hpfxAccordion2(cls) {
	
	var initheight = $('.'+cls+' .main-heading:first').next().height();
	//alert(initheight);
	
	$('.'+cls+' .main-heading').click(function(e) {
		
		$(this).siblings(".panel").not($(this).next()).each(function(i){
			$(this).parent().css("overflow", "hidden");
			$(this).animate({ marginTop: -initheight+"px" }, 500, "swing").hide("fast");
			//$(this).animate({ marginTop: -initheight+"px" }, 500, "swing");
		});

		$(this).next().each(function(i){
			$(this).show();
			$(this).css("margin-top", -initheight+"px");
			$(this).animate({ marginTop: 0+"px" }, 500, "swing");
		});
	
		return false;
		
	}).next().hide();
	
	$('.'+cls+' .main-heading:first').next().show();

}


function hpfxPulldown(id, acls) {
	
	var initheight = $('#'+id).height();
	var togstate = "closed";

	$('#'+id).hide();

    $('.'+acls).click(function() {

		if(togstate == "closed"){
		
			$('#'+id).show();
			$('#'+id).css("margin-top", -initheight+"px");
			$('#'+id).animate({ marginTop: 0+"px" }, 500, "swing");
			togstate = "open";
		
		}else{
		
			$('#'+id).animate({ marginTop: -initheight+"px" }, 500, "swing").hide("fast");
			togstate = "closed";
		
		}
		
    });

}
*/

function hpfxGetAttrib(attrStr, attr){
	
	if(attrStr.indexOf(attr+"-") != -1){
	
		attrPos = attrStr.indexOf(attr+"-") + (attr.length+1);
		
		if(attrStr.substr(attrPos, attrStr.length).indexOf(" ") != -1){
			attrEnd = attrStr.substr(attrPos, attrStr.length).indexOf(" ");
		}else{
			attrEnd = attrStr.length;
		}
				
		attrVal = attrStr.substr(attrPos, attrEnd);
		
		return attrVal;
	
	}else{
		
		return false;
		
	}
	
}

/*
function hpfxModal(prop, val) {
	
	$("["+prop+"*='"+val+"']").fancybox({
	
		frameWidth: 545, frameHeight: 585, hideOnContentClick: false, centerOnScroll: false
	
	});

}
*/

$(document).ready(function() {

	//hpfxAccordion('accordion');
	hpfxPulldown('contact-panel', 'contactus');
	//hpfxModal('class','fancybox');
	//hpfxModal('class','superbox');

});